| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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: --stack-size=100 --harmony | 5 // Flags: --stack-size=100 --harmony |
| 6 // Flags: --harmony-simd |
| 6 | 7 |
| 7 function test(f, expected, type) { | 8 function test(f, expected, type) { |
| 8 try { | 9 try { |
| 9 f(); | 10 f(); |
| 10 } catch (e) { | 11 } catch (e) { |
| 11 assertInstanceof(e, type); | 12 assertInstanceof(e, type); |
| 12 assertEquals(expected, e.message); | 13 assertEquals(expected, e.message); |
| 13 return; | 14 return; |
| 14 } | 15 } |
| 15 assertUnreachable("Exception expected"); | 16 assertUnreachable("Exception expected"); |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 // kSymbolToString | 313 // kSymbolToString |
| 313 test(function() { | 314 test(function() { |
| 314 "" + Symbol(); | 315 "" + Symbol(); |
| 315 }, "Cannot convert a Symbol value to a string", TypeError); | 316 }, "Cannot convert a Symbol value to a string", TypeError); |
| 316 | 317 |
| 317 // kSymbolToNumber | 318 // kSymbolToNumber |
| 318 test(function() { | 319 test(function() { |
| 319 1 + Symbol(); | 320 1 + Symbol(); |
| 320 }, "Cannot convert a Symbol value to a number", TypeError); | 321 }, "Cannot convert a Symbol value to a number", TypeError); |
| 321 | 322 |
| 323 // kSimdToNumber |
| 324 test(function() { |
| 325 1 + SIMD.Float32x4(1, 2, 3, 4); |
| 326 }, "Cannot convert a SIMD value to a number", TypeError); |
| 327 |
| 322 // kUndefinedOrNullToObject | 328 // kUndefinedOrNullToObject |
| 323 test(function() { | 329 test(function() { |
| 324 Array.prototype.toString.call(null); | 330 Array.prototype.toString.call(null); |
| 325 }, "Cannot convert undefined or null to object", TypeError); | 331 }, "Cannot convert undefined or null to object", TypeError); |
| 326 | 332 |
| 327 // kValueAndAccessor | 333 // kValueAndAccessor |
| 328 test(function() { | 334 test(function() { |
| 329 Object.defineProperty({}, "x", { get: function(){}, value: 1}); | 335 Object.defineProperty({}, "x", { get: function(){}, value: 1}); |
| 330 }, "Invalid property descriptor. Cannot both specify accessors " + | 336 }, "Invalid property descriptor. Cannot both specify accessors " + |
| 331 "and a value or writable attribute, #<Object>", TypeError); | 337 "and a value or writable attribute, #<Object>", TypeError); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 Number(1).toString(100); | 450 Number(1).toString(100); |
| 445 }, "toString() radix argument must be between 2 and 36", RangeError); | 451 }, "toString() radix argument must be between 2 and 36", RangeError); |
| 446 | 452 |
| 447 | 453 |
| 448 // === URIError === | 454 // === URIError === |
| 449 | 455 |
| 450 // kURIMalformed | 456 // kURIMalformed |
| 451 test(function() { | 457 test(function() { |
| 452 decodeURI("%%"); | 458 decodeURI("%%"); |
| 453 }, "URI malformed", URIError); | 459 }, "URI malformed", URIError); |
| OLD | NEW |