Chromium Code Reviews| Index: compiler/java/com/google/dart/compiler/DartCompiler.java |
| =================================================================== |
| --- compiler/java/com/google/dart/compiler/DartCompiler.java (revision 6466) |
| +++ compiler/java/com/google/dart/compiler/DartCompiler.java (working copy) |
| @@ -881,7 +881,9 @@ |
| return super.parse(dartSrc, prefixes, diet); |
| } |
| URI srcUri = dartSrc.getUri(); |
| - DartUnit parsedUnit = parsedUnits.get(srcUri); |
| + // Remove the parsed unit from the map if present |
| + // so that it will not be consumed a 2nd time if it is sourced by multiple libraries |
| + DartUnit parsedUnit = parsedUnits.remove(srcUri); |
|
zundel
2012/04/12 19:00:34
couldn't you just not parse it a second time? Or
danrubel
2012/04/12 19:17:44
If I analyze a library that imports two other libr
|
| return parsedUnit == null ? super.parse(dartSrc, prefixes, diet) : parsedUnit; |
| } |
| } |
| @@ -1157,7 +1159,8 @@ |
| * instead of parsing and resolving the associated source from storage. |
| * @param parsedUnits A collection of unresolved ASTs that should be used |
| * instead of parsing the associated source from storage. Intended for |
| - * IDE use when modified buffers must be analyzed. AST nodes in the map may be |
| + * IDE use when modified buffers must be analyzed. |
| + * Units are removed from this map as they are used. AST nodes in the map may be |
| * ignored if not referenced by {@code lib}. (May be null.) |
| * @param config The compiler configuration (phases and backends |
| * will not be used), but resolution and type-analysis will be |