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

Side by Side Diff: tests/compiler/dart2js/js_backend_cps_ir_constructor_test.dart

Issue 1203423003: dart2js cps: Better fallthrough analysis and eliminate "return null". (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update tests Created 5 years, 6 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 4
5 // Tests of interceptors. 5 // Tests of interceptors.
6 6
7 library constructor_test; 7 library constructor_test;
8 8
9 import 'js_backend_cps_ir.dart'; 9 import 'js_backend_cps_ir.dart';
10 10
(...skipping 25 matching lines...) Expand all
36 Sub(x, this.y) : super(x) { 36 Sub(x, this.y) : super(x) {
37 print(x); 37 print(x);
38 } 38 }
39 } 39 }
40 main() { 40 main() {
41 print(new Sub(1, 2).x); 41 print(new Sub(1, 2).x);
42 }""", 42 }""",
43 r""" 43 r"""
44 function(x, y) { 44 function(x, y) {
45 P.print(x); 45 P.print(x);
46 return null;
47 }"""), 46 }"""),
48 47
49 const TestEntry.forMethod('generative_constructor(Sub#)', """ 48 const TestEntry.forMethod('generative_constructor(Sub#)', """
50 class Base0 { 49 class Base0 {
51 Base0() { 50 Base0() {
52 print('Base0'); 51 print('Base0');
53 } 52 }
54 } 53 }
55 class Base extends Base0 { 54 class Base extends Base0 {
56 var x; 55 var x;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 }"""), 155 }"""),
157 const TestEntry(r""" 156 const TestEntry(r"""
158 class C<T> { 157 class C<T> {
159 foo() => T; 158 foo() => T;
160 } 159 }
161 main() { 160 main() {
162 print(new C<int>().foo()); 161 print(new C<int>().foo());
163 }""", r""" 162 }""", r"""
164 function() { 163 function() {
165 P.print(V.C$(P.$int).foo$0()); 164 P.print(V.C$(P.$int).foo$0());
166 return null;
167 }"""), 165 }"""),
168 const TestEntry(r""" 166 const TestEntry(r"""
169 class C<T> { 167 class C<T> {
170 foo() => C; 168 foo() => C;
171 } 169 }
172 main() { 170 main() {
173 print(new C<int>().foo()); 171 print(new C<int>().foo());
174 }""", r""" 172 }""", r"""
175 function() { 173 function() {
176 P.print(V.C$().foo$0()); 174 P.print(V.C$().foo$0());
177 return null;
178 }"""), 175 }"""),
179 const TestEntry.forMethod('generative_constructor(C#)', r""" 176 const TestEntry.forMethod('generative_constructor(C#)', r"""
180 class C<T> { 177 class C<T> {
181 C() { print(T); } 178 C() { print(T); }
182 foo() => print(T); 179 foo() => print(T);
183 } 180 }
184 main() { 181 main() {
185 new C<int>(); 182 new C<int>();
186 }""", r""" 183 }""", r"""
187 function($T) { 184 function($T) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 class Foo { 236 class Foo {
240 factory Foo.make(x) = Foo.create; 237 factory Foo.make(x) = Foo.create;
241 var x; 238 var x;
242 Foo.create(this.x); 239 Foo.create(this.x);
243 } 240 }
244 main() { 241 main() {
245 print(new Foo.make(5)); 242 print(new Foo.make(5));
246 }""", r""" 243 }""", r"""
247 function() { 244 function() {
248 P.print(V.Foo$create(5)); 245 P.print(V.Foo$create(5));
249 return null;
250 }"""), 246 }"""),
251 const TestEntry(r""" 247 const TestEntry(r"""
252 class A { 248 class A {
253 factory A(x) = B<int>; 249 factory A(x) = B<int>;
254 get typevar; 250 get typevar;
255 } 251 }
256 class B<T> implements A { 252 class B<T> implements A {
257 var x; 253 var x;
258 B(this.x); 254 B(this.x);
259 255
260 get typevar => T; 256 get typevar => T;
261 } 257 }
262 main() { 258 main() {
263 new A(5).typevar; 259 new A(5).typevar;
264 }""", r""" 260 }""", r"""
265 function() { 261 function() {
266 V.B$(5, P.$int).get$typevar(); 262 V.B$(5, P.$int).get$typevar();
267 return null;
268 }"""), 263 }"""),
269 ]; 264 ];
270 265
271 void main() { 266 void main() {
272 runTests(tests); 267 runTests(tests);
273 } 268 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698