| 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 | 5 |
| 5 // Tests of interceptors. | 6 // Tests of closures. |
| 6 | 7 |
| 7 library closures_test; | 8 library closures_test; |
| 8 | 9 |
| 9 import 'js_backend_cps_ir_test.dart'; | 10 import 'js_backend_cps_ir.dart'; |
| 10 | 11 |
| 11 const List<TestEntry> tests = const [ | 12 const List<TestEntry> tests = const [ |
| 12 const TestEntry(""" | 13 const TestEntry(""" |
| 13 main(x) { | 14 main(x) { |
| 14 a() { | 15 a() { |
| 15 return x; | 16 return x; |
| 16 } | 17 } |
| 17 x = x + '1'; | 18 x = x + '1'; |
| 18 print(a()); | 19 print(a()); |
| 19 } | 20 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 v1 = 1; | 117 v1 = 1; |
| 117 box_01.i_0 = J.getInterceptor(i).$add(i, v1); | 118 box_01.i_0 = J.getInterceptor(i).$add(i, v1); |
| 118 box_0 = box_01; | 119 box_0 = box_01; |
| 119 } else { | 120 } else { |
| 120 P.print(a.call$0()); | 121 P.print(a.call$0()); |
| 121 return null; | 122 return null; |
| 122 } | 123 } |
| 123 } | 124 } |
| 124 }"""), | 125 }"""), |
| 125 ]; | 126 ]; |
| 127 |
| 128 void main() { |
| 129 runTests(tests); |
| 130 } |
| OLD | NEW |