| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 /// Regression test for --fast-startup. The compiler used to emit inherit calls |
| 6 /// on each fragment even for classes that were already loaded on a different |
| 7 /// fragment. As a result, the inheritance chain was overwritten in non-chrome |
| 8 /// browsers (by using __proto__, we evaded this issue in Chrome). |
| 9 library deferred_inheritance_test; |
| 10 |
| 11 import 'deferred_inheritance_lib2.dart'; |
| 12 import 'deferred_inheritance_lib1.dart' deferred as d; |
| 13 |
| 14 import 'package:expect/expect.dart'; |
| 15 |
| 16 class B extends A {} |
| 17 |
| 18 /// If the check `y is A` is generated as `y.$isA` then the issue is not |
| 19 /// exposed. We use `AssumeDynamic` to ensure that we generate as `y instanceof |
| 20 /// A` in JS. |
| 21 @NoInline() @AssumeDynamic() |
| 22 check(y) => Expect.isTrue(y is A); |
| 23 |
| 24 main() { |
| 25 check(new B()); |
| 26 d.loadLibrary().then((_) { |
| 27 check(new d.C()); |
| 28 check(new B()); // This fails if we overwrite the inheritance chain. |
| 29 }); |
| 30 } |
| OLD | NEW |