@@ -66,7 +66,7 @@ Mapping parseJson(Map map,
6666 if (map.containsKey ('mappings' ) ||
6767 map.containsKey ('sources' ) ||
6868 map.containsKey ('names' )) {
69- throw FormatException ('map containing "sections" '
69+ throw const FormatException ('map containing "sections" '
7070 'cannot contain "mappings", "sources", or "names".' );
7171 }
7272 return MultiSectionMapping .fromJson (map['sections' ] as List , otherMaps,
@@ -110,13 +110,13 @@ class MultiSectionMapping extends Mapping {
110110 {/*String|Uri*/ Object ? mapUrl}) {
111111 for (var section in sections.cast <Map >()) {
112112 var offset = section['offset' ] as Map ? ;
113- if (offset == null ) throw FormatException ('section missing offset' );
113+ if (offset == null ) throw const FormatException ('section missing offset' );
114114
115115 var line = offset['line' ] as int ? ;
116- if (line == null ) throw FormatException ('offset missing line' );
116+ if (line == null ) throw const FormatException ('offset missing line' );
117117
118118 var column = offset['column' ] as int ? ;
119- if (column == null ) throw FormatException ('offset missing column' );
119+ if (column == null ) throw const FormatException ('offset missing column' );
120120
121121 _lineStart.add (line);
122122 _columnStart.add (column);
@@ -125,7 +125,8 @@ class MultiSectionMapping extends Mapping {
125125 var map = section['map' ] as Map ? ;
126126
127127 if (url != null && map != null ) {
128- throw FormatException ("section can't use both url and map entries" );
128+ throw const FormatException (
129+ "section can't use both url and map entries" );
129130 } else if (url != null ) {
130131 var other = otherMaps? [url];
131132 if (otherMaps == null || other == null ) {
@@ -137,11 +138,11 @@ class MultiSectionMapping extends Mapping {
137138 } else if (map != null ) {
138139 _maps.add (parseJson (map, otherMaps: otherMaps, mapUrl: mapUrl));
139140 } else {
140- throw FormatException ('section missing url or map' );
141+ throw const FormatException ('section missing url or map' );
141142 }
142143 }
143144 if (_lineStart.isEmpty) {
144- throw FormatException ('expected at least one section' );
145+ throw const FormatException ('expected at least one section' );
145146 }
146147 }
147148
@@ -342,7 +343,7 @@ class SingleMapping extends Mapping {
342343 urls.keys.toList (), names.keys.toList (), lines);
343344 }
344345
345- SingleMapping .fromJson (Map <String , dynamic > map, {mapUrl})
346+ SingleMapping .fromJson (Map <String , dynamic > map, {Object ? mapUrl})
346347 : targetUrl = map['file' ] as String ? ,
347348 urls = List <String >.from (map['sources' ] as List ),
348349 names = List <String >.from ((map['names' ] as List ? ) ?? []),
0 commit comments