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

Unified Diff: sdk/lib/_internal/compiler/implementation/util/util.dart

Issue 24282005: Move compile-time constant registrations to the backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status Created 7 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 | « sdk/lib/_internal/compiler/implementation/typechecker.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/util/util.dart
diff --git a/sdk/lib/_internal/compiler/implementation/util/util.dart b/sdk/lib/_internal/compiler/implementation/util/util.dart
index 2638fd84173295ccfd875579754940fb7ea10795..c904cc14e5e50159ac919fb0ded55c27cf8dc8d5 100644
--- a/sdk/lib/_internal/compiler/implementation/util/util.dart
+++ b/sdk/lib/_internal/compiler/implementation/util/util.dart
@@ -77,6 +77,11 @@ class _StackTraceLine {
_StackTraceLine(this.index, this.file, this.lineNo,
this.columnNo, this.method);
+
+ String toString() {
+ return 'index=$index, file=$file, '
+ 'lineNo=$lineNo, columnNo=$columnNo, method=$method';
+ }
}
// TODO(johnniwinther): Use this format for --throw-on-error.
@@ -123,14 +128,31 @@ String prettifyStackTrace(StackTrace s,
int lastColon = line.lastIndexOf(':', rightParenPos);
int nextToLastColon = line.lastIndexOf(':', lastColon-1);
- String lineNo = line.substring(nextToLastColon+1, lastColon);
+ String lineNo;
+ String columnNo;
+ if (nextToLastColon != -1) {
+ lineNo = line.substring(nextToLastColon+1, lastColon);
+ columnNo = line.substring(lastColon+1, rightParenPos);
+ try {
+ int.parse(lineNo);
+ } on FormatException catch (e) {
+ lineNo = columnNo;
+ columnNo = '';
+ nextToLastColon = lastColon;
+ }
+ } else {
+ lineNo = line.substring(lastColon+1, rightParenPos);
+ columnNo = '';
+ nextToLastColon = lastColon;
+ }
+
if (lineNo.length > maxLineNoLength) {
maxLineNoLength = lineNo.length;
}
- String columnNo = line.substring(lastColon+1, rightParenPos);
if (columnNo.length > maxColumnNoLength) {
maxColumnNoLength = columnNo.length;
}
+
String file = line.substring(leftParenPos+1, nextToLastColon);
if (filePrefix != null && file.startsWith(filePrefix)) {
file = file.substring(filePrefix.length);
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/typechecker.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698