| 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 operators. | 5 // Tests of operators. |
| 6 | 6 |
| 7 library operators_tests; | 7 library operators_tests; |
| 8 | 8 |
| 9 import 'js_backend_cps_ir.dart'; | 9 import 'js_backend_cps_ir.dart'; |
| 10 | 10 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 //} | 123 //} |
| 124 //"""), | 124 //"""), |
| 125 | 125 |
| 126 const TestEntry(""" | 126 const TestEntry(""" |
| 127 main() { | 127 main() { |
| 128 var list = [1, 2, 3]; | 128 var list = [1, 2, 3]; |
| 129 list[1] = 6; | 129 list[1] = 6; |
| 130 print(list); | 130 print(list); |
| 131 }""", r""" | 131 }""", r""" |
| 132 function() { | 132 function() { |
| 133 var list = [1, 2, 3], res, v0; | 133 var list = [1, 2, 3], v0; |
| 134 list[1] = 6; | 134 list[1] = 6; |
| 135 if (!(typeof (res = C.JSArray_methods.toString$0(list)) === "string")) | 135 if (!(typeof (v0 = P.IterableBase_iterableToFullString(list, "[", "]")) === "s
tring")) |
| 136 throw H.wrapException(H.argumentErrorValue(list)); | 136 throw H.wrapException(H.argumentErrorValue(list)); |
| 137 v0 = res; | |
| 138 if (typeof dartPrint == "function") | 137 if (typeof dartPrint == "function") |
| 139 dartPrint(v0); | 138 dartPrint(v0); |
| 140 else if (typeof console == "object" && typeof console.log != "undefined") | 139 else if (typeof console == "object" && typeof console.log != "undefined") |
| 141 console.log(v0); | 140 console.log(v0); |
| 142 else if (!(typeof window == "object")) { | 141 else if (!(typeof window == "object")) { |
| 143 if (!(typeof print == "function")) | 142 if (!(typeof print == "function")) |
| 144 throw "Unable to print message: " + String(v0); | 143 throw "Unable to print message: " + String(v0); |
| 145 print(v0); | 144 print(v0); |
| 146 } | 145 } |
| 147 }"""), | 146 }"""), |
| 148 ]; | 147 ]; |
| 149 | 148 |
| 150 void main() { | 149 void main() { |
| 151 runTests(tests); | 150 runTests(tests); |
| 152 } | 151 } |
| OLD | NEW |