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

Side by Side Diff: tests/language/deferred_global_lib.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: 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 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 var sideEffectCounter = 0; 5 var sideEffectCounter = 0;
6 6
7 final finalConstGlobal = "finalConstGlobal"; 7 final finalConstGlobal = "finalConstGlobal";
8 final finalNonConstGlobal = (() { 8 final finalNonConstGlobal = (() {
9 sideEffectCounter++; 9 sideEffectCounter++;
10 return "finalNonConstGlobal"; 10 return "finalNonConstGlobal";
11 }()); 11 }());
12 12
13 var lazyConstGlobal = "lazyConstGlobal"; 13 var lazyConstGlobal = "lazyConstGlobal";
14 // Regression test for bug #21840.
15 var const1Global = const {};
16 final lazyConstGlobal2 = const1Global;
17
14 var lazyNonConstGlobal = (() { 18 var lazyNonConstGlobal = (() {
15 sideEffectCounter++; 19 sideEffectCounter++;
16 return "lazyNonConstGlobal"; 20 return "lazyNonConstGlobal";
17 }()); 21 }());
18 22
19 readFinalConstGlobal() => finalConstGlobal; 23 readFinalConstGlobal() => finalConstGlobal;
20 readFinalNonConstGlobal() => finalNonConstGlobal; 24 readFinalNonConstGlobal() => finalNonConstGlobal;
21 readLazyConstGlobal() => lazyConstGlobal; 25 readLazyConstGlobal() => lazyConstGlobal;
22 readLazyNonConstGlobal() => lazyNonConstGlobal; 26 readLazyNonConstGlobal() => lazyNonConstGlobal;
23 writeLazyConstGlobal(x) { lazyConstGlobal = x; } 27 writeLazyConstGlobal(x) { lazyConstGlobal = x; }
24 writeLazyNonConstGlobal(x) { lazyNonConstGlobal = x; } 28 writeLazyNonConstGlobal(x) { lazyNonConstGlobal = x; }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698