diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /js/src/tests/test262/built-ins/Object/freeze | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/built-ins/Object/freeze')
23 files changed, 138 insertions, 156 deletions
diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-4.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-4.js index d1c0131160..812183048a 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-4.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-4.js @@ -17,8 +17,9 @@ Object.defineProperty(obj, "foo", { Object.freeze(obj); -assert(obj.hasOwnProperty("foo")); -verifyNotWritable(obj, "foo"); -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-1.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-1.js index a03d148d17..49575f4042 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-1.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-1.js @@ -13,9 +13,10 @@ obj.foo = 10; // default [[Configurable]] attribute value of foo: true Object.freeze(obj); -verifyNotWritable(obj, "foo"); -verifyNotConfigurable(obj, "foo"); - -assert.sameValue(obj.foo, 10); +verifyProperty(obj, "foo", { + value: 10, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-10.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-10.js index ac66e48f32..4f8efb99c8 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-10.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-10.js @@ -15,9 +15,10 @@ arrObj.foo = 10; // default [[Configurable]] attribute value of foo: true Object.freeze(arrObj); -verifyNotWritable(arrObj, "foo"); -verifyNotConfigurable(arrObj, "foo"); - -assert.sameValue(arrObj.foo, 10); +verifyProperty(arrObj, "foo", { + value: 10, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-11.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-11.js index b9db664525..4e4fe8ac10 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-11.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-11.js @@ -17,10 +17,10 @@ var argObj = (function() { Object.freeze(argObj); -var desc = Object.getOwnPropertyDescriptor(argObj, "0"); - -verifyNotWritable(argObj, "0"); -verifyNotConfigurable(argObj, "0"); -assert.sameValue(argObj[0], 1); +verifyProperty(argObj, "0", { + value: 1, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-12.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-12.js index 1eb5dbbc11..4072d7b0f1 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-12.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-12.js @@ -15,9 +15,10 @@ var strObj = new String("abc"); Object.freeze(strObj); -verifyNotWritable(strObj, "0"); -verifyNotConfigurable(strObj, "0"); - -assert.sameValue(strObj[0], "a"); +verifyProperty(strObj, "0", { + value: "a", + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-13.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-13.js index c4d1fa96be..41ce47b491 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-13.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-13.js @@ -17,9 +17,10 @@ var obj = { Object.freeze(obj); -verifyNotWritable(obj, "0"); -verifyNotConfigurable(obj, "0"); - -assert.sameValue(obj[0], 0); +verifyProperty(obj, "0", { + value: 0, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-14.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-14.js index eecc860739..f14cf55984 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-14.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-14.js @@ -14,8 +14,10 @@ var arrObj = [0, 1, 2]; Object.freeze(arrObj); -verifyNotWritable(arrObj, "0"); -verifyNotConfigurable(arrObj, "0"); -assert.sameValue(arrObj[0], 0); +verifyProperty(arrObj, "0", { + value: 0, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-2.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-2.js index 3bf26de301..94daf9f243 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-2.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-2.js @@ -23,9 +23,10 @@ child.foo = 10; // default [[Configurable]] attribute value of foo: true Object.freeze(child); -verifyNotWritable(child, "foo"); -verifyNotConfigurable(child, "foo"); - -assert.sameValue(child.foo, 10); +verifyProperty(child, "foo", { + value: 10, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-3.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-3.js index 9e70497f78..00faf0bfc8 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-3.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-3.js @@ -29,8 +29,10 @@ Object.defineProperty(child, "foo", { Object.freeze(child); -verifyNotWritable(child, "foo"); -verifyNotConfigurable(child, "foo"); -assert.sameValue(child.foo, 10); +verifyProperty(child, "foo", { + value: 10, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-4.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-4.js index acdfed7f01..be1ed8c528 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-4.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-4.js @@ -18,7 +18,10 @@ Object.defineProperty(obj, "foo", { Object.freeze(obj); -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + configurable: false, +}); + assert.sameValue(obj.foo, 10); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-5.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-5.js index 00ff5bfc63..f08d411009 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-5.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-5.js @@ -28,7 +28,10 @@ Object.defineProperty(child, "foo", { Object.freeze(child); -verifyNotConfigurable(child, "foo"); +verifyProperty(child, "foo", { + configurable: false, +}); + assert.sameValue(child.foo, 10); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-6.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-6.js index 163d0a951e..a1e8b22dac 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-6.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-6.js @@ -32,7 +32,10 @@ Object.defineProperty(child, "foo", { Object.freeze(child); -verifyNotConfigurable(child, "foo"); +verifyProperty(child, "foo", { + configurable: false, +}); + assert.sameValue(child.foo, 10); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-7.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-7.js index c8de353b20..5243d62cec 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-7.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-7.js @@ -17,8 +17,10 @@ argObj.foo = 10; // default [[Configurable]] attribute value of foo: true Object.freeze(argObj); -verifyNotWritable(argObj, "foo"); -verifyNotConfigurable(argObj, "foo"); -assert.sameValue(argObj.foo, 10); +verifyProperty(argObj, "foo", { + value: 10, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-8.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-8.js index f930bdee5f..d7eabe58ec 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-8.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-8.js @@ -15,8 +15,10 @@ strObj.foo = 10; // default [[Configurable]] attribute value of foo: true Object.freeze(strObj); -verifyNotWritable(strObj, "foo"); -verifyNotConfigurable(strObj, "foo"); -assert.sameValue(strObj.foo, 10); +verifyProperty(strObj, "foo", { + value: 10, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-9.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-9.js index 2d2c722646..f79a8ba921 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-9.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-9.js @@ -15,9 +15,10 @@ funObj.foo = 10; // default [[Configurable]] attribute value of foo: true Object.freeze(funObj); -verifyNotWritable(funObj, "foo"); -verifyNotConfigurable(funObj, "foo"); - -assert.sameValue(funObj.foo, 10); +verifyProperty(funObj, "foo", { + value: 10, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-b-i-1.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-b-i-1.js index 4c6c953c7b..26e0c0cb37 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-b-i-1.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-b-i-1.js @@ -19,22 +19,12 @@ Object.defineProperty(obj, "foo", { }); Object.freeze(obj); -var desc = Object.getOwnPropertyDescriptor(obj, "foo"); -verifyEqualTo(obj, "foo", 10); - -verifyNotWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); - -if (desc.writable !== false) { - throw new Test262Error('Expected desc.writable === false, actually ' + desc.writable); -} - -if (desc.configurable !== false) { - throw new Test262Error('Expected desc.configurable === false, actually ' + desc.configurable); -} +verifyProperty(obj, "foo", { + value: 10, + writable: false, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-b-i-2.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-b-i-2.js index 2d8a00a53b..bb6fd6bcf2 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-b-i-2.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-b-i-2.js @@ -28,39 +28,18 @@ Object.defineProperty(obj, "foo2", { Object.freeze(obj); -var desc1 = Object.getOwnPropertyDescriptor(obj, "foo1"); -var desc2 = Object.getOwnPropertyDescriptor(obj, "foo2"); - -verifyEqualTo(obj, "foo1", 10); - -verifyNotWritable(obj, "foo1"); - -verifyEnumerable(obj, "foo1"); - -verifyNotConfigurable(obj, "foo1"); - -verifyEqualTo(obj, "foo2", 20); - -verifyNotWritable(obj, "foo2"); - -verifyNotEnumerable(obj, "foo2"); - -verifyNotConfigurable(obj, "foo2"); - -if (desc1.configurable !== false) { - throw new Test262Error('Expected desc1.configurable === false, actually ' + desc1.configurable); -} - -if (desc1.writable !== false) { - throw new Test262Error('Expected desc1.writable === false, actually ' + desc1.writable); -} - -if (desc2.configurable !== false) { - throw new Test262Error('Expected desc2.configurable === false, actually ' + desc2.configurable); -} +verifyProperty(obj, "foo1", { + value: 10, + writable: false, + enumerable: true, + configurable: false, +}); -if (desc2.writable !== false) { - throw new Test262Error('Expected desc2.writable === false, actually ' + desc2.writable); -} +verifyProperty(obj, "foo2", { + value: 20, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-1.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-1.js index 219519195c..4969d18425 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-1.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-1.js @@ -21,21 +21,11 @@ Object.defineProperty(obj, "foo", { Object.freeze(obj); -var desc = Object.getOwnPropertyDescriptor(obj, "foo"); - -if (desc.configurable !== false) { - throw new Test262Error("Expected desc.configurable to be false, actually " + desc.configurable); -} -if (desc.writable !== false) { - throw new Test262Error("Expected desc.writable to be false, actually " + desc.writable); -} - -verifyEqualTo(obj, "foo", 10); - -verifyNotWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 10, + writable: false, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-2.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-2.js index af0797a00d..c59e8e068a 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-2.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-2.js @@ -31,17 +31,18 @@ Object.defineProperty(obj, "foo", { Object.freeze(obj); -assert(obj.hasOwnProperty("foo")); -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + configurable: false, +}); assert.sameValue(obj.foo, 10); obj.foo = 12; assert(set_funcCalled); -verifyEnumerable(obj, "foo"); - -var desc = Object.getOwnPropertyDescriptor(obj, "foo"); -assert.sameValue(desc.configurable, false); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-3.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-3.js index 24be086754..9ac2917a53 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-3.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-3.js @@ -37,7 +37,10 @@ Object.defineProperty(obj, "foo2", { Object.freeze(obj); -verifyNotConfigurable(obj, "foo2"); +verifyProperty(obj, "foo2", { + configurable: false, +}); + verifyEqualTo(obj, "foo2", 10); obj.foo2 = 12; @@ -45,26 +48,21 @@ if (!resultSetFun) { throw new Test262Error('Expected obj["foo2"] set() to be called, but was not.'); } -if (!isEnumerable(obj, "foo2")) { - throw new Test262Error('Expected obj["foo2"] to be enumerable.'); -} - -var desc1 = Object.getOwnPropertyDescriptor(obj, "foo1"); -if (desc1.configurable || desc1.writable) { - throw new Test262Error('Expected obj["foo1"] to be non-writable, non-configurable; actually ' + JSON.stringify(desc1)); -} +verifyProperty(obj, "foo2", { + enumerable: true, + configurable: false, +}); var desc2 = Object.getOwnPropertyDescriptor(obj, "foo2"); -if (desc2.configurable || desc2.writable) { +if (desc2.writable) { throw new Test262Error('Expected obj["foo2"] to be non-writable, non-configurable; actually ' + JSON.stringify(desc2)); } -verifyEqualTo(obj, "foo1", 10); - -verifyNotWritable(obj, "foo1"); - -verifyEnumerable(obj, "foo1"); - -verifyNotConfigurable(obj, "foo1"); +verifyProperty(obj, "foo1", { + value: 10, + writable: false, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-4.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-4.js index 49390cbf84..f211cbeb73 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-4.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-4.js @@ -38,31 +38,30 @@ Object.freeze(obj); verifyEqualTo(obj, "foo2", 10); -verifyNotConfigurable(obj, "foo2"); +verifyProperty(obj, "foo2", { + configurable: false, +}); obj.foo2 = 12; if (!resultSetFun) { throw new Test262Error('Expected obj["foo2"] set() to be called, but was not.'); } -verifyEnumerable(obj, "foo2"); - -var desc1 = Object.getOwnPropertyDescriptor(obj, "foo1"); -if (desc1.configurable || desc1.writable) { - throw new Test262Error('Expected obj["foo1"] to be non-writable, non-configurable; actually ' + JSON.stringify(desc1)); -} +verifyProperty(obj, "foo2", { + enumerable: true, + configurable: false, +}); var desc2 = Object.getOwnPropertyDescriptor(obj, "foo2"); -if (desc2.configurable || desc2.writable) { +if (desc2.writable) { throw new Test262Error('Expected obj["foo2"] to be non-writable, non-configurable; actually ' + JSON.stringify(desc2)); } -verifyEqualTo(obj, "foo1", 10); - -verifyNotWritable(obj, "foo1"); - -verifyEnumerable(obj, "foo1"); - -verifyNotConfigurable(obj, "foo1"); +verifyProperty(obj, "foo1", { + value: 10, + writable: false, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/name.js b/js/src/tests/test262/built-ins/Object/freeze/name.js index 1881d15751..c9f8c5115b 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/name.js +++ b/js/src/tests/test262/built-ins/Object/freeze/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.freeze.name, "freeze"); - -verifyNotEnumerable(Object.freeze, "name"); -verifyNotWritable(Object.freeze, "name"); -verifyConfigurable(Object.freeze, "name"); +verifyProperty(Object.freeze, "name", { + value: "freeze", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/freeze/not-a-constructor.js index 6d928f4f11..d4f1eadcfb 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/freeze/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Object.freeze), false, 'isConstructor(Object.free assert.throws(TypeError, () => { new Object.freeze({}); -}, '`new Object.freeze({})` throws TypeError'); +}); reportCompare(0, 0); |