diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /js/src/tests/test262/built-ins/Object/isFrozen | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/built-ins/Object/isFrozen')
61 files changed, 1107 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-0-1.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-0-1.js new file mode 100644 index 0000000000..c30cdcfd6c --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-0-1.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-0-1 +description: Object.isFrozen must exist as a function +---*/ + +var f = Object.isFrozen; + +assert.sameValue(typeof(f), "function", 'typeof(f)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-0-2.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-0-2.js new file mode 100644 index 0000000000..4c23ddb324 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-0-2.js @@ -0,0 +1,11 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-0-2 +description: Object.isFrozen must exist as a function taking 1 parameter +---*/ + +assert.sameValue(Object.isFrozen.length, 1, 'Object.isFrozen.length'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-1.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-1.js new file mode 100644 index 0000000000..99b82bb5f8 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-1.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-1-1 +description: > + Object.isFrozen - TypeError is not thrown when the first param 'O' + is undefined +---*/ + +Object.isFrozen(undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-2.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-2.js new file mode 100644 index 0000000000..b7c54cac7c --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-2.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-1-2 +description: > + Object.isFrozen - TypeError is not thrown when the first param 'O' + is null +---*/ + +Object.isFrozen(null); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-3.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-3.js new file mode 100644 index 0000000000..01293b08da --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-3.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-1-3 +description: > + Object.isFrozen - TypeError is not thrown when the first param 'O' + is a boolean +---*/ + +Object.isFrozen(true); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-4.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-4.js new file mode 100644 index 0000000000..af5296610d --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-4.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-1-4 +description: > + Object.isFrozen - TypeError is not thrown when the first param 'O' + is a string +---*/ + +Object.isFrozen("abc"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-5.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-5.js new file mode 100644 index 0000000000..a9453055be --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-5.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-1-5 +description: Object.isFrozen applies to dense array +---*/ + +var obj = Object.freeze([0, 1, 2]); + +assert(Object.isFrozen(obj), 'Object.isFrozen(obj) !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-6.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-6.js new file mode 100644 index 0000000000..5169e63a4c --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-6.js @@ -0,0 +1,16 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-1-6 +description: Object.isFrozen applies to sparse array +---*/ + +var sparseArr = [0, 1]; +sparseArr[10000] = 10000; + +sparseArr = Object.freeze(sparseArr); + +assert(Object.isFrozen(sparseArr), 'Object.isFrozen(sparseArr) !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-7.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-7.js new file mode 100644 index 0000000000..dbf304e0b6 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1-7.js @@ -0,0 +1,19 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-1-7 +description: > + Object.isFrozen applies to non-array object which contains index + named properties +---*/ + +var obj = Object.freeze({ + 0: 0, + 1: 1, + 1000: 1000 +}); + +assert(Object.isFrozen(obj), 'Object.isFrozen(obj) !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1.js new file mode 100644 index 0000000000..40edf0f31c --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-1.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-1 +description: > + Object.isFrozen does not throw TypeError if type of first param is + not Object +---*/ + +Object.isFrozen(0); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-1.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-1.js new file mode 100644 index 0000000000..1491744985 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-1.js @@ -0,0 +1,27 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-2-1 +description: > + Object.isFrozen - inherited data property is not considered into + the for each loop +---*/ + +var proto = {}; +Object.defineProperty(proto, "Father", { + value: 10, + writable: false, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); + +Object.preventExtensions(child); + +assert(Object.isFrozen(child), 'Object.isFrozen(child) !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-2.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-2.js new file mode 100644 index 0000000000..07a4cc8d2b --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-2.js @@ -0,0 +1,34 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-2-2 +description: > + Object.isFrozen - inherited accessor property is not considered + into the for each loop +---*/ + +var proto = {}; + +function get_func() { + return 10; +} + +function set_func() {} + +Object.defineProperty(proto, "Father", { + get: get_func, + set: set_func, + configurable: true +}); + +var Con = function() {}; +Con.prototype = proto; + +var child = new Con(); + +Object.preventExtensions(child); + +assert(Object.isFrozen(child), 'Object.isFrozen(child) !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-1.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-1.js new file mode 100644 index 0000000000..5fcf32b45c --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-1.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-2-a-1 +description: Object.isFrozen - 'P' is own data property +---*/ + +var obj = {}; + +Object.defineProperty(obj, "foo", { + value: 12, + writable: true, + configurable: false +}); + +Object.preventExtensions(obj); + +assert.sameValue(Object.isFrozen(obj), false, 'Object.isFrozen(obj)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-11.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-11.js new file mode 100644 index 0000000000..c33097705a --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-11.js @@ -0,0 +1,19 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-2-a-11 +description: Object.isFrozen - 'O' is the Arguments object +---*/ + +var arg; + +(function fun() { + arg = arguments; +}(1, 2, 3)); + +Object.preventExtensions(arg); + +assert.sameValue(Object.isFrozen(arg), false, 'Object.isFrozen(arg)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-12.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-12.js new file mode 100644 index 0000000000..d188de24d1 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-12.js @@ -0,0 +1,17 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-2-a-12 +description: Object.isFrozen - 'O' is a String object +---*/ + +var obj = new String("abc"); + +obj.len = 100; + +Object.preventExtensions(obj); + +assert.sameValue(Object.isFrozen(obj), false, 'Object.isFrozen(obj)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-13.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-13.js new file mode 100644 index 0000000000..93cf8ac3c2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-13.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-2-a-13 +description: Object.isFrozen - 'O' is a Function object +---*/ + +var obj = function() {}; + +Object.defineProperty(obj, "property", { + value: 12, + writable: true, + configurable: false +}); + +Object.preventExtensions(obj); + +assert.sameValue(Object.isFrozen(obj), false, 'Object.isFrozen(obj)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-14.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-14.js new file mode 100644 index 0000000000..6c1d4a810a --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-14.js @@ -0,0 +1,16 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-2-a-14 +description: Object.isFrozen - 'O' is an Array object +---*/ + +var obj = [2]; +obj.len = 200; + +Object.preventExtensions(obj); + +assert.sameValue(Object.isFrozen(obj), false, 'Object.isFrozen(obj)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-2.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-2.js new file mode 100644 index 0000000000..1c80dabdac --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-2.js @@ -0,0 +1,33 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-2-a-2 +description: > + Object.isFrozen - 'P' is own data property that overrides an + inherited data property +---*/ + +var proto = {}; + +Object.defineProperty(proto, "foo", { + value: 9, + writable: false, + configurable: false +}); + +var Con = function() {}; +Con.prototype = proto; +var child = new Con(); + +Object.defineProperty(child, "foo", { + value: 12, + writable: true, + configurable: false +}); + +Object.preventExtensions(child); + +assert.sameValue(Object.isFrozen(child), false, 'Object.isFrozen(child)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-3.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-3.js new file mode 100644 index 0000000000..45b0d12e67 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-3.js @@ -0,0 +1,34 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-2-a-3 +description: > + Object.isFrozen - 'P' is own data property that overrides an + inherited accessor property +---*/ + +var proto = {}; + +Object.defineProperty(proto, "foo", { + get: function() { + return 9; + }, + configurable: false +}); + +var Con = function() {}; +Con.prototype = proto; +var child = new Con(); + + +Object.defineProperty(child, "foo", { + value: 12, + configurable: true +}); + +Object.preventExtensions(child); + +assert.sameValue(Object.isFrozen(child), false, 'Object.isFrozen(child)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-4.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-4.js new file mode 100644 index 0000000000..eb221237de --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-4.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-2-a-4 +description: Object.isFrozen - 'P' is own accessor property +---*/ + +var obj = {}; +Object.defineProperty(obj, "foo", { + get: function() { + return 9; + }, + configurable: true +}); + +Object.preventExtensions(obj); + +assert.sameValue(Object.isFrozen(obj), false, 'Object.isFrozen(obj)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-5.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-5.js new file mode 100644 index 0000000000..23f870f82d --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-5.js @@ -0,0 +1,33 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-2-a-5 +description: > + Object.isFrozen - 'P' is own accessor property that overrides an + inherited data property +---*/ + +var proto = {}; + +Object.defineProperty(proto, "foo", { + value: 12, + configurable: false +}); + +var Con = function() {}; +Con.prototype = proto; +var child = new Con(); + +Object.defineProperty(child, "foo", { + get: function() { + return 9; + }, + configurable: true +}); + +Object.preventExtensions(child); + +assert.sameValue(Object.isFrozen(child), false, 'Object.isFrozen(child)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-6.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-6.js new file mode 100644 index 0000000000..d8d6e9e2ce --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-6.js @@ -0,0 +1,36 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-2-a-6 +description: > + Object.isFrozen - 'P' is own accessor property that overrides an + inherited accessor property +---*/ + +var proto = {}; + +Object.defineProperty(proto, "foo", { + get: function() { + return 12; + }, + configurable: false +}); + +var Con = function() {}; +Con.prototype = proto; +var child = new Con(); + + +Object.defineProperty(child, "foo", { + get: function() { + return 9; + }, + configurable: true +}); + +Object.preventExtensions(child); + +assert.sameValue(Object.isFrozen(child), false, 'Object.isFrozen(child)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-7.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-7.js new file mode 100644 index 0000000000..efbb917e2f --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-7.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-2-a-7 +description: > + Object.isFrozen - 'P' is own accessor property without a get + function +---*/ + +var obj = {}; +Object.defineProperty(obj, "foo", { + set: function() {}, + configurable: true +}); + +Object.preventExtensions(obj); + +assert.sameValue(Object.isFrozen(obj), false, 'Object.isFrozen(obj)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-8.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-8.js new file mode 100644 index 0000000000..41207b4c80 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-a-8.js @@ -0,0 +1,33 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-2-a-8 +description: > + Object.isFrozen - 'P' is own accessor property without a get + function that overrides an inherited accessor property +---*/ + +var proto = {}; + +Object.defineProperty(proto, "foo", { + get: function() { + return 9; + }, + configurable: false +}); + +var Con = function() {}; +Con.prototype = proto; +var child = new Con(); + +Object.defineProperty(child, "foo", { + set: function() {}, + configurable: true +}); + +Object.preventExtensions(child); + +assert.sameValue(Object.isFrozen(child), false, 'Object.isFrozen(child)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-b-i-1.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-b-i-1.js new file mode 100644 index 0000000000..b33f2b0700 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-b-i-1.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-2-b-i-1 +description: > + Object.isFrozen returns false if 'O' contains own writable data + property +---*/ + +var obj = {}; +Object.defineProperty(obj, "foo", { + value: 20, + writable: true, + configurable: false +}); +Object.preventExtensions(obj); + +assert.sameValue(Object.isFrozen(obj), false, 'Object.isFrozen(obj)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-c-1.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-c-1.js new file mode 100644 index 0000000000..75cee88605 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-c-1.js @@ -0,0 +1,22 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-2-c-1 +description: > + Object.isFrozen returns false if 'O' contains own configurable + data property +---*/ + +var obj = {}; +Object.defineProperty(obj, "foo", { + value: 20, + writable: false, + configurable: true +}); + +Object.preventExtensions(obj); + +assert.sameValue(Object.isFrozen(obj), false, 'Object.isFrozen(obj)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-c-2.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-c-2.js new file mode 100644 index 0000000000..0110d56c49 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-2-c-2.js @@ -0,0 +1,29 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-2-c-2 +description: > + Object.isFrozen returns false if 'O' contains own configurable + accessor property +---*/ + +var obj = {}; + +function get_func() { + return 10; +} + +function set_func() {} + +Object.defineProperty(obj, "foo", { + get: get_func, + set: set_func, + configurable: true +}); + +Object.preventExtensions(obj); + +assert.sameValue(Object.isFrozen(obj), false, 'Object.isFrozen(obj)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-1.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-1.js new file mode 100644 index 0000000000..7ba4b95381 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-1.js @@ -0,0 +1,11 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-1 +description: Object.isFrozen returns false for all built-in objects (Global) +---*/ + +assert(!Object.isFrozen(this)); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-10.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-10.js new file mode 100644 index 0000000000..b679daed2b --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-10.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-10 +description: Object.isFrozen returns false for all built-in objects (Boolean) +---*/ + +var b = Object.isFrozen(Boolean); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-11.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-11.js new file mode 100644 index 0000000000..b2b9d7b67e --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-11.js @@ -0,0 +1,15 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-11 +description: > + Object.isFrozen returns false for all built-in objects + (Boolean.prototype) +---*/ + +var b = Object.isFrozen(Boolean.prototype); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-12.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-12.js new file mode 100644 index 0000000000..c5402693fa --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-12.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-12 +description: Object.isFrozen returns false for all built-in objects (Number) +---*/ + +var b = Object.isFrozen(Number); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-13.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-13.js new file mode 100644 index 0000000000..dd28b24d36 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-13.js @@ -0,0 +1,15 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-13 +description: > + Object.isFrozen returns false for all built-in objects + (Number.prototype) +---*/ + +var b = Object.isFrozen(Number.prototype); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-14.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-14.js new file mode 100644 index 0000000000..8a94a92338 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-14.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-14 +description: Object.isFrozen returns false for all built-in objects (Math) +---*/ + +var b = Object.isFrozen(Math); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-15.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-15.js new file mode 100644 index 0000000000..a39061c429 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-15.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-15 +description: Object.isFrozen returns false for all built-in objects (Date) +---*/ + +var b = Object.isFrozen(Date); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-16.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-16.js new file mode 100644 index 0000000000..52f6a85e4a --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-16.js @@ -0,0 +1,15 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-16 +description: > + Object.isFrozen returns false for all built-in objects + (Date.prototype) +---*/ + +var b = Object.isFrozen(Date.prototype); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-17.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-17.js new file mode 100644 index 0000000000..f99e006510 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-17.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-17 +description: Object.isFrozen returns false for all built-in objects (RegExp) +---*/ + +var b = Object.isFrozen(RegExp); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-18.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-18.js new file mode 100644 index 0000000000..8434b79b85 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-18.js @@ -0,0 +1,15 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-18 +description: > + Object.isFrozen returns false for all built-in objects + (RegExp.prototype) +---*/ + +var b = Object.isFrozen(RegExp.prototype); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-19.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-19.js new file mode 100644 index 0000000000..f125bc67a4 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-19.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-19 +description: Object.isFrozen returns false for all built-in objects (Error) +---*/ + +var b = Object.isFrozen(Error); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-2.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-2.js new file mode 100644 index 0000000000..ffa070888c --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-2.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-2 +description: Object.isFrozen returns false for all built-in objects (Object) +---*/ + +var b = Object.isFrozen(Object); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-20.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-20.js new file mode 100644 index 0000000000..3bffc5529e --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-20.js @@ -0,0 +1,15 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-20 +description: > + Object.isFrozen returns false for all built-in objects + (Error.prototype) +---*/ + +var b = Object.isFrozen(Error.prototype); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-21.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-21.js new file mode 100644 index 0000000000..2a8d30f968 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-21.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-21 +description: Object.isFrozen returns false for all built-in objects (EvalError) +---*/ + +var b = Object.isFrozen(EvalError); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-22.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-22.js new file mode 100644 index 0000000000..6a664e279d --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-22.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-22 +description: Object.isFrozen returns false for all built-in objects (RangeError) +---*/ + +var b = Object.isFrozen(RangeError); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-23.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-23.js new file mode 100644 index 0000000000..974c2949fe --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-23.js @@ -0,0 +1,15 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-23 +description: > + Object.isFrozen returns false for all built-in objects + (ReferenceError) +---*/ + +var b = Object.isFrozen(ReferenceError); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-24.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-24.js new file mode 100644 index 0000000000..1d3e75be86 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-24.js @@ -0,0 +1,15 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-24 +description: > + Object.isFrozen returns false for all built-in objects + (SyntaxError) +---*/ + +var b = Object.isFrozen(SyntaxError); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-25.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-25.js new file mode 100644 index 0000000000..86cfc530e7 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-25.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-25 +description: Object.isFrozen returns false for all built-in objects (TypeError) +---*/ + +var b = Object.isFrozen(TypeError); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-26.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-26.js new file mode 100644 index 0000000000..0304619454 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-26.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-26 +description: Object.isFrozen returns false for all built-in objects (URIError) +---*/ + +var b = Object.isFrozen(URIError); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-27.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-27.js new file mode 100644 index 0000000000..8b13c85019 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-27.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-27 +description: Object.isFrozen returns false for all built-in objects (JSON) +---*/ + +var b = Object.isFrozen(JSON); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-28.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-28.js new file mode 100644 index 0000000000..e8d631151c --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-28.js @@ -0,0 +1,37 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-28 +description: > + Object.isFrozen returns true when all own properties of 'O' are + not writable and not configurable, and 'O' is not extensible +---*/ + +var obj = {}; + +Object.defineProperty(obj, "foo1", { + value: 20, + writable: false, + enumerable: false, + configurable: false +}); + + +function get_func() { + return 10; +} + +function set_func() {} + +Object.defineProperty(obj, "foo2", { + get: get_func, + set: set_func, + configurable: false +}); + +Object.preventExtensions(obj); + +assert(Object.isFrozen(obj), 'Object.isFrozen(obj) !== true'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-3.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-3.js new file mode 100644 index 0000000000..85007c7f8e --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-3.js @@ -0,0 +1,15 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-3 +description: > + Object.isFrozen returns false for all built-in objects + (Object.prototype) +---*/ + +var b = Object.isFrozen(Object.prototype); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-4.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-4.js new file mode 100644 index 0000000000..53cce1fb6f --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-4.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-4 +description: Object.isFrozen returns false for all built-in objects (Function) +---*/ + +var b = Object.isFrozen(Function); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-5.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-5.js new file mode 100644 index 0000000000..badf8057e3 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-5.js @@ -0,0 +1,15 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-5 +description: > + Object.isFrozen returns false for all built-in objects + (Function.prototype) +---*/ + +var b = Object.isFrozen(Function.prototype); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-6.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-6.js new file mode 100644 index 0000000000..50702e237f --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-6.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-6 +description: Object.isFrozen returns false for all built-in objects (Array) +---*/ + +var b = Object.isFrozen(Array); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-7.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-7.js new file mode 100644 index 0000000000..501b5505bc --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-7.js @@ -0,0 +1,15 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-7 +description: > + Object.isFrozen returns false for all built-in objects + (Array.prototype) +---*/ + +var b = Object.isFrozen(Array.prototype); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-8.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-8.js new file mode 100644 index 0000000000..f7d7e68ef8 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-8.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-8 +description: Object.isFrozen returns false for all built-in objects (String) +---*/ + +var b = Object.isFrozen(String); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-9.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-9.js new file mode 100644 index 0000000000..c465f97638 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-3-9.js @@ -0,0 +1,15 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-3-9 +description: > + Object.isFrozen returns false for all built-in objects + (String.prototype) +---*/ + +var b = Object.isFrozen(String.prototype); + +assert.sameValue(b, false, 'b'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-4-1.js b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-4-1.js new file mode 100644 index 0000000000..62d775f224 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/15.2.3.12-4-1.js @@ -0,0 +1,11 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.2.3.12-4-1 +description: Object.isFrozen returns false if extensible is true +---*/ + +assert.sameValue(Object.isFrozen({}), false, 'Object.isFrozen({})'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/browser.js b/js/src/tests/test262/built-ins/Object/isFrozen/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/browser.js diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/name.js b/js/src/tests/test262/built-ins/Object/isFrozen/name.js new file mode 100644 index 0000000000..4b83c75722 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/name.js @@ -0,0 +1,28 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 19.1.2.12 +description: > + Object.isFrozen.name is "isFrozen". +info: | + Object.isFrozen ( O ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Object.isFrozen.name, "isFrozen"); + +verifyNotEnumerable(Object.isFrozen, "name"); +verifyNotWritable(Object.isFrozen, "name"); +verifyConfigurable(Object.isFrozen, "name"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/isFrozen/not-a-constructor.js new file mode 100644 index 0000000000..5f8014985b --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/not-a-constructor.js @@ -0,0 +1,31 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Object.isFrozen does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(Object.isFrozen), false, 'isConstructor(Object.isFrozen) must return false'); + +assert.throws(TypeError, () => { + new Object.isFrozen({}); +}, '`new Object.isFrozen({})` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/proxy-no-ownkeys-returned-keys-order.js b/js/src/tests/test262/built-ins/Object/isFrozen/proxy-no-ownkeys-returned-keys-order.js new file mode 100644 index 0000000000..5989f8c123 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/proxy-no-ownkeys-returned-keys-order.js @@ -0,0 +1,54 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-object.isfrozen +description: > + If Proxy "ownKeys" trap is missing, keys are sorted by type in ascending + chronological order. +info: | + TestIntegrityLevel ( O, level ) + + [...] + 6. Let keys be ? O.[[OwnPropertyKeys]](). + 7. For each element k of keys, do + a. Let currentDesc be ? O.[[GetOwnProperty]](k). + + [[OwnPropertyKeys]] ( ) + + [...] + 6. If trap is undefined, then + a. Return ? target.[[OwnPropertyKeys]](). + + OrdinaryOwnPropertyKeys ( O ) + + [...] + 3. For each own property key P of O such that Type(P) is String and P is + not an array index, in ascending chronological order of property creation, do + a. Add P as the last element of keys. + 4. For each own property key P of O such that Type(P) is Symbol, + in ascending chronological order of property creation, do + a. Add P as the last element of keys. + 5. Return keys. +features: [Proxy, Symbol, Reflect] +includes: [compareArray.js] +---*/ + +var target = {}; +var sym = Symbol(); +target[sym] = 1; +target.foo = 2; +target[0] = 3; +Object.freeze(target); + +var getOwnKeys = []; +var proxy = new Proxy(target, { + getOwnPropertyDescriptor: function(target, key) { + getOwnKeys.push(key); + return Reflect.getOwnPropertyDescriptor(target, key); + }, +}); + +Object.isFrozen(proxy); +assert.compareArray(getOwnKeys, ["0", "foo", sym]); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/shell.js b/js/src/tests/test262/built-ins/Object/isFrozen/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/isFrozen/shell.js |