| Index: lib/compiler/implementation/compiler.dart
|
| diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart
|
| index f78fe78c6e809f4f3fd348b7b03d3b3c4cb5268e..b9bf44636b426aac1ceaaa15b72c7c86487cbbb0 100644
|
| --- a/lib/compiler/implementation/compiler.dart
|
| +++ b/lib/compiler/implementation/compiler.dart
|
| @@ -364,25 +364,40 @@ abstract 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'));
|
|
|
| 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,
|
|
|