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 | 6 |
7 function test(f, expected, type) { | 7 function test(f, expected, type) { |
8 try { | 8 try { |
9 f(); | 9 f(); |
10 } catch (e) { | 10 } catch (e) { |
(...skipping 10 matching lines...) Expand all Loading... |
21 test(function() { | 21 test(function() { |
22 var o = {}; | 22 var o = {}; |
23 o.__proto__ = o; | 23 o.__proto__ = o; |
24 }, "Cyclic __proto__ value", Error); | 24 }, "Cyclic __proto__ value", Error); |
25 | 25 |
26 | 26 |
27 // === TypeError === | 27 // === TypeError === |
28 | 28 |
29 // kApplyNonFunction | 29 // kApplyNonFunction |
30 test(function() { | 30 test(function() { |
31 Function.prototype.apply.call(1, []); | 31 Reflect.apply(1, []); |
32 }, "Function.prototype.apply was called on 1, which is a number " + | 32 }, "Function.prototype.apply was called on 1, which is a number " + |
33 "and not a function", TypeError); | 33 "and not a function", TypeError); |
34 | 34 |
35 // kArrayFunctionsOnFrozen | 35 // kArrayFunctionsOnFrozen |
36 test(function() { | 36 test(function() { |
37 var a = [1, 2]; | 37 var a = [1, 2]; |
38 Object.freeze(a); | 38 Object.freeze(a); |
39 a.splice(1, 1, [1]); | 39 a.splice(1, 1, [1]); |
40 }, "Cannot modify frozen array elements", TypeError); | 40 }, "Cannot modify frozen array elements", TypeError); |
41 | 41 |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 Number(1).toString(100); | 449 Number(1).toString(100); |
450 }, "toString() radix argument must be between 2 and 36", RangeError); | 450 }, "toString() radix argument must be between 2 and 36", RangeError); |
451 | 451 |
452 | 452 |
453 // === URIError === | 453 // === URIError === |
454 | 454 |
455 // kURIMalformed | 455 // kURIMalformed |
456 test(function() { | 456 test(function() { |
457 decodeURI("%%"); | 457 decodeURI("%%"); |
458 }, "URI malformed", URIError); | 458 }, "URI malformed", URIError); |
OLD | NEW |