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 | |
45 // kCannotConvertToPrimitive | 40 // kCannotConvertToPrimitive |
46 test(function() { | 41 test(function() { |
47 [].join(Object(Symbol(1))); | 42 [].join(Object(Symbol(1))); |
48 }, "Cannot convert object to primitive value", TypeError); | 43 }, "Cannot convert object to primitive value", TypeError); |
49 | 44 |
50 // kDefineDisallowed | 45 // kDefineDisallowed |
51 test(function() { | 46 test(function() { |
52 "use strict"; | 47 "use strict"; |
53 var o = {}; | 48 var o = {}; |
54 Object.preventExtensions(o); | 49 Object.preventExtensions(o); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 // kStackOverflow | 238 // kStackOverflow |
244 test(function() { | 239 test(function() { |
245 function f() { f(Array(1000)); } | 240 function f() { f(Array(1000)); } |
246 f(); | 241 f(); |
247 }, "Maximum call stack size exceeded", RangeError); | 242 }, "Maximum call stack size exceeded", RangeError); |
248 | 243 |
249 // kToPrecisionFormatRange | 244 // kToPrecisionFormatRange |
250 test(function() { | 245 test(function() { |
251 Number(1).toPrecision(100); | 246 Number(1).toPrecision(100); |
252 }, "toPrecision() argument must be between 1 and 21", RangeError); | 247 }, "toPrecision() argument must be between 1 and 21", RangeError); |
OLD | NEW |