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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/library_loader.dart

Issue 494623002: Implement diff algorithm for libraries. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments. Created 6 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 | dart/sdk/lib/_internal/compiler/implementation/scanner/listener.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/implementation/library_loader.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/library_loader.dart b/dart/sdk/lib/_internal/compiler/implementation/library_loader.dart
index b7ceefc04d95bfbfb9dd6f05e61bcd0f775b39f8..1217a11362535178e818c08fd1df82c15e8fd43d 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/library_loader.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/library_loader.dart
@@ -498,23 +498,33 @@ class _LibraryLoaderTask extends CompilerTask implements LibraryLoaderTask {
return new Future.value(library);
}
return compiler.withCurrentElement(importingLibrary, () {
- return compiler.readScript(node, readableUri)
- .then((Script script) {
- if (script == null) return null;
- LibraryElement element = new LibraryElementX(script, resolvedUri);
- compiler.withCurrentElement(element, () {
- handler.registerNewLibrary(element);
- native.maybeEnableNative(compiler, element);
- libraryCanonicalUriMap[resolvedUri] = element;
- compiler.scanner.scanLibrary(element);
- });
- return processLibraryTags(handler, element).then((_) {
- compiler.withCurrentElement(element, () {
- handler.registerLibraryExports(element);
- });
- return element;
- });
+ return compiler.readScript(node, readableUri).then((Script script) {
+ if (script == null) return null;
+ LibraryElement element =
+ createLibrarySync(handler, script, resolvedUri);
+ return processLibraryTags(handler, element).then((_) {
+ compiler.withCurrentElement(element, () {
+ handler.registerLibraryExports(element);
});
+ return element;
+ });
+ });
+ });
+ }
+
+ LibraryElement createLibrarySync(
+ LibraryDependencyHandler handler,
+ Script script,
+ Uri resolvedUri) {
+ LibraryElement element = new LibraryElementX(script, resolvedUri);
+ return compiler.withCurrentElement(element, () {
+ if (handler != null) {
+ handler.registerNewLibrary(element);
+ libraryCanonicalUriMap[resolvedUri] = element;
+ }
+ native.maybeEnableNative(compiler, element);
+ compiler.scanner.scanLibrary(element);
+ return element;
});
}
}
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/scanner/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698