OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // The class lib1.C is referenced via lib1 | 5 // The class lib1.C is referenced via lib1 |
6 // The static function lib1.C.foo is referenced via lib2 | 6 // The static function lib1.C.foo is referenced via lib2 |
7 // Dart2js will put them in seperate hunks. | 7 // Dart2js will put them in seperate hunks. |
8 // Similarly for C2, ..., C5. | 8 // Similarly for C2, ..., C5. |
9 | 9 |
10 import "package:expect/expect.dart"; | 10 import "package:expect/expect.dart"; |
11 import "package:async_helper/async_helper.dart"; | 11 import "package:async_helper/async_helper.dart"; |
12 import "deferred_static_seperate_lib1.dart" deferred as lib1; | 12 import "deferred_static_seperate_lib1.dart" deferred as lib1; |
13 import "deferred_static_seperate_lib2.dart" deferred as lib2; | 13 import "deferred_static_seperate_lib2.dart" deferred as lib2; |
14 | 14 |
15 void main() { | 15 void main() { |
16 asyncStart(); | 16 asyncStart(); |
| 17 Expect.throws(() => new lib1.C()); |
17 lib1.loadLibrary().then((_) { | 18 lib1.loadLibrary().then((_) { |
18 lib2.loadLibrary().then((_) { | 19 lib2.loadLibrary().then((_) { |
19 print("HERE"); | 20 print("HERE"); |
20 Expect.equals(1, new lib1.C().bar()); | 21 Expect.equals(1, new lib1.C().bar()); |
21 var x = new lib1.C2(); | 22 var x = new lib1.C2(); |
22 Expect.mapEquals({1: 2}, x.bar); | 23 Expect.mapEquals({1: 2}, x.bar); |
23 x.bar = {2: 3}; | 24 x.bar = {2: 3}; |
24 Expect.mapEquals({2: 3}, x.bar); | 25 Expect.mapEquals({2: 3}, x.bar); |
25 | 26 |
26 Expect.equals(lib1.x, new lib1.C3().bar); | 27 Expect.equals(lib1.x, new lib1.C3().bar); |
27 Expect.mapEquals({lib1.x: lib1.x}, new lib1.C4().bar); | 28 Expect.mapEquals({lib1.x: lib1.x}, new lib1.C4().bar); |
28 Expect.equals(1, new lib1.C5().bar()); | 29 Expect.equals(1, new lib1.C5().bar()); |
29 | 30 |
30 lib2.foo(); | 31 lib2.foo(); |
31 asyncEnd(); | 32 asyncEnd(); |
32 }); | 33 }); |
33 }); | 34 }); |
34 } | 35 } |
OLD | NEW |