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

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

Issue 1327363002: Fixed the last unit test that was failing with the new task model (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/lib/src/generated/resolver.dart » ('j') | pkg/analyzer/lib/src/task/driver.dart » ('J')
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 5eccbf7ee5b33c7932856815551ae5e221f02f47..c0e548ccf0bee04c3cb17c8ae7256f1746cd34dd 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -10309,6 +10309,12 @@ class RecursiveXmlVisitor_ResolveHtmlTask_internalPerform
* used to visit that structure.
*/
class ResolutionEraser extends GeneralizingAstVisitor<Object> {
+ /**
+ * A flag indicating whether the elements associated with declarations should
+ * be erased.
+ */
+ bool eraseDeclarations = true;
scheglov 2015/09/10 20:35:38 Why not to make it final and initialize in the con
Brian Wilkerson 2015/09/10 21:00:31 I debated about both approaches. This has the adva
+
@override
Object visitAssignmentExpression(AssignmentExpression node) {
node.staticElement = null;
@@ -10331,13 +10337,17 @@ class ResolutionEraser extends GeneralizingAstVisitor<Object> {
@override
Object visitCompilationUnit(CompilationUnit node) {
- node.element = null;
+ if (eraseDeclarations) {
+ node.element = null;
+ }
return super.visitCompilationUnit(node);
}
@override
Object visitConstructorDeclaration(ConstructorDeclaration node) {
- node.element = null;
+ if (eraseDeclarations) {
+ node.element = null;
+ }
return super.visitConstructorDeclaration(node);
}
@@ -10355,7 +10365,9 @@ class ResolutionEraser extends GeneralizingAstVisitor<Object> {
@override
Object visitDirective(Directive node) {
- node.element = null;
+ if (eraseDeclarations) {
+ node.element = null;
+ }
return super.visitDirective(node);
}
@@ -10368,7 +10380,9 @@ class ResolutionEraser extends GeneralizingAstVisitor<Object> {
@override
Object visitFunctionExpression(FunctionExpression node) {
- node.element = null;
+ if (eraseDeclarations) {
+ node.element = null;
+ }
return super.visitFunctionExpression(node);
}
@@ -10415,7 +10429,9 @@ class ResolutionEraser extends GeneralizingAstVisitor<Object> {
@override
Object visitSimpleIdentifier(SimpleIdentifier node) {
- node.staticElement = null;
+ if (eraseDeclarations || !node.inDeclarationContext()) {
+ node.staticElement = null;
+ }
node.propagatedElement = null;
return super.visitSimpleIdentifier(node);
}
@@ -10429,8 +10445,10 @@ class ResolutionEraser extends GeneralizingAstVisitor<Object> {
/**
* Remove any resolution information from the given AST structure.
*/
- static void erase(AstNode node) {
- node.accept(new ResolutionEraser());
+ static void erase(AstNode node, {bool eraseDeclarations: true}) {
+ ResolutionEraser eraser = new ResolutionEraser();
+ eraser.eraseDeclarations = eraseDeclarations;
+ node.accept(eraser);
}
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | pkg/analyzer/lib/src/task/driver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698