Chromium Code Reviews| Index: pkg/compiler/lib/src/helpers/trace.dart |
| diff --git a/pkg/compiler/lib/src/helpers/trace.dart b/pkg/compiler/lib/src/helpers/trace.dart |
| index f19b0d0c3b0df9b76dc991091d9889a82a09a7f5..c0f35506429e92ac651397118a5821de633e3eb4 100644 |
| --- a/pkg/compiler/lib/src/helpers/trace.dart |
| +++ b/pkg/compiler/lib/src/helpers/trace.dart |
| @@ -131,6 +131,7 @@ class StackTraceLines { |
| // Dart VM are: |
| // #n <method-name> (<uri>:<line-no>:<column-no>) |
| // #n <method-name> (<uri>:<line-no>) |
| + // #n <method-name> (<uri>) |
|
Johnni Winther
2015/09/09 13:43:07
Needed to support async bodies.
sigurdm
2015/09/10 06:37:51
Perhaps write that in a comment
Johnni Winther
2015/09/11 10:42:06
Done.
|
| // in which '<anonymous closure>' is the name used for an (unnamed) function |
| // expression. |
| for (String line in stackTrace.split('\n')) { |
| @@ -154,16 +155,33 @@ class StackTraceLines { |
| lineNo = line.substring(nextToLastColon+1, lastColon); |
| columnNo = line.substring(lastColon+1, rightParenPos); |
| try { |
| - int.parse(lineNo); |
| + int.parse(columnNo); |
| + try { |
| + int.parse(lineNo); |
| + } on FormatException { |
| + // Only line number. |
| + lineNo = columnNo; |
| + columnNo = ''; |
| + nextToLastColon = lastColon; |
| + } |
| } on FormatException { |
| - lineNo = columnNo; |
| + // No column number nor line number. |
| + lineNo = ''; |
| columnNo = ''; |
| - nextToLastColon = lastColon; |
| + nextToLastColon = rightParenPos; |
| } |
| } else { |
| lineNo = line.substring(lastColon+1, rightParenPos); |
| columnNo = ''; |
| - nextToLastColon = lastColon; |
| + try { |
| + int.parse(lineNo); |
| + nextToLastColon = lastColon; |
| + } on FormatException { |
| + // No column number nor line number. |
| + lineNo = columnNo; |
| + columnNo = ''; |
| + nextToLastColon = rightParenPos; |
| + } |
| } |
| if (lineNo.length > maxLineNoLength) { |