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

Unified Diff: tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart

Issue 994323002: Support static getters and setters in the new dart2js code generator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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/compiler/lib/src/js_backend/codegen/glue.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart
index 60deac3cb5d39f0847c857a0bdc7e7fc54363142..902ea6b794f97178012a9d62b72a8a1caf89c168 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart
@@ -130,6 +130,52 @@ function() {
P.print(P.DateTime$now().isBefore$1(P.DateTime$now()));
return null;
}"""),
+ // Static calls
+ const TestEntry("""
+foo() { print(42); }
+main() { foo(); }
+""", r"""
+function() {
+ V.foo();
+ return null;
+}"""),
+ // Static getters
+ const TestEntry("""
+var foo = 42;
+main() { print(foo); }
+""", r"""
+function() {
+ P.print($.foo);
+ return null;
+}"""),
+ const TestEntry("""
+get foo { print(42); }
+main() { foo; }
+""", r"""
+function() {
+ V.foo();
+ return null;
+}"""),
+ // Static setters
+ const TestEntry("""
+var foo = 0;
+main() { print(foo = 42); }
+""", r"""
+function() {
+ var v0;
+ v0 = 42;
+ $.foo = v0;
+ P.print(v0);
+ return null;
+}"""),
+ const TestEntry("""
+set foo(x) { print(x); }
+main() { foo = 42; }
+""", r"""
+function() {
+ V.foo(42);
+ return null;
+}""")
];
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/glue.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698