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 import 'package:expect/expect.dart'; | 5 import 'package:expect/expect.dart'; |
6 import 'package:async_helper/async_helper.dart'; | 6 import 'package:async_helper/async_helper.dart'; |
7 import 'memory_compiler.dart'; | 7 import 'memory_compiler.dart'; |
8 | 8 |
9 import 'package:compiler/src/compiler.dart' | 9 import 'package:compiler/src/compiler.dart' |
10 as dart2js; | 10 as dart2js; |
11 | 11 |
12 void main() { | 12 void main() { |
13 asyncTest(() async { | 13 asyncTest(() async { |
14 CompilationResult result = | 14 CompilationResult result = |
15 await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES); | 15 await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES); |
16 dart2js.Compiler compiler = result.compiler; | 16 dart2js.Compiler compiler = result.compiler; |
17 | 17 |
18 lookupLibrary(name) { | 18 lookupLibrary(name) { |
19 return compiler.libraryLoader.lookupLibrary(Uri.parse(name)); | 19 return compiler.libraryLoader.lookupLibrary(Uri.parse(name)); |
20 } | 20 } |
21 | 21 |
22 var main = compiler.mainApp.find(dart2js.Compiler.MAIN); | 22 var main = compiler.mainFunction; |
23 Expect.isNotNull(main, "Could not find 'main'"); | 23 Expect.isNotNull(main, "Could not find 'main'"); |
24 compiler.deferredLoadTask.onResolutionComplete(main); | 24 compiler.deferredLoadTask.onResolutionComplete(main); |
25 | 25 |
26 var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement; | 26 var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement; |
27 | 27 |
28 var lib = lookupLibrary("memory:lib.dart"); | 28 var lib = lookupLibrary("memory:lib.dart"); |
29 var a = lib.find("a"); | 29 var a = lib.find("a"); |
30 var b = lib.find("b"); | 30 var b = lib.find("b"); |
31 var c = lib.find("c"); | 31 var c = lib.find("c"); |
32 var d = lib.find("d"); | 32 var d = lib.find("d"); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 class D2 { | 106 class D2 { |
107 D2(x) { | 107 D2(x) { |
108 d(); | 108 d(); |
109 } | 109 } |
110 } | 110 } |
111 | 111 |
112 // Implicit redirecting "super" call with a parameter via mixin. | 112 // Implicit redirecting "super" call with a parameter via mixin. |
113 class D3 = D2 with D1; | 113 class D3 = D2 with D1; |
114 """, | 114 """, |
115 }; | 115 }; |
OLD | NEW |