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

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

Issue 12088019: Fix issue https://code.google.com/p/dart/issues/detail?id=8106: save the sourceElement in the one s… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « sdk/lib/_internal/compiler/implementation/ssa/optimize.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/interceptor_test.dart
===================================================================
--- tests/compiler/dart2js/interceptor_test.dart (revision 17702)
+++ tests/compiler/dart2js/interceptor_test.dart (working copy)
@@ -14,9 +14,23 @@
}
""";
+const String TEST_TWO = r"""
+ foo(a) {
+ var myVariableName = a + 42;
+ print(myVariableName);
+ print(myVariableName);
+ }
+""";
+
main() {
var generated = compile(TEST_ONE, entry: 'foo');
// Check that the one shot interceptor got converted to a direct
// call to the interceptor object.
Expect.isTrue(generated.contains('CONSTANT.get\$toString(a + 42);'));
+
+ // Check that one-shot interceptors preserve variable names, see
+ // https://code.google.com/p/dart/issues/detail?id=8106.
+ generated = compile(TEST_TWO, entry: 'foo');
+ Expect.isTrue(generated.contains('\$.\$\$add(a, 42)'));
+ Expect.isTrue(generated.contains('myVariableName'));
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/optimize.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698