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

Unified Diff: compiler/java/com/google/dart/compiler/DeltaAnalyzer.java

Issue 10024002: Teach DeltaAnalyzer to recognize library prefixes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | compiler/java/com/google/dart/compiler/ast/LibraryUnit.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/DeltaAnalyzer.java
===================================================================
--- compiler/java/com/google/dart/compiler/DeltaAnalyzer.java (revision 6284)
+++ compiler/java/com/google/dart/compiler/DeltaAnalyzer.java (working copy)
@@ -8,6 +8,7 @@
import com.google.common.io.Closeables;
import com.google.dart.compiler.ast.DartNode;
import com.google.dart.compiler.ast.DartUnit;
+import com.google.dart.compiler.ast.LibraryNode;
import com.google.dart.compiler.ast.LibraryUnit;
import com.google.dart.compiler.metrics.CompilerMetrics;
import com.google.dart.compiler.parser.DartParser;
@@ -77,6 +78,14 @@
private Scope deltaLibraryScope(Source originalSource, DartUnit unit) {
// Create a library unit which holds the new unit.
LibraryUnit libraryUnit = new LibraryUnit(makeLibrarySource("delta"));
+ // Copy all the imports
+ for (LibraryNode path : enclosingLibrary.getLibraryUnit().getImportPaths()) {
+ libraryUnit.addImportPath(path);
+ }
+ for (LibraryUnit importUnit : enclosingLibrary.getLibraryUnit().getImports()) {
+ libraryUnit.addImport(importUnit, importUnit.getEntryNode());
+ }
+ libraryUnit.initializePrefixes(enclosingLibrary.getLibraryUnit());
libraryUnit.putUnit(unit);
// Create top-level elements for the new unit.
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/ast/LibraryUnit.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698