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

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

Issue 1287253002: dart2js cps: Compile some loops as 'for' loops. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update test expectations Created 5 years, 4 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) 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 4
5 // Tests of closures. 5 // Tests of closures.
6 6
7 library closures_test; 7 library closures_test;
8 8
9 import 'js_backend_cps_ir.dart'; 9 import 'js_backend_cps_ir.dart';
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 var a; 79 var a;
80 for (var i=0; i<10; i++) { 80 for (var i=0; i<10; i++) {
81 a = () => i; 81 a = () => i;
82 } 82 }
83 print(a()); 83 print(a());
84 } 84 }
85 """, 85 """,
86 r""" 86 r"""
87 function() { 87 function() {
88 var a = null, i = 0; 88 var a = null, i = 0;
89 while (i < 10) { 89 for (; i < 10; a = new V.main_closure(i), i = i + 1)
90 a = new V.main_closure(i); 90 ;
91 i = i + 1;
92 }
93 P.print(a.call$0()); 91 P.print(a.call$0());
94 }"""), 92 }"""),
95 93
96 const TestEntry.forMethod('function(A#b)', """ 94 const TestEntry.forMethod('function(A#b)', """
97 class A { 95 class A {
98 a() => 1; 96 a() => 1;
99 b() => () => a(); 97 b() => () => a();
100 } 98 }
101 main() { 99 main() {
102 print(new A().b()()); 100 print(new A().b()());
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 """, 182 """,
185 r""" 183 r"""
186 function(x) { 184 function(x) {
187 P.print(V.Foo$().getter$1(123)); 185 P.print(V.Foo$().getter$1(123));
188 }"""), 186 }"""),
189 ]; 187 ];
190 188
191 void main() { 189 void main() {
192 runTests(tests); 190 runTests(tests);
193 } 191 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart ('k') | tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698