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

Unified Diff: tests/language/deferred_global_test.dart

Issue 795923003: Dart2js, move deferred global vars to the right output unit. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/language/deferred_global_lib.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/deferred_global_test.dart
diff --git a/tests/language/deferred_global_test.dart b/tests/language/deferred_global_test.dart
index 709921ea5b8e855fb3a0624975beecfdf72bb71a..21ef619e566bba13879953b3d9fb96a6168b66c6 100644
--- a/tests/language/deferred_global_test.dart
+++ b/tests/language/deferred_global_test.dart
@@ -7,9 +7,16 @@ import 'package:async_helper/async_helper.dart';
import "deferred_global_lib.dart" deferred as lib;
+var nonDeferredGlobal = const {};
+
void main() {
+ nonDeferredGlobal = null;
asyncStart();
lib.loadLibrary().then((_) {
+ // Ensure non-deferred globals are not reset when loading a deferred
+ // library.
+ Expect.equals(null, nonDeferredGlobal);
+
Expect.equals("finalConstGlobal", lib.finalConstGlobal);
Expect.equals(0, lib.sideEffectCounter);
Expect.equals("finalNonConstGlobal", lib.finalNonConstGlobal);
@@ -40,7 +47,14 @@ void main() {
Expect.equals("lazyConstGlobal_mutated2", lib.readLazyConstGlobal());
Expect.equals("lazyNonConstGlobal_mutated2", lib.readLazyNonConstGlobal());
+ Expect.mapEquals({}, lib.lazyConstGlobal2);
+ lib.const1Global = 0;
Expect.equals(2, lib.sideEffectCounter);
- asyncEnd();
+ Expect.equals(0, lib.const1Global);
+ // Try loading the deferred library again, should not reset the globals.
+ lib.loadLibrary().then((_) {
+ Expect.equals(0, lib.const1Global);
+ asyncEnd();
+ });
});
}
« no previous file with comments | « tests/language/deferred_global_lib.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698