| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |