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

Unified Diff: pkg/analyzer/test/src/summary/summary_common.dart

Issue 1839643003: Fixes for AST summary generation when variables are missing. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/summary/in_summary_source_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/summary/summary_common.dart
diff --git a/pkg/analyzer/test/src/summary/summary_common.dart b/pkg/analyzer/test/src/summary/summary_common.dart
index a0eb33433eb31df08a4d67979066535230ddf428..e6685d895e7bca9b3c6f0ed942e48dc89015e139 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -4749,6 +4749,19 @@ f() { // 1
}
}
+ test_executable_localVariables_catch_noVariables() {
+ String code = r'''
+f() {
+ try {
+ throw 42;
+ } on int {}
+}
+''';
+ UnlinkedExecutable executable = serializeExecutableText(code);
+ List<UnlinkedVariable> variables = executable.localVariables;
+ expect(variables, isEmpty);
+ }
+
test_executable_localVariables_empty() {
UnlinkedExecutable executable = serializeExecutableText(r'''
f() {
@@ -4798,6 +4811,17 @@ f() { // 1
}
}
+ test_executable_localVariables_forLoop_noVariables() {
+ String code = r'''
+f() {
+ for (; true;) {}
+}
+''';
+ UnlinkedExecutable executable = serializeExecutableText(code);
+ List<UnlinkedVariable> variables = executable.localVariables;
+ expect(variables, isEmpty);
+ }
+
test_executable_localVariables_inConstructor() {
String code = r'''
class C {
« no previous file with comments | « pkg/analyzer/test/src/summary/in_summary_source_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698