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

Side by Side Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 1681493005: Fix for recording 'null' as a defined element. (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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.generated.resolver; 5 library analyzer.src.generated.resolver;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/visitor.dart'; 10 import 'package:analyzer/dart/ast/visitor.dart';
(...skipping 4055 matching lines...) Expand 10 before | Expand all | Expand 10 after
4066 super.visitMethodDeclaration(node); 4066 super.visitMethodDeclaration(node);
4067 } finally { 4067 } finally {
4068 _enclosingExec = enclosingExecOld; 4068 _enclosingExec = enclosingExecOld;
4069 } 4069 }
4070 } 4070 }
4071 4071
4072 @override 4072 @override
4073 visitSimpleIdentifier(SimpleIdentifier node) { 4073 visitSimpleIdentifier(SimpleIdentifier node) {
4074 Element element = node.staticElement; 4074 Element element = node.staticElement;
4075 if (node.inDeclarationContext()) { 4075 if (node.inDeclarationContext()) {
4076 definedElements.add(element); 4076 if (element != null) {
4077 definedElements.add(element);
4078 }
4077 return; 4079 return;
4078 } 4080 }
4079 bool isIdentifierRead = _isReadIdentifier(node); 4081 bool isIdentifierRead = _isReadIdentifier(node);
4080 if (element is LocalVariableElement) { 4082 if (element is LocalVariableElement) {
4081 if (isIdentifierRead) { 4083 if (isIdentifierRead) {
4082 usedElements.addElement(element); 4084 usedElements.addElement(element);
4083 } 4085 }
4084 } else { 4086 } else {
4085 _useIdentifierElement(node); 4087 _useIdentifierElement(node);
4086 if (element == null || 4088 if (element == null ||
(...skipping 8595 matching lines...) Expand 10 before | Expand all | Expand 10 after
12682 nonFields.add(node); 12684 nonFields.add(node);
12683 return null; 12685 return null;
12684 } 12686 }
12685 12687
12686 @override 12688 @override
12687 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); 12689 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this);
12688 12690
12689 @override 12691 @override
12690 Object visitWithClause(WithClause node) => null; 12692 Object visitWithClause(WithClause node) => null;
12691 } 12693 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698