| Index: tests/compiler/dart2js/interceptor_test.dart
|
| ===================================================================
|
| --- tests/compiler/dart2js/interceptor_test.dart (revision 17895)
|
| +++ tests/compiler/dart2js/interceptor_test.dart (working copy)
|
| @@ -22,6 +22,16 @@
|
| }
|
| """;
|
|
|
| +const String TEST_THREE = r"""
|
| + class A {
|
| + var length;
|
| + }
|
| + foo(a) {
|
| + print([]); // Make sure the array class is instantiated.
|
| + return new A().length + a.length;
|
| + }
|
| +""";
|
| +
|
| main() {
|
| var generated = compile(TEST_ONE, entry: 'foo');
|
| // Check that the one shot interceptor got converted to a direct
|
| @@ -33,4 +43,11 @@
|
| generated = compile(TEST_TWO, entry: 'foo');
|
| Expect.isTrue(generated.contains('\$.\$\$add(a, 42)'));
|
| Expect.isTrue(generated.contains('myVariableName'));
|
| +
|
| + // Check that we know when an intercepted getter name does not need
|
| + // to be intercepted;
|
| + generated = compile(TEST_THREE, entry: 'foo');
|
| + Expect.isFalse(generated.contains(r'get$length'));
|
| + Expect.isTrue(generated.contains(r'$.A$().length'));
|
| + Expect.isTrue(generated.contains(r'length(a)'));
|
| }
|
|
|