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

Unified Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 683673004: Fix issue 21379 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « no previous file | pkg/analyzer/test/generated/engine_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/engine.dart
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index b02647d4e70b0a613f127cb5818972cc458e6e57..9e7d34c305b9a93080ca692955ccbde68cf4092c 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -8037,10 +8037,10 @@ class DartEntry extends SourceEntry {
if (state.getState(BUILT_UNIT) == CacheState.VALID) {
// TODO(brianwilkerson) We're cloning the structure to remove any
// previous resolution data, but I'm not sure that's necessary.
- return state.getValue(BUILT_UNIT).accept(new AstCloner()) as CompilationUnit;
+ return state.getValue(BUILT_UNIT).accept(new AstCloner());
}
if (state.getState(RESOLVED_UNIT) == CacheState.VALID) {
- return state.getValue(RESOLVED_UNIT).accept(new AstCloner()) as CompilationUnit;
+ return state.getValue(RESOLVED_UNIT).accept(new AstCloner());
}
state = state._nextState;
}
@@ -8147,10 +8147,14 @@ class DartEntry extends SourceEntry {
ResolutionState state = _resolutionState;
while (state != null) {
if (state.getState(BUILT_UNIT) == CacheState.VALID) {
- setValue(PARSED_UNIT, state.getValue(BUILT_UNIT));
+ CompilationUnit unit = state.getValue(BUILT_UNIT);
+ ResolutionEraser.erase(unit);
+ setValue(PARSED_UNIT, unit);
break;
} else if (state.getState(RESOLVED_UNIT) == CacheState.VALID) {
- setValue(PARSED_UNIT, state.getValue(RESOLVED_UNIT));
+ CompilationUnit unit = state.getValue(RESOLVED_UNIT);
+ ResolutionEraser.erase(unit);
+ setValue(PARSED_UNIT, unit);
break;
}
state = state._nextState;
@@ -11798,10 +11802,17 @@ class RecursiveXmlVisitor_ResolveHtmlTask_internalPerform extends ht.RecursiveXm
}
/**
- * Instances of the class `ResolutionEraser` remove any resolution information from an AST
+ * A `ResolutionEraser` removes any resolution information from an AST
* structure when used to visit that structure.
*/
class ResolutionEraser extends GeneralizingAstVisitor<Object> {
+ /**
+ * Remove any resolution information from the given AST structure.
+ */
+ static void erase(AstNode node) {
+ node.accept(new ResolutionEraser());
+ }
+
@override
Object visitAssignmentExpression(AssignmentExpression node) {
node.staticElement = null;
@@ -11984,10 +11995,12 @@ class ResolutionState {
void invalidateAllResolutionInformation() {
_nextState = null;
_librarySource = null;
+ setState(DartEntry.BUILT_UNIT, CacheState.INVALID);
+ setState(DartEntry.BUILT_ELEMENT, CacheState.INVALID);
+ setState(DartEntry.HINTS, CacheState.INVALID);
setState(DartEntry.RESOLVED_UNIT, CacheState.INVALID);
setState(DartEntry.RESOLUTION_ERRORS, CacheState.INVALID);
setState(DartEntry.VERIFICATION_ERRORS, CacheState.INVALID);
- setState(DartEntry.HINTS, CacheState.INVALID);
}
/**
@@ -13040,8 +13053,8 @@ abstract class SourceEntry {
result.state = state;
if (state != CacheState.IN_PROCESS) {
//
- // If the state is in-process, we can leave the current value in the cache
- // for any 'get' methods to access.
+ // If the state is in-process, we can leave the current value in the
+ // cache for any 'get' methods to access.
//
result.value = descriptor.defaultValue;
}
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/engine_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698