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

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

Issue 756383004: Refactored treatment of closure variables in dart2js CPS. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comments Created 6 years 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/cps_generator.dart ('k') | pkg/analyzer2dart/test/sexpr_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer2dart/test/sexpr_data.dart
diff --git a/pkg/analyzer2dart/test/sexpr_data.dart b/pkg/analyzer2dart/test/sexpr_data.dart
index 85c937dd711b03ee4a66c90cf290f0a920b2c0ab..d6117c19a9affa3362a12cc663e266951fbda889 100644
--- a/pkg/analyzer2dart/test/sexpr_data.dart
+++ b/pkg/analyzer2dart/test/sexpr_data.dart
@@ -11,7 +11,11 @@ class TestSpec extends TestSpecBase {
// A [String] or a [Map<String, String>].
final output;
- const TestSpec(String input, this.output) : super(input);
+ /// True if the test should be skipped when testing analyzer2dart.
+ final bool skipInAnalyzerFrontend;
+
+ const TestSpec(String input, this.output,
+ {this.skipInAnalyzerFrontend: false}) : super(input);
}
const List<Group> TEST_DATA = const [
@@ -1355,4 +1359,28 @@ main(args) {
(InvokeMethod args length k0))
'''),
]),
+
+ const Group('Closure variables', const <TestSpec>[
+ const TestSpec('''
+main(x,foo) {
+ print(x);
+ getFoo() => foo;
+ print(getFoo());
+}
+''', '''
+(FunctionDefinition main {foo} (x foo return)
+ (LetCont (k0 v0)
+ (LetPrim v1 (CreateFunction
+ (FunctionDefinition getFoo ( return)
+ (LetPrim v2 (GetClosureVariable foo))
+ (InvokeContinuation return v2))))
+ (LetCont (k1 v3)
+ (LetCont (k2 v4)
+ (LetPrim v5 (Constant NullConstant))
+ (InvokeContinuation return v5))
+ (InvokeStatic print v3 k2))
+ (InvokeMethod v1 call k1))
+ (InvokeStatic print x k0))
+''', skipInAnalyzerFrontend: true)
+ ]),
];
« no previous file with comments | « pkg/analyzer2dart/lib/src/cps_generator.dart ('k') | pkg/analyzer2dart/test/sexpr_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698