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

Unified Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 2971893002: Remove other usages of ExecutableElement.localVariables. (Closed)
Patch Set: Created 3 years, 5 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 | « pkg/analyzer/test/src/dart/element/element_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/dart_test.dart
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index daa890470d394558da5d3db1ae9a1558e4ee32da..745a191590626b05108b7f2959712601f36fb9d4 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -185,7 +185,7 @@ f() {
<ConstantEvaluationTarget>[
unitElement.accessors.firstWhere((e) => e.isGetter).variable,
unitElement.types[0].fields[0],
- unitElement.functions[0].localVariables[0],
+ findLocalVariable(unit, 'z'),
unitElement.types[0].constructors[0],
resolutionMap.elementAnnotationForAnnotation(annotation),
unitElement.types[0].constructors[0].parameters[0]
@@ -4326,11 +4326,14 @@ main() {
CompilationUnit unit = outputs[RESOLVED_UNIT6];
FunctionDeclaration mainDeclaration = unit.declarations[0];
FunctionBody body = mainDeclaration.functionExpression.body;
- FunctionElement main = mainDeclaration.element;
- expectMutated(body, main.localVariables[0], false, false);
- expectMutated(body, main.localVariables[1], false, true);
- expectMutated(body, main.localVariables[2], true, true);
- expectMutated(body, main.localVariables[3], true, true);
+ LocalVariableElement v1 = findLocalVariable(unit, 'v1');
+ LocalVariableElement v2 = findLocalVariable(unit, 'v2');
+ LocalVariableElement v3 = findLocalVariable(unit, 'v3');
+ LocalVariableElement v4 = findLocalVariable(unit, 'v4');
+ expectMutated(body, v1, false, false);
+ expectMutated(body, v2, false, true);
+ expectMutated(body, v3, true, true);
+ expectMutated(body, v4, true, true);
}
test_perform_parameter() {
« no previous file with comments | « pkg/analyzer/test/src/dart/element/element_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698