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

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

Issue 1197673003: dart2js cps: Get typed selectors for compound operators. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase 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) 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 var a; 83 var a;
84 for (var i=0; i<10; i++) { 84 for (var i=0; i<10; i++) {
85 a = () => i; 85 a = () => i;
86 } 86 }
87 print(a()); 87 print(a());
88 } 88 }
89 """, 89 """,
90 r""" 90 r"""
91 function() { 91 function() {
92 var a = null, i = 0; 92 var a = null, i = 0;
93 while (J.getInterceptor$n(i).$lt(i, 10)) { 93 while (i < 10) {
94 a = new V.main_closure(i); 94 a = new V.main_closure(i);
95 i = J.getInterceptor$ns(i).$add(i, 1); 95 i = i + 1;
96 } 96 }
97 P.print(a.call$0()); 97 P.print(a.call$0());
98 return null; 98 return null;
99 }"""), 99 }"""),
100 100
101 const TestEntry.forMethod('function(A#b)', """ 101 const TestEntry.forMethod('function(A#b)', """
102 class A { 102 class A {
103 a() => 1; 103 a() => 1;
104 b() => () => a(); 104 b() => () => a();
105 } 105 }
106 main() { 106 main() {
107 print(new A().b()()); 107 print(new A().b()());
108 } 108 }
109 """, 109 """,
110 r""" 110 r"""
111 function() { 111 function() {
112 return new V.A_b_closure(this); 112 return new V.A_b_closure(this);
113 }"""), 113 }"""),
114 ]; 114 ];
115 115
116 void main() { 116 void main() {
117 runTests(tests); 117 runTests(tests);
118 } 118 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | tests/compiler/dart2js/js_backend_cps_ir_interceptors_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698