@@ -10,8 +10,12 @@ import 'package:source_maps/source_maps.dart';
1010import 'dart2js_mapping.dart' ;
1111import 'trace.dart' ;
1212
13- String ? translate (String ? error, Dart2jsMapping ? mapping,
14- [StackTraceLine ? line, TargetEntry ? entry]) {
13+ String ? translate (
14+ String ? error,
15+ Dart2jsMapping ? mapping, [
16+ StackTraceLine ? line,
17+ TargetEntry ? entry,
18+ ]) {
1519 for (var decoder in _errorMapDecoders) {
1620 var result = decoder.decode (error, mapping, line, entry);
1721 // More than one decoder might be applied on a single error message. This
@@ -31,8 +35,12 @@ abstract class ErrorMapDecoder {
3135 /// Decode [error] that was reported in [line] and has a corresponding [entry]
3236 /// in the source-map file. The provided [mapping] includes additional
3337 /// minification data that may be used to decode the error message.
34- String ? decode (String ? error, Dart2jsMapping ? mapping, StackTraceLine ? line,
35- TargetEntry ? entry) {
38+ String ? decode (
39+ String ? error,
40+ Dart2jsMapping ? mapping,
41+ StackTraceLine ? line,
42+ TargetEntry ? entry,
43+ ) {
3644 if (error == null ) return null ;
3745 Match ? lastMatch;
3846 var result = StringBuffer ();
@@ -50,20 +58,33 @@ abstract class ErrorMapDecoder {
5058 return '$result ' ;
5159 }
5260
53- String ? _decodeInternal (Match match, Dart2jsMapping ? mapping,
54- StackTraceLine ? line, TargetEntry ? entry);
61+ String ? _decodeInternal (
62+ Match match,
63+ Dart2jsMapping ? mapping,
64+ StackTraceLine ? line,
65+ TargetEntry ? entry,
66+ );
5567}
5668
57- typedef ErrorDecoder = String Function (Match match, Dart2jsMapping mapping,
58- StackTraceLine line, TargetEntry entry);
69+ typedef ErrorDecoder =
70+ String Function (
71+ Match match,
72+ Dart2jsMapping mapping,
73+ StackTraceLine line,
74+ TargetEntry entry,
75+ );
5976
6077class MinifiedNameDecoder extends ErrorMapDecoder {
6178 @override
6279 final RegExp _matcher = RegExp ("minified:([a-zA-Z0-9_\$ ]*)" );
6380
6481 @override
65- String ? _decodeInternal (Match match, Dart2jsMapping ? mapping,
66- StackTraceLine ? line, TargetEntry ? entry) {
82+ String ? _decodeInternal (
83+ Match match,
84+ Dart2jsMapping ? mapping,
85+ StackTraceLine ? line,
86+ TargetEntry ? entry,
87+ ) {
6788 var minifiedName = match.group (1 );
6889 return mapping! .globalNames[minifiedName];
6990 }
@@ -74,8 +95,12 @@ class CannotReadPropertyDecoder extends ErrorMapDecoder {
7495 final RegExp _matcher = RegExp ("Cannot read property '([^']*)' of" );
7596
7697 @override
77- String ? _decodeInternal (Match match, Dart2jsMapping ? mapping,
78- StackTraceLine ? line, TargetEntry ? entry) {
98+ String ? _decodeInternal (
99+ Match match,
100+ Dart2jsMapping ? mapping,
101+ StackTraceLine ? line,
102+ TargetEntry ? entry,
103+ ) {
79104 var minifiedName = match.group (1 );
80105 var name = mapping! .instanceNames[minifiedName];
81106 if (name == null ) return null ;
@@ -141,11 +166,16 @@ abstract class NoSuchMethodDecoderBase extends ErrorMapDecoder {
141166class NoSuchMethodDecoder1 extends NoSuchMethodDecoderBase {
142167 @override
143168 final RegExp _matcher = RegExp (
144- "NoSuchMethodError: method not found: '([^']*)'( on [^\\ (]*)? \\ (.*\\ )" );
169+ "NoSuchMethodError: method not found: '([^']*)'( on [^\\ (]*)? \\ (.*\\ )" ,
170+ );
145171
146172 @override
147- String ? _decodeInternal (Match match, Dart2jsMapping ? mapping,
148- StackTraceLine ? line, TargetEntry ? entry) {
173+ String ? _decodeInternal (
174+ Match match,
175+ Dart2jsMapping ? mapping,
176+ StackTraceLine ? line,
177+ TargetEntry ? entry,
178+ ) {
149179 var minifiedName = match.group (1 );
150180 var suffix = match.group (2 ) ?? '' ;
151181 var name = _translateMinifiedName (mapping! , minifiedName);
@@ -156,12 +186,17 @@ class NoSuchMethodDecoder1 extends NoSuchMethodDecoderBase {
156186
157187class NoSuchMethodDecoder2 extends NoSuchMethodDecoderBase {
158188 @override
159- final RegExp _matcher =
160- RegExp ("NoSuchMethodError: method not found: '([^']*)'" );
189+ final RegExp _matcher = RegExp (
190+ "NoSuchMethodError: method not found: '([^']*)'" ,
191+ );
161192
162193 @override
163- String ? _decodeInternal (Match match, Dart2jsMapping ? mapping,
164- StackTraceLine ? line, TargetEntry ? entry) {
194+ String ? _decodeInternal (
195+ Match match,
196+ Dart2jsMapping ? mapping,
197+ StackTraceLine ? line,
198+ TargetEntry ? entry,
199+ ) {
165200 var minifiedName = match.group (1 );
166201 var name = _translateMinifiedName (mapping! , minifiedName);
167202 if (name == null ) return null ;
@@ -174,8 +209,12 @@ class UnhandledNotAFunctionError extends ErrorMapDecoder {
174209 final RegExp _matcher = RegExp ("Error: ([^']*) is not a function" );
175210
176211 @override
177- String ? _decodeInternal (Match match, Dart2jsMapping ? mapping,
178- StackTraceLine ? line, TargetEntry ? entry) {
212+ String ? _decodeInternal (
213+ Match match,
214+ Dart2jsMapping ? mapping,
215+ StackTraceLine ? line,
216+ TargetEntry ? entry,
217+ ) {
179218 var minifiedName = match.group (1 );
180219 var name = mapping! .instanceNames[minifiedName];
181220 if (name == null ) return null ;
0 commit comments