OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --harmony-exponentiation-operator --harmony-proxies | 5 // Flags: --harmony-exponentiation-operator |
6 | 6 |
7 function TestBasic() { | 7 function TestBasic() { |
8 assertEquals(-(8 ** 2), -64); | 8 assertEquals(-(8 ** 2), -64); |
9 assertEquals(+(8 ** 2), 64); | 9 assertEquals(+(8 ** 2), 64); |
10 assertEquals(~(8 ** 2), -65); | 10 assertEquals(~(8 ** 2), -65); |
11 assertEquals(!(8 ** 2), false); | 11 assertEquals(!(8 ** 2), false); |
12 | 12 |
13 assertEquals(2 ** -2, 0.25); | 13 assertEquals(2 ** -2, 0.25); |
14 | 14 |
15 var o = { p: 1 }; | 15 var o = { p: 1 }; |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 assertThrows("if (false) { 17 **= 10; }", ReferenceError); | 269 assertThrows("if (false) { 17 **= 10; }", ReferenceError); |
270 assertThrows("if (false) { '17' **= 10; }", ReferenceError); | 270 assertThrows("if (false) { '17' **= 10; }", ReferenceError); |
271 assertThrows("if (false) { /17/ **= 10; }", ReferenceError); | 271 assertThrows("if (false) { /17/ **= 10; }", ReferenceError); |
272 assertThrows("if (false) { ({ valueOf() { return 17; } } **= 10); }", | 272 assertThrows("if (false) { ({ valueOf() { return 17; } } **= 10); }", |
273 ReferenceError); | 273 ReferenceError); |
274 // TODO(caitp): a Call expression as LHS should be an early ReferenceError! | 274 // TODO(caitp): a Call expression as LHS should be an early ReferenceError! |
275 // assertThrows("if (false) { Array() **= 10; }", ReferenceError); | 275 // assertThrows("if (false) { Array() **= 10; }", ReferenceError); |
276 assertThrows(() => Array() **= 10, ReferenceError); | 276 assertThrows(() => Array() **= 10, ReferenceError); |
277 } | 277 } |
278 TestBadAssignmentLHS(); | 278 TestBadAssignmentLHS(); |
OLD | NEW |