Index: tests/compiler/dart2js/sourcemaps/stacktrace_test.dart |
diff --git a/tests/compiler/dart2js/sourcemaps/stacktrace_test.dart b/tests/compiler/dart2js/sourcemaps/stacktrace_test.dart |
index 89d1ff7ba671e52a987b9ea9da1a48ec1a63e5b7..90e68fc10f1cdb0ecf3d2a9df47cc447da08001a 100644 |
--- a/tests/compiler/dart2js/sourcemaps/stacktrace_test.dart |
+++ b/tests/compiler/dart2js/sourcemaps/stacktrace_test.dart |
@@ -116,6 +116,19 @@ test() { |
''' |
import 'package:expect/expect.dart'; |
main() { |
+ @{1:main}test(new Class()); |
+} |
+@NoInline() |
+test(c) { |
+ @{2:test}c.field.method(); |
Johnni Winther
2017/01/25 10:44:20
Previously the stack trace for this would wrongful
Siggi Cherem (dart-lang)
2017/01/25 16:15:09
What did the frames look like before?
I'm guessin
Johnni Winther
2017/01/26 09:59:14
It had multiple occurrences of the 'test' frame (f
|
+} |
+class Class { |
+ var field; |
+} |
+''', |
+ ''' |
+import 'package:expect/expect.dart'; |
+main() { |
// This call is no longer on the stack when the error is thrown. |
@{:main}test(); |
} |
@@ -308,15 +321,9 @@ Future runTest(int index, Test test, |
} |
List<String> lines = out.split(new RegExp(r'(\r|\n|\r\n)')); |
List<StackTraceLine> jsStackTrace = <StackTraceLine>[]; |
- bool seenMarker = false; |
for (String line in lines) { |
- if (seenMarker) { |
- line = line.trim(); |
- if (line.startsWith('at ')) { |
- jsStackTrace.add(new StackTraceLine.fromText(line)); |
- } |
- } else if (line == EXCEPTION_MARKER) { |
- seenMarker = true; |
+ if (line.startsWith(' at ')) { |
+ jsStackTrace.add(new StackTraceLine.fromText(line)); |
} |
} |
@@ -324,15 +331,15 @@ Future runTest(int index, Test test, |
for (StackTraceLine line in jsStackTrace) { |
TargetEntry targetEntry = _findColumn(line.lineNo - 1, line.columnNo - 1, |
_findLine(sourceMap, line.lineNo - 1)); |
- if (targetEntry == null) { |
+ if (targetEntry == null || targetEntry.sourceUrlId == null) { |
dartStackTrace.add(line); |
} else { |
String methodName; |
- if (targetEntry.sourceNameId != 0) { |
+ if (targetEntry.sourceNameId != null) { |
methodName = sourceMap.names[targetEntry.sourceNameId]; |
} |
String fileName; |
- if (targetEntry.sourceUrlId != 0) { |
+ if (targetEntry.sourceUrlId != null) { |
fileName = sourceMap.urls[targetEntry.sourceUrlId]; |
} |
dartStackTrace.add(new StackTraceLine(methodName, fileName, |