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 | 4 |
5 // Tests of interceptors. | 5 // Tests of interceptors. |
6 | 6 |
7 library interceptors_tests; | 7 library interceptors_tests; |
8 | 8 |
9 import 'js_backend_cps_ir.dart'; | 9 import 'js_backend_cps_ir.dart'; |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 var x = l[i]; | 29 var x = l[i]; |
30 for (int j = 0; j < x.length; j++) { | 30 for (int j = 0; j < x.length; j++) { |
31 print(x[j]); | 31 print(x[j]); |
32 } | 32 } |
33 } | 33 } |
34 }""", | 34 }""", |
35 r""" | 35 r""" |
36 function() { | 36 function() { |
37 var l = ["hest", ["h", "e", "s", "t"]], i = 0, x, j; | 37 var l = ["hest", ["h", "e", "s", "t"]], i = 0, x, j; |
38 P.print(J.getInterceptor$as(l).get$length(l)); | 38 P.print(J.getInterceptor$as(l).get$length(l)); |
39 while (J.getInterceptor$n(i).$lt(i, J.getInterceptor$as(l).get$length(l))) { | 39 while (i < J.getInterceptor$as(l).get$length(l)) { |
40 x = J.getInterceptor$as(l).$index(l, i); | 40 x = J.getInterceptor$as(l).$index(l, i); |
41 j = 0; | 41 j = 0; |
42 while (J.getInterceptor$n(j).$lt(j, J.getInterceptor$as(x).get$length(x))) { | 42 while (j < J.getInterceptor$as(x).get$length(x)) { |
43 P.print(J.getInterceptor$as(x).$index(x, j)); | 43 P.print(J.getInterceptor$as(x).$index(x, j)); |
44 j = J.getInterceptor$ns(j).$add(j, 1); | 44 j = j + 1; |
45 } | 45 } |
46 i = J.getInterceptor$ns(i).$add(i, 1); | 46 i = i + 1; |
47 } | 47 } |
48 return null; | 48 return null; |
49 }"""), | 49 }"""), |
50 ]; | 50 ]; |
51 | 51 |
52 | 52 |
53 void main() { | 53 void main() { |
54 runTests(tests); | 54 runTests(tests); |
55 } | 55 } |
OLD | NEW |