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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/LocalVariableElementImpl.java

Issue 49383003: Issue 14358. Check for assignment in any close. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/LocalVariableElementImpl.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/LocalVariableElementImpl.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/LocalVariableElementImpl.java
index 9f4868d80ea2f8607d687a06945aac259b8722f4..dfaabf3658dee109a2df976e393497d3b5848a97 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/LocalVariableElementImpl.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/element/LocalVariableElementImpl.java
@@ -28,7 +28,12 @@ public class LocalVariableElementImpl extends VariableElementImpl implements Loc
/**
* Is {@code true} if this variable is potentially mutated somewhere in its scope.
*/
- private boolean isPotentiallyMutated;
+ private boolean isPotentiallyMutatedInScope;
+
+ /**
+ * Is {@code true} if this variable is potentially mutated somewhere in closure.
+ */
+ private boolean isPotentiallyMutatedInClosure;
/**
* The offset to the beginning of the visible range for this element.
@@ -74,15 +79,27 @@ public class LocalVariableElementImpl extends VariableElementImpl implements Loc
}
@Override
- public boolean isPotentiallyMutated() {
- return isPotentiallyMutated;
+ public boolean isPotentiallyMutatedInClosure() {
+ return isPotentiallyMutatedInClosure;
+ }
+
+ @Override
+ public boolean isPotentiallyMutatedInScope() {
+ return isPotentiallyMutatedInScope;
}
/**
* Specifies that this variable is potentially mutated somewhere in its scope.
*/
public void markPotentiallyMutated() {
Brian Wilkerson 2013/10/29 19:34:06 nit: add "InScope" to name.
- isPotentiallyMutated = true;
+ isPotentiallyMutatedInScope = true;
+ }
+
+ /**
+ * Specifies that this variable is potentially mutated somewhere in closure.
+ */
+ public void markPotentiallyMutatedInClosure() {
+ isPotentiallyMutatedInClosure = true;
}
/**

Powered by Google App Engine
This is Rietveld 408576698