Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: test/mjsunit/messages.js

Issue 1103473003: Revert of [es6] don't throw if argument is non-object (O.freeze, O.seal, O.preventExtensions) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/v8natives.js ('k') | test/mjsunit/object-freeze.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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);
OLDNEW
« no previous file with comments | « src/v8natives.js ('k') | test/mjsunit/object-freeze.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698