| 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'));
|
| }
|
|
|