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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/glue.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // VMOptions=-DUSE_CPS_IR=true 4 // VMOptions=-DUSE_CPS_IR=true
5 5
6 // Tests for basic functionality. 6 // Tests for basic functionality.
7 7
8 library basic_tests; 8 library basic_tests;
9 9
10 import 'js_backend_cps_ir.dart'; 10 import 'js_backend_cps_ir.dart';
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 }"""), 123 }"""),
124 // Method invocation 124 // Method invocation
125 const TestEntry(""" 125 const TestEntry("""
126 main() { 126 main() {
127 print(new DateTime.now().isBefore(new DateTime.now())); 127 print(new DateTime.now().isBefore(new DateTime.now()));
128 }""", r""" 128 }""", r"""
129 function() { 129 function() {
130 P.print(P.DateTime$now().isBefore$1(P.DateTime$now())); 130 P.print(P.DateTime$now().isBefore$1(P.DateTime$now()));
131 return null; 131 return null;
132 }"""), 132 }"""),
133 // Static calls
134 const TestEntry("""
135 foo() { print(42); }
136 main() { foo(); }
137 """, r"""
138 function() {
139 V.foo();
140 return null;
141 }"""),
142 // Static getters
143 const TestEntry("""
144 var foo = 42;
145 main() { print(foo); }
146 """, r"""
147 function() {
148 P.print($.foo);
149 return null;
150 }"""),
151 const TestEntry("""
152 get foo { print(42); }
153 main() { foo; }
154 """, r"""
155 function() {
156 V.foo();
157 return null;
158 }"""),
159 // Static setters
160 const TestEntry("""
161 var foo = 0;
162 main() { print(foo = 42); }
163 """, r"""
164 function() {
165 var v0;
166 v0 = 42;
167 $.foo = v0;
168 P.print(v0);
169 return null;
170 }"""),
171 const TestEntry("""
172 set foo(x) { print(x); }
173 main() { foo = 42; }
174 """, r"""
175 function() {
176 V.foo(42);
177 return null;
178 }""")
133 ]; 179 ];
134 180
135 181
136 void main() { 182 void main() {
137 runTests(tests); 183 runTests(tests);
138 } 184 }
OLDNEW
« 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