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

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: Undid changes not necessary for main compiler change. Created 8 years, 3 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 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,
« 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