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

Unified Diff: frog/tests/leg/src/ClosureCodegenTest.dart

Issue 9086010: closure calls (just the invocation part). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update test status file. Created 8 years, 12 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 | « frog/leg/typechecker.dart ('k') | tests/language/language-leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/tests/leg/src/ClosureCodegenTest.dart
diff --git a/frog/tests/leg/src/ClosureCodegenTest.dart b/frog/tests/leg/src/ClosureCodegenTest.dart
new file mode 100644
index 0000000000000000000000000000000000000000..94e24debf78a424943f389f4c826dacd46f48be5
--- /dev/null
+++ b/frog/tests/leg/src/ClosureCodegenTest.dart
@@ -0,0 +1,41 @@
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// Test that parameters keep their names in the output.
+
+#import("compiler_helper.dart");
+#import("parser_helper.dart");
+
+final String TEST_INVOCATION0 = @"""
+main() {
+ var o = null;
+ o();
+}
+""";
+
+final String TEST_INVOCATION1 = @"""
+main() {
+ var o = null;
+ o(1);
+}
+""";
+
+final String TEST_INVOCATION2 = @"""
+main() {
+ var o = null;
+ o(1, 2);
+}
+""";
+
+closureInvocation() {
+ String generated = compile(TEST_INVOCATION0);
+ Expect.isTrue(generated.contains(".\$call()"));
+ generated = compile(TEST_INVOCATION1);
+ Expect.isTrue(generated.contains(".\$call(1)"));
+ generated = compile(TEST_INVOCATION2);
+ Expect.isTrue(generated.contains(".\$call(1, 2)"));
+}
+
+main() {
+ closureInvocation();
+}
« no previous file with comments | « frog/leg/typechecker.dart ('k') | tests/language/language-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698