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

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: 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/patch_parser.dart ('k') | tests/compiler/dart2js/dart_backend_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 899bf39c5cd3a8a82670f2a12cedb5cc6b76365f..aedd3a33536a4e7c4d5b594a57fe2aa10dff7024 100644
--- a/lib/compiler/implementation/scanner/scanner_task.dart
+++ b/lib/compiler/implementation/scanner/scanner_task.dart
@@ -118,14 +118,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);
« no previous file with comments | « lib/compiler/implementation/patch_parser.dart ('k') | tests/compiler/dart2js/dart_backend_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698