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

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: 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
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) {
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | pkg/compiler/lib/src/js_backend/backend.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698