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 20 matching lines...) Expand all Loading... |
31 for (int j = 0; j < x.length; j++) { | 31 for (int j = 0; j < x.length; j++) { |
32 print(x[j]); | 32 print(x[j]); |
33 } | 33 } |
34 } | 34 } |
35 }""", | 35 }""", |
36 r""" | 36 r""" |
37 function() { | 37 function() { |
38 var l = ["hest", ["h", "e", "s", "t"]], i, x, j; | 38 var l = ["hest", ["h", "e", "s", "t"]], i, x, j; |
39 P.print(J.getInterceptor$as(l).get$length(l)); | 39 P.print(J.getInterceptor$as(l).get$length(l)); |
40 i = 0; | 40 i = 0; |
41 while (P.identical(J.getInterceptor$n(i).$lt(i, J.getInterceptor$as(l).get$len
gth(l)), true)) { | 41 while (J.getInterceptor$n(i).$lt(i, J.getInterceptor$as(l).get$length(l))) { |
42 x = J.getInterceptor$as(l).$index(l, i); | 42 x = J.getInterceptor$as(l).$index(l, i); |
43 j = 0; | 43 j = 0; |
44 while (P.identical(J.getInterceptor$n(j).$lt(j, J.getInterceptor$as(x).get$l
ength(x)), true)) { | 44 while (J.getInterceptor$n(j).$lt(j, J.getInterceptor$as(x).get$length(x))) { |
45 P.print(J.getInterceptor$as(x).$index(x, j)); | 45 P.print(J.getInterceptor$as(x).$index(x, j)); |
46 j = J.getInterceptor$ns(j).$add(j, 1); | 46 j = J.getInterceptor$ns(j).$add(j, 1); |
47 } | 47 } |
48 i = J.getInterceptor$ns(i).$add(i, 1); | 48 i = J.getInterceptor$ns(i).$add(i, 1); |
49 } | 49 } |
50 return null; | 50 return null; |
51 }"""), | 51 }"""), |
52 ]; | 52 ]; |
53 | 53 |
54 | 54 |
55 void main() { | 55 void main() { |
56 runTests(tests); | 56 runTests(tests); |
57 } | 57 } |
OLD | NEW |