| 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 the additional runtime type support is output to the right | 5 // Test that the additional runtime type support is output to the right |
| 6 // Files when using deferred loading. | 6 // Files when using deferred loading. |
| 7 | 7 |
| 8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
| 9 import 'package:compiler/compiler_new.dart'; | 9 import 'package:compiler/compiler_new.dart'; |
| 10 import 'package:compiler/src/compiler.dart'; | 10 import 'package:compiler/src/compiler.dart'; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement; | 30 var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement; |
| 31 | 31 |
| 32 var lib1 = lookupLibrary("memory:lib1.dart"); | 32 var lib1 = lookupLibrary("memory:lib1.dart"); |
| 33 var foo1 = lib1.find("foo"); | 33 var foo1 = lib1.find("foo"); |
| 34 var ou_lib1 = outputUnitForElement(foo1); | 34 var ou_lib1 = outputUnitForElement(foo1); |
| 35 | 35 |
| 36 var lib2 = lookupLibrary("memory:lib2.dart"); | 36 var lib2 = lookupLibrary("memory:lib2.dart"); |
| 37 var foo2 = lib2.find("foo"); | 37 var foo2 = lib2.find("foo"); |
| 38 var ou_lib2 = outputUnitForElement(foo2); | 38 var ou_lib2 = outputUnitForElement(foo2); |
| 39 | 39 |
| 40 var fooMain = compiler.mainApp.find("foo"); | 40 var mainApp = compiler.mainApp; |
| 41 var fooMain = mainApp.find("foo"); |
| 41 var ou_lib1_lib2 = outputUnitForElement(fooMain); | 42 var ou_lib1_lib2 = outputUnitForElement(fooMain); |
| 42 | 43 |
| 43 String mainOutput = collector.getOutput("", OutputType.js); | 44 String mainOutput = collector.getOutput("", OutputType.js); |
| 44 String lib1Output = | 45 String lib1Output = |
| 45 collector.getOutput("out_${ou_lib1.name}", OutputType.jsPart); | 46 collector.getOutput("out_${ou_lib1.name}", OutputType.jsPart); |
| 46 String lib2Output = | 47 String lib2Output = |
| 47 collector.getOutput("out_${ou_lib2.name}", OutputType.jsPart); | 48 collector.getOutput("out_${ou_lib2.name}", OutputType.jsPart); |
| 48 String lib12Output = | 49 String lib12Output = |
| 49 collector.getOutput("out_${ou_lib1_lib2.name}", OutputType.jsPart); | 50 collector.getOutput("out_${ou_lib1_lib2.name}", OutputType.jsPart); |
| 50 // Test that the deferred constants are not inlined into the main file. | 51 // Test that the deferred constants are not inlined into the main file. |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 import "main.dart" as main; | 143 import "main.dart" as main; |
| 143 const C4 = "string4"; | 144 const C4 = "string4"; |
| 144 const C5 = const main.C(1); | 145 const C5 = const main.C(1); |
| 145 const C6 = const main.C(2); | 146 const C6 = const main.C(2); |
| 146 foo() { | 147 foo() { |
| 147 print("lib2"); | 148 print("lib2"); |
| 148 main.foo(); | 149 main.foo(); |
| 149 } | 150 } |
| 150 """ | 151 """ |
| 151 }; | 152 }; |
| OLD | NEW |