Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1311)

Unified Diff: pkg/compiler/lib/src/helpers/trace.dart

Issue 1322973007: Use memory compiler in compiler_helper.dart. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update cf. comments. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/dart2js.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b928bb6add130e2f833ee0d87ac3c910bd22867d 100644
--- a/pkg/compiler/lib/src/helpers/trace.dart
+++ b/pkg/compiler/lib/src/helpers/trace.dart
@@ -131,8 +131,9 @@ class StackTraceLines {
// Dart VM are:
// #n <method-name> (<uri>:<line-no>:<column-no>)
// #n <method-name> (<uri>:<line-no>)
+ // #n <method-name> (<uri>)
// in which '<anonymous closure>' is the name used for an (unnamed) function
- // expression.
+ // expression. The last case is used for async bodies.
for (String line in stackTrace.split('\n')) {
try {
index++;
@@ -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) {
« no previous file with comments | « pkg/compiler/lib/src/dart2js.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698