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

Unified Diff: tests/compiler/dart2js/sourcemaps/stacktrace_test.dart

Issue 2654023003: Add no-info mappings at start of out.js and after mapped functions (Closed)
Patch Set: fixes Created 3 years, 11 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 | « tests/compiler/dart2js/sourcemaps/sourcemap_visualizer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 39617a8bb27f66bf9f62c3fc6012eb6031c462a9..185b8a58ccc561fe14787c5e8b37f2f29df06d00 100644
--- a/tests/compiler/dart2js/sourcemaps/stacktrace_test.dart
+++ b/tests/compiler/dart2js/sourcemaps/stacktrace_test.dart
@@ -117,6 +117,19 @@ test() {
'''
import 'package:expect/expect.dart';
main() {
+ @{1:main}test(new Class());
+}
+@NoInline()
+test(c) {
+ @{2:test}c.field.method();
+}
+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();
}
@@ -277,15 +290,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));
}
}
@@ -293,15 +300,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,
« no previous file with comments | « tests/compiler/dart2js/sourcemaps/sourcemap_visualizer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698