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 --harmony-reflect | 5 // Flags: --stack-size=100 --harmony --harmony-reflect |
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 19 matching lines...) Expand all Loading... |
30 test(function() { | 30 test(function() { |
31 Function.prototype.apply.call(1, []); | 31 Function.prototype.apply.call(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 // kCalledNonCallable | 35 // kCalledNonCallable |
36 test(function() { | 36 test(function() { |
37 [].forEach(1); | 37 [].forEach(1); |
38 }, "1 is not a function", TypeError); | 38 }, "1 is not a function", TypeError); |
39 | 39 |
| 40 // kCalledOnNonObject |
| 41 test(function() { |
| 42 Object.freeze(1) |
| 43 }, "Object.freeze called on non-object", TypeError); |
| 44 |
40 // kCannotConvertToPrimitive | 45 // kCannotConvertToPrimitive |
41 test(function() { | 46 test(function() { |
42 [].join(Object(Symbol(1))); | 47 [].join(Object(Symbol(1))); |
43 }, "Cannot convert object to primitive value", TypeError); | 48 }, "Cannot convert object to primitive value", TypeError); |
44 | 49 |
45 // kDefineDisallowed | 50 // kDefineDisallowed |
46 test(function() { | 51 test(function() { |
47 "use strict"; | 52 "use strict"; |
48 var o = {}; | 53 var o = {}; |
49 Object.preventExtensions(o); | 54 Object.preventExtensions(o); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 // kStackOverflow | 243 // kStackOverflow |
239 test(function() { | 244 test(function() { |
240 function f() { f(Array(1000)); } | 245 function f() { f(Array(1000)); } |
241 f(); | 246 f(); |
242 }, "Maximum call stack size exceeded", RangeError); | 247 }, "Maximum call stack size exceeded", RangeError); |
243 | 248 |
244 // kToPrecisionFormatRange | 249 // kToPrecisionFormatRange |
245 test(function() { | 250 test(function() { |
246 Number(1).toPrecision(100); | 251 Number(1).toPrecision(100); |
247 }, "toPrecision() argument must be between 1 and 21", RangeError); | 252 }, "toPrecision() argument must be between 1 and 21", RangeError); |
OLD | NEW |