Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(599)

Unified Diff: lib/compiler/implementation/compiler.dart

Issue 10967068: Stop importing js_helper.dart explicitly in the core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merged to tip-of-tree. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/apiimpl.dart ('k') | lib/compiler/implementation/lib/core.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « lib/compiler/implementation/apiimpl.dart ('k') | lib/compiler/implementation/lib/core.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698