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

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

Issue 916403002: cps2js: Fix translation of captured 'this'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 years, 10 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/cps_ir/cps_ir_builder.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 of closures. 6 // Tests of closures.
7 7
8 library closures_test; 8 library closures_test;
9 9
10 import 'js_backend_cps_ir.dart'; 10 import 'js_backend_cps_ir.dart';
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 if (P.identical(J.getInterceptor$n(i).$lt(i, v0), true)) { 110 if (P.identical(J.getInterceptor$n(i).$lt(i, v0), true)) {
111 a = new V.main_closure(i); 111 a = new V.main_closure(i);
112 v1 = 1; 112 v1 = 1;
113 i = J.getInterceptor$ns(i).$add(i, v1); 113 i = J.getInterceptor$ns(i).$add(i, v1);
114 } else { 114 } else {
115 P.print(a.call$0()); 115 P.print(a.call$0());
116 return null; 116 return null;
117 } 117 }
118 } 118 }
119 }"""), 119 }"""),
120
121 const TestEntry.forMethod('function(A#b)', """
122 class A {
123 a() => 1;
124 b() => () => a();
125 }
126 main() {
127 print(new A().b()());
128 }
129 """,
130 r"""
131 function() {
132 return new V.A_b_closure(this);
133 }"""),
120 ]; 134 ];
121 135
122 void main() { 136 void main() {
123 runTests(tests); 137 runTests(tests);
124 } 138 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698