Chromium Code Reviews| Index: lib/compiler/implementation/compiler.dart |
| diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart |
| index c316b5c551d46de15b61ba2de4ac126b1ea1f123..9e8690c11947574126c14d23cb6f0968e9f0e6d4 100644 |
| --- a/lib/compiler/implementation/compiler.dart |
| +++ b/lib/compiler/implementation/compiler.dart |
| @@ -367,25 +367,40 @@ class Compiler implements DiagnosticListener { |
| } |
| void scanBuiltinLibraries() { |
| - coreImplLibrary = scanBuiltinLibrary('coreimpl'); |
| + loadCoreImplLibrary(); |
| jsHelperLibrary = scanBuiltinLibrary('_js_helper'); |
| interceptorsLibrary = scanBuiltinLibrary('_interceptors'); |
| + // The core and coreimpl libraries were loaded and patched before |
| + // jsHelperLibrary was initialized, so it wasn't imported into those |
| + // two libraries during patching. |
| + importHelperLibrary(coreLibrary); |
| + importHelperLibrary(coreImplLibrary); |
| + importHelperLibrary(interceptorsLibrary); |
| + |
| addForeignFunctions(jsHelperLibrary); |
| addForeignFunctions(interceptorsLibrary); |
| - libraries['dart:core'] = coreLibrary; |
| - libraries['dart:coreimpl'] = coreImplLibrary; |
| - |
| assertMethod = jsHelperLibrary.find(const SourceString('assert')); |
| identicalFunction = coreLibrary.find(const SourceString('identical')); |
|
Lasse Reichstein Nielsen
2012/09/24 13:52:03
These two look like they would belong in (a genera
|
| initializeSpecialClasses(); |
| } |
| + void loadCoreImplLibrary() { |
| + Uri coreImplUri = new Uri.fromComponents(scheme: 'dart', path: 'coreimpl'); |
| + coreImplLibrary = scanner.loadLibrary(coreImplUri, null, coreImplUri); |
| + } |
| + |
| + void importHelperLibrary(LibraryElement library) { |
| + if (jsHelperLibrary !== null) { |
| + scanner.importLibrary(library, jsHelperLibrary, null); |
| + } |
| + } |
| + |
| void importCoreLibrary(LibraryElement library) { |
| - Uri coreUri = new Uri.fromComponents(scheme: 'dart', path: 'core'); |
| if (coreLibrary === null) { |
| + Uri coreUri = new Uri.fromComponents(scheme: 'dart', path: 'core'); |
| coreLibrary = scanner.loadLibrary(coreUri, null, coreUri); |
| } |
| scanner.importLibrary(library, |