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

Unified Diff: compiler/java/com/google/dart/compiler/ast/DartUnit.java

Issue 9113017: Add unitAboutToCompile() into DartCompilerListener (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 12 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: compiler/java/com/google/dart/compiler/ast/DartUnit.java
diff --git a/compiler/java/com/google/dart/compiler/ast/DartUnit.java b/compiler/java/com/google/dart/compiler/ast/DartUnit.java
index ff55c06358bcd8c5fcbc9afb75d47be688b35d7f..292b028a156b8d8c73e6db2beb5cc65f2a79b56d 100644
--- a/compiler/java/com/google/dart/compiler/ast/DartUnit.java
+++ b/compiler/java/com/google/dart/compiler/ast/DartUnit.java
@@ -4,6 +4,7 @@
package com.google.dart.compiler.ast;
+import com.google.common.collect.Lists;
import com.google.dart.compiler.DartSource;
import com.google.dart.compiler.util.DefaultTextOutput;
@@ -20,21 +21,15 @@ public class DartUnit extends DartNode {
private LibraryUnit library;
private List<DartDirective> directives;
- private final List<DartNode> topLevelNodes;
+ private final List<DartNode> topLevelNodes = Lists.newArrayList();
private final DartSource source;
/** A list of comments. May be null. */
private List<DartComment> comments;
private boolean isDiet;
private String dietParse;
- public DartUnit(DartSource sourceName) {
- this(sourceName, new ArrayList<DartNode>());
- }
-
- public DartUnit(DartSource source,
- List<DartNode> nodes) {
+ public DartUnit(DartSource source) {
this.source = source;
- this.topLevelNodes = becomeParentOf(nodes);
}
public void addTopLevelNode(DartNode node) {

Powered by Google App Engine
This is Rietveld 408576698