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

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

Issue 1648923003: Fix an exception caused by malformed code (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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/string_source.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 72d094a59a27d4782fa9c2fd2d2cc83ef69c0df5..986637df213cc38e82c087e1342251828a6a5b0c 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -7677,7 +7677,7 @@ class PartialResolverVisitor extends ResolverVisitor {
*/
void _addPropagableVariables(List<VariableDeclaration> variables) {
for (VariableDeclaration variable in variables) {
- if (variable.initializer != null) {
+ if (variable.name.name.isNotEmpty && variable.initializer != null) {
VariableElement element = variable.element;
if (element.isConst || element.isFinal) {
propagableVariables.add(element);
@@ -7695,7 +7695,7 @@ class PartialResolverVisitor extends ResolverVisitor {
*/
void _addStaticVariables(List<VariableDeclaration> variables) {
for (VariableDeclaration variable in variables) {
- if (variable.initializer != null) {
+ if (variable.name.name.isNotEmpty && variable.initializer != null) {
staticVariables.add(variable.element);
}
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/string_source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698