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

Unified Diff: lib/compiler/implementation/scanner/scanner_task.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
Index: lib/compiler/implementation/scanner/scanner_task.dart
diff --git a/lib/compiler/implementation/scanner/scanner_task.dart b/lib/compiler/implementation/scanner/scanner_task.dart
index cd5e44f3e58c35ac1bc54d26ca0feebb0994f64b..ab75e1b5b8757131d2815b8af35b793234d94146 100644
--- a/lib/compiler/implementation/scanner/scanner_task.dart
+++ b/lib/compiler/implementation/scanner/scanner_task.dart
@@ -115,14 +115,20 @@ class ScannerTask extends CompilerTask {
LibraryElement loadLibrary(Uri uri, Node node, Uri canonicalUri) {
bool newLibrary = false;
- LibraryElement library =
- compiler.libraries.putIfAbsent(uri.toString(), () {
- newLibrary = true;
- Script script = compiler.readScript(uri, node);
- LibraryElement element = new LibraryElement(script, canonicalUri);
- native.maybeEnableNative(compiler, element, uri);
- return element;
- });
+ LibraryElement createLibrary() {
+ newLibrary = true;
+ Script script = compiler.readScript(uri, node);
+ LibraryElement element = new LibraryElement(script, canonicalUri);
+ native.maybeEnableNative(compiler, element, uri);
+ return element;
+ }
+ LibraryElement library;
+ if (canonicalUri === null) {
+ library = createLibrary();
+ } else {
+ library = compiler.libraries.putIfAbsent(canonicalUri.toString(),
+ createLibrary);
+ }
if (newLibrary) {
compiler.withCurrentElement(library, () {
scanLibrary(library);

Powered by Google App Engine
This is Rietveld 408576698