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

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

Issue 1086323002: cps-ir: Remove redundant identical() calls in type propagation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase + update tests Created 5 years, 7 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
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 var a; 86 var a;
87 for (var i=0; i<10; i++) { 87 for (var i=0; i<10; i++) {
88 a = () => i; 88 a = () => i;
89 } 89 }
90 print(a()); 90 print(a());
91 } 91 }
92 """, 92 """,
93 r""" 93 r"""
94 function() { 94 function() {
95 var a = null, i = 0; 95 var a = null, i = 0;
96 while (P.identical(J.getInterceptor$n(i).$lt(i, 10), true)) { 96 while (J.getInterceptor$n(i).$lt(i, 10)) {
97 a = new V.main_closure(i); 97 a = new V.main_closure(i);
98 i = J.getInterceptor$ns(i).$add(i, 1); 98 i = J.getInterceptor$ns(i).$add(i, 1);
99 } 99 }
100 P.print(a.call$0()); 100 P.print(a.call$0());
101 return null; 101 return null;
102 }"""), 102 }"""),
103 103
104 const TestEntry.forMethod('function(A#b)', """ 104 const TestEntry.forMethod('function(A#b)', """
105 class A { 105 class A {
106 a() => 1; 106 a() => 1;
107 b() => () => a(); 107 b() => () => a();
108 } 108 }
109 main() { 109 main() {
110 print(new A().b()()); 110 print(new A().b()());
111 } 111 }
112 """, 112 """,
113 r""" 113 r"""
114 function() { 114 function() {
115 return new V.A_b_closure(this); 115 return new V.A_b_closure(this);
116 }"""), 116 }"""),
117 ]; 117 ];
118 118
119 void main() { 119 void main() {
120 runTests(tests); 120 runTests(tests);
121 } 121 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/type_propagation.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