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

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

Issue 1729523002: Revert collecting defined elements. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/task/dart.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 59359c19e033baa505730e881a6fa2a963e29a0b..45c75b2ebc9b0c49a30b296f92e4762dff94b301 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -4015,7 +4015,6 @@ class GatherUsedImportedElementsVisitor extends RecursiveAstVisitor {
* An [AstVisitor] that fills [UsedLocalElements].
*/
class GatherUsedLocalElementsVisitor extends RecursiveAstVisitor {
- final List<Element> definedElements = <Element>[];
final UsedLocalElements usedElements = new UsedLocalElements();
final LibraryElement _enclosingLibrary;
@@ -4085,13 +4084,10 @@ class GatherUsedLocalElementsVisitor extends RecursiveAstVisitor {
@override
visitSimpleIdentifier(SimpleIdentifier node) {
- Element element = node.staticElement;
if (node.inDeclarationContext()) {
- if (element != null) {
- definedElements.add(element);
- }
return;
}
+ Element element = node.staticElement;
bool isIdentifierRead = _isReadIdentifier(node);
if (element is LocalVariableElement) {
if (isIdentifierRead) {
@@ -12237,7 +12233,7 @@ class TypeResolverVisitor extends ScopedVisitor {
* structure looking for cases of [HintCode.UNUSED_ELEMENT],
* [HintCode.UNUSED_FIELD], [HintCode.UNUSED_LOCAL_VARIABLE], etc.
*/
-class UnusedLocalElementsVerifier extends SimpleElementVisitor {
+class UnusedLocalElementsVerifier extends RecursiveElementVisitor {
/**
* The error listener to which errors will be reported.
*/
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698