| Index: lib/compiler/implementation/compiler.dart
|
| diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart
|
| index 02bdebe1cdeedb7544de193cb0afd26726f0a8f7..92ea94a0f818524d53db96e68fdc42fb9d30618e 100644
|
| --- a/lib/compiler/implementation/compiler.dart
|
| +++ b/lib/compiler/implementation/compiler.dart
|
| @@ -349,17 +349,7 @@ class Compiler implements DiagnosticListener {
|
| coreImplLibrary = scanBuiltinLibrary('coreimpl');
|
| jsHelperLibrary = scanBuiltinLibrary('_js_helper');
|
| interceptorsLibrary = scanBuiltinLibrary('_interceptors');
|
| - coreLibrary = scanBuiltinLibrary('core');
|
| -
|
| - // Since coreLibrary import the libraries "coreimpl", "js_helper",
|
| - // and "interceptors", coreLibrary is null when they are being
|
| - // built. So we add the implicit import of coreLibrary now. This
|
| - // can be cleaned up when we have proper support for "dart:core"
|
| - // and don't need to access it through the field "coreLibrary".
|
| - // TODO(ahe): Clean this up as described above.
|
| - scanner.importLibrary(coreImplLibrary, coreLibrary, null);
|
| - scanner.importLibrary(jsHelperLibrary, coreLibrary, null);
|
| - scanner.importLibrary(interceptorsLibrary, coreLibrary, null);
|
| +
|
| addForeignFunctions(jsHelperLibrary);
|
| addForeignFunctions(interceptorsLibrary);
|
|
|
| @@ -374,6 +364,17 @@ class Compiler implements DiagnosticListener {
|
| //patchDartLibrary(coreImplLibrary, 'coreimpl');
|
| }
|
|
|
| + void importCoreLibrary(LibraryElement library) {
|
| + Uri coreUri = new Uri.fromComponents(scheme: 'dart', path: 'core');
|
| + if (coreLibrary === null) {
|
| + coreLibrary = scanner.loadLibrary(coreUri, null, coreUri);
|
| + }
|
| + scanner.importLibrary(library,
|
| + coreLibrary,
|
| + null,
|
| + library.entryCompilationUnit);
|
| + }
|
| +
|
| void patchDartLibrary(LibraryElement library, String dartLibraryPath) {
|
| if (library.isPatched) return;
|
| Uri patchUri = resolvePatchUri(dartLibraryPath);
|
|
|