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

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

Issue 10836355: Make sure that libraries loaded from dart:core gets dart:core implicitly loaded. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix mock compiler Created 8 years, 4 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 | « no previous file | lib/compiler/implementation/scanner/scanner_task.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 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);
« no previous file with comments | « no previous file | lib/compiler/implementation/scanner/scanner_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698