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 // Test that constants depended on by other constants are correctly deferred. | 5 // Test that constants depended on by other constants are correctly deferred. |
6 | 6 |
7 import 'package:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
8 import 'package:compiler/src/constants/values.dart'; | 8 import 'package:compiler/src/constants/values.dart'; |
9 import 'package:compiler/src/dart2jslib.dart'; | 9 import 'package:compiler/src/compiler.dart'; |
10 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
11 import 'memory_compiler.dart'; | 11 import 'memory_compiler.dart'; |
12 | 12 |
13 void main() { | 13 void main() { |
14 asyncTest(() async { | 14 asyncTest(() async { |
15 CompilationResult result = | 15 CompilationResult result = |
16 await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES); | 16 await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES); |
17 Compiler compiler = result.compiler; | 17 Compiler compiler = result.compiler; |
18 var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement; | 18 var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement; |
19 var outputUnitForConstant = compiler.deferredLoadTask.outputUnitForConstant; | 19 var outputUnitForConstant = compiler.deferredLoadTask.outputUnitForConstant; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 print(lib.L); | 57 print(lib.L); |
58 } | 58 } |
59 """, "lib.dart": """ | 59 """, "lib.dart": """ |
60 class C { | 60 class C { |
61 final a; | 61 final a; |
62 const C(this.a); | 62 const C(this.a); |
63 } | 63 } |
64 | 64 |
65 const L = const {"cA": const C(const {"cB": "cC"})}; | 65 const L = const {"cA": const C(const {"cB": "cC"})}; |
66 """,}; | 66 """,}; |
OLD | NEW |