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

Unified Diff: pkg/analyzer2dart/test/end2end_data.dart

Issue 652403005: Support assignment of locals in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 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
« no previous file with comments | « pkg/analyzer2dart/lib/src/tree_shaker.dart ('k') | pkg/analyzer2dart/test/identifier_semantics_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer2dart/test/end2end_data.dart
diff --git a/pkg/analyzer2dart/test/end2end_data.dart b/pkg/analyzer2dart/test/end2end_data.dart
index dff55f809cbd56a83608929cf46edfd1ab505304..1f68c2d1c7ebf3732c2ff4f75e6949a168f0a6f6 100644
--- a/pkg/analyzer2dart/test/end2end_data.dart
+++ b/pkg/analyzer2dart/test/end2end_data.dart
@@ -191,6 +191,61 @@ main() {
'''),
]),
+ const Group('Local variable writes', const <TestSpec>[
+ const TestSpec('''
+main() {
+ var a;
+ a = 10;
+ return a;
+}
+''', '''
+main() {
+ return 10;
+}
+'''),
+
+ const TestSpec('''
+main() {
+ var a = 0;
+ a = 10;
+ return a;
+}
+''', '''
+main() {
+ return 10;
+}
+'''),
+
+ const TestSpec('''
+main() {
+ var a = 0;
+ print(a);
+ a = "";
+ print(a);
+ return a;
+}
+'''),
+
+ const TestSpec('''
+main(a) {
+ print(a);
+ a = "";
+ print(a);
+ return a;
+}
+'''),
+
+ const TestSpec('''
+main(a) {
+ if (a) {
+ a = "";
+ }
+ print(a);
+ return a;
+}
+'''),
+ ]),
+
const Group('Dynamic access', const <TestSpec>[
const TestSpec('''
main(a) {
« no previous file with comments | « pkg/analyzer2dart/lib/src/tree_shaker.dart ('k') | pkg/analyzer2dart/test/identifier_semantics_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698