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

Unified Diff: tests/compiler/dart2js/source_mapping_test.dart

Issue 10809004: Attach source map positions to returns, sends, and some operators. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 | « lib/compiler/implementation/ssa/builder.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/source_mapping_test.dart
diff --git a/tests/compiler/dart2js/source_mapping_test.dart b/tests/compiler/dart2js/source_mapping_test.dart
index a70aab548e937d61f7ae4849eb50b9921187aa4f..34140cfdad06a616473e87872d97d1997dee7a0c 100644
--- a/tests/compiler/dart2js/source_mapping_test.dart
+++ b/tests/compiler/dart2js/source_mapping_test.dart
@@ -53,6 +53,26 @@ String FUNCTIONS_TEST = '''
@void main() { print(test(15)); @}
@int test(int x) { return x; @}''';
+String RETURN_TEST = 'void main() { print(((x) { @return x; })(0)); }';
+
+String NOT_TEST = 'void main() { ((x) { if (@!x) print(x); })(false); }';
+
+String UNARY_TEST = 'void main() { ((x, y) { print(@-x + @~y); })(1,2); }';
+
+String BINARY_TEST = 'void main() { ((x, y) { if (x @!== y) print(x @* y); })(1,2); }';
+
+String SEND_TEST = '''
+void main() {
+ @staticSend(0);
+ NewSend o = new @NewSend();
+ @o.dynamicSend(0);
+ var closureSend = (x) { print(x); };
+ @closureSend(0);
+}
+void staticSend(x) { print(x); }
+class NewSend { void dynamicSend(x) { print(x); } }
+''';
+
main() {
// These tests are fragile, since mappings for specific source locations
// could disappear due to various optimizations like code elimination,
@@ -60,4 +80,9 @@ main() {
// so that the new code is not optimized, otherwise just remove the marker
// from problematic location.
testSourceMapLocations(FUNCTIONS_TEST);
+ testSourceMapLocations(RETURN_TEST);
+ testSourceMapLocations(NOT_TEST);
+ testSourceMapLocations(UNARY_TEST);
+ testSourceMapLocations(BINARY_TEST);
+ testSourceMapLocations(SEND_TEST);
}
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698