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

Unified Diff: pkg/analyzer/lib/dart/ast/ast.dart

Issue 1700263002: Add data structures to AST to indicate potentially mutated variables. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Follow Brian's suggestion 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/dart/ast/ast.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/dart/ast/ast.dart
diff --git a/pkg/analyzer/lib/dart/ast/ast.dart b/pkg/analyzer/lib/dart/ast/ast.dart
index 8e295f2c3410800bceda00ca30cc2bbf0722e98b..598d6116c181de35f372ced023f6d874991cd3c9 100644
--- a/pkg/analyzer/lib/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/dart/ast/ast.dart
@@ -536,7 +536,7 @@ abstract class AstNode {
* (either AST nodes or tokens) that make up the contents of this node,
* including doc comments but excluding other comments.
*/
- Iterable/*<AstNode | Token>*/ get childEntities;
+ Iterable /*<AstNode | Token>*/ get childEntities;
/**
* Return the offset of the character immediately following the last character
@@ -591,7 +591,7 @@ abstract class AstNode {
* Use the given [visitor] to visit this node. Return the value returned by
* the visitor as a result of visiting this node.
*/
- dynamic /* =E */ accept/*<E>*/(AstVisitor/*<E>*/ visitor);
+ dynamic /* =E */ accept /*<E>*/ (AstVisitor /*<E>*/ visitor);
/**
* Return the most immediate ancestor of this node for which the [predicate]
@@ -3780,6 +3780,32 @@ abstract class FunctionBody extends AstNode {
* is no star.
*/
Token get star;
+
+ /**
+ * If [variable] is a local variable or parameter declared anywhere within
+ * the top level function or method containing this [FunctionBody], return a
+ * boolean indicating whether [variable] is potentially mutated within a
+ * local function other than the function in which it is declared.
+ *
+ * If [variable] is not a local variable or parameter declared within the top
+ * level function or method containing this [FunctionBody], return `false`.
+ *
+ * Throws an exception if resolution has not yet been performed.
+ */
+ bool isPotentiallyMutatedInClosure(VariableElement variable);
+
+ /**
+ * If [variable] is a local variable or parameter declared anywhere within
+ * the top level function or method containing this [FunctionBody], return a
+ * boolean indicating whether [variable] is potentially mutated within the
+ * scope of its declaration.
+ *
+ * If [variable] is not a local variable or parameter declared within the top
+ * level function or method containing this [FunctionBody], return `false`.
+ *
+ * Throws an exception if resolution has not yet been performed.
+ */
+ bool isPotentiallyMutatedInScope(VariableElement variable);
}
/**
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/ast/ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698