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

Side by Side Diff: tests/language/deferred_static_seperate_test.dart

Issue 956953002: Support for a dart2js `dartDeferredLoader` hook. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix text in pkg/compiler/lib/src/js_emitter/old_emitter/declarations.dart Created 5 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "deferred_static_seperate_lib1.dart" deferred as lib1; 12 import "deferred_static_seperate_lib1.dart" deferred as lib1;
12 import "deferred_static_seperate_lib2.dart" deferred as lib2; 13 import "deferred_static_seperate_lib2.dart" deferred as lib2;
13 14
14 void main() { 15 void main() {
16 asyncStart();
15 lib1.loadLibrary().then((_) { 17 lib1.loadLibrary().then((_) {
16 lib2.loadLibrary().then((_) { 18 lib2.loadLibrary().then((_) {
19 print("HERE");
17 Expect.equals(1, new lib1.C().bar()); 20 Expect.equals(1, new lib1.C().bar());
18 var x = new lib1.C2(); 21 var x = new lib1.C2();
19 Expect.mapEquals({1: 2}, x.bar); 22 Expect.mapEquals({1: 2}, x.bar);
20 x.bar = {2: 3}; 23 x.bar = {2: 3};
21 Expect.mapEquals({2: 3}, x.bar); 24 Expect.mapEquals({2: 3}, x.bar);
22 25
23 Expect.equals(lib1.x, new lib1.C3().bar); 26 Expect.equals(lib1.x, new lib1.C3().bar);
24 Expect.mapEquals({lib1.x: lib1.x}, new lib1.C4().bar); 27 Expect.mapEquals({lib1.x: lib1.x}, new lib1.C4().bar);
25 Expect.equals(1, new lib1.C5().bar()); 28 Expect.equals(1, new lib1.C5().bar());
26 29
27 lib2.foo(); 30 lib2.foo();
31 asyncEnd();
28 }); 32 });
29 }); 33 });
30 } 34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698