| 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 operators. | 6 // Tests of operators. |
| 7 | 7 |
| 8 library operators_tests; | 8 library operators_tests; |
| 9 | 9 |
| 10 import 'js_backend_cps_ir.dart'; | 10 import 'js_backend_cps_ir.dart'; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 P.print(P.identical(V.foo(), true) && P.identical(V.foo(), true)); | 36 P.print(P.identical(V.foo(), true) && P.identical(V.foo(), true)); |
| 37 return null; | 37 return null; |
| 38 }"""), | 38 }"""), |
| 39 const TestEntry(""" | 39 const TestEntry(""" |
| 40 get foo => foo; | 40 get foo => foo; |
| 41 main() { print(foo || foo); }""", | 41 main() { print(foo || foo); }""", |
| 42 """function() { | 42 """function() { |
| 43 P.print(P.identical(V.foo(), true) || P.identical(V.foo(), true)); | 43 P.print(P.identical(V.foo(), true) || P.identical(V.foo(), true)); |
| 44 return null; | 44 return null; |
| 45 }"""), | 45 }"""), |
| 46 |
| 47 // Needs interceptor calling convention |
| 48 //const TestEntry(""" |
| 49 //class Foo { |
| 50 // operator[]=(index, value) { |
| 51 // print(value); |
| 52 // } |
| 53 //} |
| 54 //main() { |
| 55 // var foo = new Foo(); |
| 56 // foo[5] = 6; |
| 57 //}""", r""" |
| 58 //function() { |
| 59 // V.Foo$().$indexSet(5, 6); |
| 60 //} |
| 61 //"""), |
| 62 |
| 63 const TestEntry(""" |
| 64 main() { |
| 65 var list = [1, 2, 3]; |
| 66 list[1] = 6; |
| 67 print(list); |
| 68 }""", r""" |
| 69 function() { |
| 70 var list = [1, 2, 3]; |
| 71 J.getInterceptor$a(list).$indexSet(list, 1, 6); |
| 72 P.print(list); |
| 73 return null; |
| 74 }"""), |
| 46 ]; | 75 ]; |
| 47 | 76 |
| 48 void main() { | 77 void main() { |
| 49 runTests(tests); | 78 runTests(tests); |
| 50 } | 79 } |
| OLD | NEW |