diff options
Diffstat (limited to '')
141 files changed, 668 insertions, 511 deletions
diff --git a/js/src/tests/test262/built-ins/Array/Symbol.species/length.js b/js/src/tests/test262/built-ins/Array/Symbol.species/length.js index a0744b86ae..fba06806a3 100644 --- a/js/src/tests/test262/built-ins/Array/Symbol.species/length.js +++ b/js/src/tests/test262/built-ins/Array/Symbol.species/length.js @@ -25,10 +25,11 @@ features: [Symbol.species] var desc = Object.getOwnPropertyDescriptor(Array, Symbol.species); -assert.sameValue(desc.get.length, 0); - -verifyNotEnumerable(desc.get, "length"); -verifyNotWritable(desc.get, "length"); -verifyConfigurable(desc.get, "length"); +verifyProperty(desc.get, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/Symbol.species/symbol-species-name.js b/js/src/tests/test262/built-ins/Array/Symbol.species/symbol-species-name.js index 8c943ef709..f74dac394e 100644 --- a/js/src/tests/test262/built-ins/Array/Symbol.species/symbol-species-name.js +++ b/js/src/tests/test262/built-ins/Array/Symbol.species/symbol-species-name.js @@ -15,13 +15,11 @@ includes: [propertyHelper.js] var descriptor = Object.getOwnPropertyDescriptor(Array, Symbol.species); -assert.sameValue( - descriptor.get.name, - 'get [Symbol.species]' -); - -verifyNotEnumerable(descriptor.get, 'name'); -verifyNotWritable(descriptor.get, 'name'); -verifyConfigurable(descriptor.get, 'name'); +verifyProperty(descriptor.get, "name", { + value: "get [Symbol.species]", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/from/Array.from-name.js b/js/src/tests/test262/built-ins/Array/from/Array.from-name.js index 267647c639..7aecd2cb32 100644 --- a/js/src/tests/test262/built-ins/Array/from/Array.from-name.js +++ b/js/src/tests/test262/built-ins/Array/from/Array.from-name.js @@ -19,14 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Array.from.name, - 'from', - 'The value of Array.from.name is expected to be "from"' -); - -verifyNotEnumerable(Array.from, 'name'); -verifyNotWritable(Array.from, 'name'); -verifyConfigurable(Array.from, 'name'); +verifyProperty(Array.from, "name", { + value: "from", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/from/Array.from_arity.js b/js/src/tests/test262/built-ins/Array/from/Array.from_arity.js index 68b3287765..9442265a5e 100644 --- a/js/src/tests/test262/built-ins/Array/from/Array.from_arity.js +++ b/js/src/tests/test262/built-ins/Array/from/Array.from_arity.js @@ -14,10 +14,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.from.length, 1, 'The value of Array.from.length is expected to be 1'); - -verifyNotEnumerable(Array.from, 'length'); -verifyNotWritable(Array.from, 'length'); -verifyConfigurable(Array.from, 'length'); +verifyProperty(Array.from, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/fromAsync/shell.js b/js/src/tests/test262/built-ins/Array/fromAsync/shell.js index 3489e7ef68..4daca91e51 100644 --- a/js/src/tests/test262/built-ins/Array/fromAsync/shell.js +++ b/js/src/tests/test262/built-ins/Array/fromAsync/shell.js @@ -2135,6 +2135,9 @@ var TemporalHelpers = { "11-18junk", "11-18[u-ca=gregory]", "11-18[u-ca=hebrew]", + "11-18[U-CA=iso8601]", + "11-18[u-CA=iso8601]", + "11-18[FOO=bar]", ]; }, @@ -2222,6 +2225,11 @@ var TemporalHelpers = { plainYearMonthStringsInvalid() { return [ "2020-13", + "1976-11[u-ca=gregory]", + "1976-11[u-ca=hebrew]", + "1976-11[U-CA=iso8601]", + "1976-11[u-CA=iso8601]", + "1976-11[FOO=bar]", ]; }, diff --git a/js/src/tests/test262/built-ins/Array/isArray/name.js b/js/src/tests/test262/built-ins/Array/isArray/name.js index 1b2ebb5e42..22f5c6a23e 100644 --- a/js/src/tests/test262/built-ins/Array/isArray/name.js +++ b/js/src/tests/test262/built-ins/Array/isArray/name.js @@ -20,10 +20,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.isArray.name, "isArray", 'The value of Array.isArray.name is expected to be "isArray"'); - -verifyNotEnumerable(Array.isArray, "name"); -verifyNotWritable(Array.isArray, "name"); -verifyConfigurable(Array.isArray, "name"); +verifyProperty(Array.isArray, "name", { + value: "isArray", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/length.js b/js/src/tests/test262/built-ins/Array/length.js index 16e8c44ec3..f8070579f4 100644 --- a/js/src/tests/test262/built-ins/Array/length.js +++ b/js/src/tests/test262/built-ins/Array/length.js @@ -17,10 +17,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.length, 1, 'The value of Array.length is expected to be 1'); - -verifyNotEnumerable(Array, 'length'); -verifyNotWritable(Array, 'length'); -verifyConfigurable(Array, 'length'); +verifyProperty(Array, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/name.js b/js/src/tests/test262/built-ins/Array/name.js index 621154b510..89a9a6aa89 100644 --- a/js/src/tests/test262/built-ins/Array/name.js +++ b/js/src/tests/test262/built-ins/Array/name.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.name, 'Array', 'The value of Array.name is expected to be "Array"'); - -verifyNotEnumerable(Array, 'name'); -verifyNotWritable(Array, 'name'); -verifyConfigurable(Array, 'name'); +verifyProperty(Array, "name", { + value: "Array", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/of/length.js b/js/src/tests/test262/built-ins/Array/of/length.js index f77c48b768..59de2ff7ef 100644 --- a/js/src/tests/test262/built-ins/Array/of/length.js +++ b/js/src/tests/test262/built-ins/Array/of/length.js @@ -11,13 +11,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Array.of.length, 0, - 'The value of Array.of.length is expected to be 0' -); - -verifyNotEnumerable(Array.of, 'length'); -verifyNotWritable(Array.of, 'length'); -verifyConfigurable(Array.of, 'length'); +verifyProperty(Array.of, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/of/name.js b/js/src/tests/test262/built-ins/Array/of/name.js index 842dd1ad11..39ce92b8e7 100644 --- a/js/src/tests/test262/built-ins/Array/of/name.js +++ b/js/src/tests/test262/built-ins/Array/of/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Array.of.name, 'of', - 'The value of Array.of.name is expected to be "of"' -); - -verifyNotEnumerable(Array.of, 'name'); -verifyNotWritable(Array.of, 'name'); -verifyConfigurable(Array.of, 'name'); +verifyProperty(Array.of, "name", { + value: "of", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/Symbol.iterator/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/Symbol.iterator/not-a-constructor.js index 5d7c96289e..c04cb85e2e 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/Symbol.iterator/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/Symbol.iterator/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype[Symbol.iterator](); -}, '`new Array.prototype[Symbol.iterator]()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/at/length.js b/js/src/tests/test262/built-ins/Array/prototype/at/length.js index 219f329eb4..68fb344a6d 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/at/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/at/length.js @@ -18,13 +18,11 @@ assert.sameValue( 'The value of `typeof Array.prototype.at` is expected to be "function"' ); -assert.sameValue( - Array.prototype.at.length, 1, - 'The value of Array.prototype.at.length is expected to be 1' -); - -verifyNotEnumerable(Array.prototype.at, 'length'); -verifyNotWritable(Array.prototype.at, 'length'); -verifyConfigurable(Array.prototype.at, 'length'); +verifyProperty(Array.prototype.at, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/concat/length.js b/js/src/tests/test262/built-ins/Array/prototype/concat/length.js index 5bff590dfd..7955443cef 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/concat/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/concat/length.js @@ -25,10 +25,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.concat.length, 1, 'The value of Array.prototype.concat.length is expected to be 1'); - -verifyNotEnumerable(Array.prototype.concat, 'length'); -verifyNotWritable(Array.prototype.concat, 'length'); -verifyConfigurable(Array.prototype.concat, 'length'); +verifyProperty(Array.prototype.concat, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/concat/name.js b/js/src/tests/test262/built-ins/Array/prototype/concat/name.js index f81660ad08..bdb54322a0 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/concat/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/concat/name.js @@ -19,14 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Array.prototype.concat.name, - "concat", - 'The value of Array.prototype.concat.name is expected to be "concat"' -); - -verifyNotEnumerable(Array.prototype.concat, "name"); -verifyNotWritable(Array.prototype.concat, "name"); -verifyConfigurable(Array.prototype.concat, "name"); +verifyProperty(Array.prototype.concat, "name", { + value: "concat", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/copyWithin/length.js b/js/src/tests/test262/built-ins/Array/prototype/copyWithin/length.js index e846f74754..606a392fd7 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/copyWithin/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/copyWithin/length.js @@ -10,13 +10,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Array.prototype.copyWithin.length, 2, - 'The value of `Array.prototype.copyWithin.length` is `2`' -); - -verifyNotEnumerable(Array.prototype.copyWithin, 'length'); -verifyNotWritable(Array.prototype.copyWithin, 'length'); -verifyConfigurable(Array.prototype.copyWithin, 'length'); +verifyProperty(Array.prototype.copyWithin, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/copyWithin/name.js b/js/src/tests/test262/built-ins/Array/prototype/copyWithin/name.js index c8c6c0b5b9..75549164b3 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/copyWithin/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/copyWithin/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Array.prototype.copyWithin.name, 'copyWithin', - 'The value of `Array.prototype.copyWithin.name` is `"copyWithin"`' -); - -verifyNotEnumerable(Array.prototype.copyWithin, 'name'); -verifyNotWritable(Array.prototype.copyWithin, 'name'); -verifyConfigurable(Array.prototype.copyWithin, 'name'); +verifyProperty(Array.prototype.copyWithin, "name", { + value: "copyWithin", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/copyWithin/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/copyWithin/not-a-constructor.js index f16770a6c5..6255574819 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/copyWithin/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/copyWithin/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.copyWithin(); -}, '`new Array.prototype.copyWithin()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/entries/length.js b/js/src/tests/test262/built-ins/Array/prototype/entries/length.js index 28f3093b6b..29b8faf091 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/entries/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/entries/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Array.prototype.entries.length, 0, - 'The value of `Array.prototype.entries.length` is `0`' -); - -verifyNotEnumerable(Array.prototype.entries, 'length'); -verifyNotWritable(Array.prototype.entries, 'length'); -verifyConfigurable(Array.prototype.entries, 'length'); +verifyProperty(Array.prototype.entries, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/entries/name.js b/js/src/tests/test262/built-ins/Array/prototype/entries/name.js index db9cd7a5d2..7ab25d6a45 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/entries/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/entries/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Array.prototype.entries.name, 'entries', - 'The value of `Array.prototype.entries.name` is `"entries"`' -); - -verifyNotEnumerable(Array.prototype.entries, 'name'); -verifyNotWritable(Array.prototype.entries, 'name'); -verifyConfigurable(Array.prototype.entries, 'name'); +verifyProperty(Array.prototype.entries, "name", { + value: "entries", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/entries/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/entries/not-a-constructor.js index 7629f5b507..9149fb8153 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/entries/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/entries/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.entries(); -}, '`new Array.prototype.entries()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/every/callbackfn-resize-arraybuffer.js b/js/src/tests/test262/built-ins/Array/prototype/every/callbackfn-resize-arraybuffer.js index a1a4ee5456..7579225ba9 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/every/callbackfn-resize-arraybuffer.js +++ b/js/src/tests/test262/built-ins/Array/prototype/every/callbackfn-resize-arraybuffer.js @@ -1,4 +1,4 @@ -// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options +// |reftest| shell-option(--enable-arraybuffer-resizable) shell-option(--enable-float16array) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options // Copyright (C) 2021 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Array/prototype/every/length.js b/js/src/tests/test262/built-ins/Array/prototype/every/length.js index 65015d9799..cf67099506 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/every/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/every/length.js @@ -11,13 +11,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Array.prototype.every.length, 1, - 'The value of `Array.prototype.every.length` is `1`' -); - -verifyNotEnumerable(Array.prototype.every, 'length'); -verifyNotWritable(Array.prototype.every, 'length'); -verifyConfigurable(Array.prototype.every, 'length'); +verifyProperty(Array.prototype.every, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/every/name.js b/js/src/tests/test262/built-ins/Array/prototype/every/name.js index 5bb10976b6..de095e7480 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/every/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/every/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.every.name, "every"); - -verifyNotEnumerable(Array.prototype.every, "name"); -verifyNotWritable(Array.prototype.every, "name"); -verifyConfigurable(Array.prototype.every, "name"); +verifyProperty(Array.prototype.every, "name", { + value: "every", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/every/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/every/not-a-constructor.js index 54dee55e8b..b817fd312e 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/every/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/every/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.every(() => {}); -}, '`new Array.prototype.every(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/fill/length.js b/js/src/tests/test262/built-ins/Array/prototype/fill/length.js index 1d12345bc0..5a5000c55a 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/fill/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/fill/length.js @@ -8,13 +8,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Array.prototype.fill.length, 1, - 'The value of `Array.prototype.fill.length` is `1`' -); - -verifyNotEnumerable(Array.prototype.fill, 'length'); -verifyNotWritable(Array.prototype.fill, 'length'); -verifyConfigurable(Array.prototype.fill, 'length'); +verifyProperty(Array.prototype.fill, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/fill/name.js b/js/src/tests/test262/built-ins/Array/prototype/fill/name.js index 35d210dec3..e2c7b83e01 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/fill/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/fill/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Array.prototype.fill.name, 'fill', - 'The value of `Array.prototype.fill.name` is `"fill"`' -); - -verifyNotEnumerable(Array.prototype.fill, 'name'); -verifyNotWritable(Array.prototype.fill, 'name'); -verifyConfigurable(Array.prototype.fill, 'name'); +verifyProperty(Array.prototype.fill, "name", { + value: "fill", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/fill/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/fill/not-a-constructor.js index 77d1be633b..9adb186adb 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/fill/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/fill/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Array.prototype.fill), false, 'isConstructor(Arra assert.throws(TypeError, () => { new Array.prototype.fill(); -}, '`new Array.prototype.fill()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/filter/callbackfn-resize-arraybuffer.js b/js/src/tests/test262/built-ins/Array/prototype/filter/callbackfn-resize-arraybuffer.js index ef7612695d..3908cfc93f 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/filter/callbackfn-resize-arraybuffer.js +++ b/js/src/tests/test262/built-ins/Array/prototype/filter/callbackfn-resize-arraybuffer.js @@ -1,4 +1,4 @@ -// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options +// |reftest| shell-option(--enable-arraybuffer-resizable) shell-option(--enable-float16array) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options // Copyright (C) 2021 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Array/prototype/filter/length.js b/js/src/tests/test262/built-ins/Array/prototype/filter/length.js index 06c9cf9762..be88cede23 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/filter/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/filter/length.js @@ -23,10 +23,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.filter.length, 1); - -verifyNotEnumerable(Array.prototype.filter, 'length'); -verifyNotWritable(Array.prototype.filter, 'length'); -verifyConfigurable(Array.prototype.filter, 'length'); +verifyProperty(Array.prototype.filter, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/filter/name.js b/js/src/tests/test262/built-ins/Array/prototype/filter/name.js index 4fbfcefd92..5b4f9754bd 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/filter/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/filter/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.filter.name, "filter"); - -verifyNotEnumerable(Array.prototype.filter, "name"); -verifyNotWritable(Array.prototype.filter, "name"); -verifyConfigurable(Array.prototype.filter, "name"); +verifyProperty(Array.prototype.filter, "name", { + value: "filter", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/filter/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/filter/not-a-constructor.js index f9b011ced5..2853408ae6 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/filter/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/filter/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.filter(() => {}); -}, '`new Array.prototype.filter(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/find/callbackfn-resize-arraybuffer.js b/js/src/tests/test262/built-ins/Array/prototype/find/callbackfn-resize-arraybuffer.js index 31a7b55750..3bf3aa2f52 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/find/callbackfn-resize-arraybuffer.js +++ b/js/src/tests/test262/built-ins/Array/prototype/find/callbackfn-resize-arraybuffer.js @@ -1,4 +1,4 @@ -// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options +// |reftest| shell-option(--enable-arraybuffer-resizable) shell-option(--enable-float16array) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options // Copyright (C) 2021 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Array/prototype/find/length.js b/js/src/tests/test262/built-ins/Array/prototype/find/length.js index 2522319483..a9ca424385 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/find/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/find/length.js @@ -8,13 +8,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Array.prototype.find.length, 1, - 'The value of `Array.prototype.find.length` is `1`' -); - -verifyNotEnumerable(Array.prototype.find, 'length'); -verifyNotWritable(Array.prototype.find, 'length'); -verifyConfigurable(Array.prototype.find, 'length'); +verifyProperty(Array.prototype.find, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/find/name.js b/js/src/tests/test262/built-ins/Array/prototype/find/name.js index 8a4c21fe67..d9ae189ec5 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/find/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/find/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Array.prototype.find.name, 'find', - 'The value of `Array.prototype.find.name` is `"find"`' -); - -verifyNotEnumerable(Array.prototype.find, 'name'); -verifyNotWritable(Array.prototype.find, 'name'); -verifyConfigurable(Array.prototype.find, 'name'); +verifyProperty(Array.prototype.find, "name", { + value: "find", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/find/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/find/not-a-constructor.js index 8e2d17caff..b8921dd067 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/find/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/find/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Array.prototype.find), false, 'isConstructor(Arra assert.throws(TypeError, () => { new Array.prototype.find(() => {}); -}, '`new Array.prototype.find(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/findIndex/callbackfn-resize-arraybuffer.js b/js/src/tests/test262/built-ins/Array/prototype/findIndex/callbackfn-resize-arraybuffer.js index dbd5c88d63..d7ebd5958b 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/findIndex/callbackfn-resize-arraybuffer.js +++ b/js/src/tests/test262/built-ins/Array/prototype/findIndex/callbackfn-resize-arraybuffer.js @@ -1,4 +1,4 @@ -// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options +// |reftest| shell-option(--enable-arraybuffer-resizable) shell-option(--enable-float16array) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options // Copyright (C) 2021 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Array/prototype/findIndex/length.js b/js/src/tests/test262/built-ins/Array/prototype/findIndex/length.js index dafeb333b1..44f8e31895 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/findIndex/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/findIndex/length.js @@ -8,13 +8,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Array.prototype.findIndex.length, 1, - 'The value of `Array.prototype.findIndex.length` is `1`' -); - -verifyNotEnumerable(Array.prototype.findIndex, 'length'); -verifyNotWritable(Array.prototype.findIndex, 'length'); -verifyConfigurable(Array.prototype.findIndex, 'length'); +verifyProperty(Array.prototype.findIndex, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/findIndex/name.js b/js/src/tests/test262/built-ins/Array/prototype/findIndex/name.js index ad6b6d5a28..564448f064 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/findIndex/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/findIndex/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Array.prototype.findIndex.name, 'findIndex', - 'The value of `Array.prototype.findIndex.name` is `"findIndex"`' -); - -verifyNotEnumerable(Array.prototype.findIndex, 'name'); -verifyNotWritable(Array.prototype.findIndex, 'name'); -verifyConfigurable(Array.prototype.findIndex, 'name'); +verifyProperty(Array.prototype.findIndex, "name", { + value: "findIndex", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/findIndex/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/findIndex/not-a-constructor.js index ce4d52002d..b85edccbe6 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/findIndex/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/findIndex/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.findIndex(() => {}); -}, '`new Array.prototype.findIndex(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/findLast/callbackfn-resize-arraybuffer.js b/js/src/tests/test262/built-ins/Array/prototype/findLast/callbackfn-resize-arraybuffer.js index 1f029bde80..6761bd57cd 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/findLast/callbackfn-resize-arraybuffer.js +++ b/js/src/tests/test262/built-ins/Array/prototype/findLast/callbackfn-resize-arraybuffer.js @@ -1,4 +1,4 @@ -// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options +// |reftest| shell-option(--enable-arraybuffer-resizable) shell-option(--enable-float16array) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options // Copyright (C) 2021 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Array/prototype/findLast/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/findLast/not-a-constructor.js index 9b2316f054..7bb9592536 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/findLast/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/findLast/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Array.prototype.findLast), false, 'isConstructor( assert.throws(TypeError, () => { new Array.prototype.findLast(() => {}); -}, '`new Array.prototype.findLast(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/findLastIndex/callbackfn-resize-arraybuffer.js b/js/src/tests/test262/built-ins/Array/prototype/findLastIndex/callbackfn-resize-arraybuffer.js index 3d90fa7f17..50f8c9cc33 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/findLastIndex/callbackfn-resize-arraybuffer.js +++ b/js/src/tests/test262/built-ins/Array/prototype/findLastIndex/callbackfn-resize-arraybuffer.js @@ -1,4 +1,4 @@ -// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options +// |reftest| shell-option(--enable-arraybuffer-resizable) shell-option(--enable-float16array) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options // Copyright (C) 2021 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Array/prototype/findLastIndex/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/findLastIndex/not-a-constructor.js index 8c6000eea2..9155f03cab 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/findLastIndex/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/findLastIndex/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.findLastIndex(() => {}); -}, '`new Array.prototype.findLastIndex(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/flat/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/flat/not-a-constructor.js index 5f9c2c1401..e712f86ec9 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/flat/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/flat/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Array.prototype.flat), false, 'isConstructor(Arra assert.throws(TypeError, () => { new Array.prototype.flat(); -}, '`new Array.prototype.flat()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/flatMap/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/flatMap/not-a-constructor.js index 8facbadc1c..41480d610d 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/flatMap/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/flatMap/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.flatMap(() => {}); -}, '`new Array.prototype.flatMap(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/forEach/callbackfn-resize-arraybuffer.js b/js/src/tests/test262/built-ins/Array/prototype/forEach/callbackfn-resize-arraybuffer.js index 402b9a7007..829d744e4d 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/forEach/callbackfn-resize-arraybuffer.js +++ b/js/src/tests/test262/built-ins/Array/prototype/forEach/callbackfn-resize-arraybuffer.js @@ -1,4 +1,4 @@ -// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options +// |reftest| shell-option(--enable-arraybuffer-resizable) shell-option(--enable-float16array) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options // Copyright (C) 2021 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Array/prototype/forEach/length.js b/js/src/tests/test262/built-ins/Array/prototype/forEach/length.js index 8ca4a6185e..d9b2541122 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/forEach/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/forEach/length.js @@ -23,10 +23,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.forEach.length, 1); - -verifyNotEnumerable(Array.prototype.forEach, 'length'); -verifyNotWritable(Array.prototype.forEach, 'length'); -verifyConfigurable(Array.prototype.forEach, 'length'); +verifyProperty(Array.prototype.forEach, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/forEach/name.js b/js/src/tests/test262/built-ins/Array/prototype/forEach/name.js index 08beb915e8..8c70987d9f 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/forEach/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/forEach/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.forEach.name, "forEach"); - -verifyNotEnumerable(Array.prototype.forEach, "name"); -verifyNotWritable(Array.prototype.forEach, "name"); -verifyConfigurable(Array.prototype.forEach, "name"); +verifyProperty(Array.prototype.forEach, "name", { + value: "forEach", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/forEach/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/forEach/not-a-constructor.js index 9662abaf98..a69333b135 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/forEach/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/forEach/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.forEach(() => {}); -}, '`new Array.prototype.forEach(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/includes/length.js b/js/src/tests/test262/built-ins/Array/prototype/includes/length.js index e437df4d3c..af15396fab 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/includes/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/includes/length.js @@ -23,10 +23,11 @@ includes: [propertyHelper.js] features: [Array.prototype.includes] ---*/ -assert.sameValue(Array.prototype.includes.length, 1); - -verifyNotEnumerable(Array.prototype.includes, "length"); -verifyNotWritable(Array.prototype.includes, "length"); -verifyConfigurable(Array.prototype.includes, "length"); +verifyProperty(Array.prototype.includes, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/includes/name.js b/js/src/tests/test262/built-ins/Array/prototype/includes/name.js index c97a1fed91..e594108e11 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/includes/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/includes/name.js @@ -20,10 +20,11 @@ includes: [propertyHelper.js] features: [Array.prototype.includes] ---*/ -assert.sameValue(Array.prototype.includes.name, "includes"); - -verifyNotEnumerable(Array.prototype.includes, "name"); -verifyNotWritable(Array.prototype.includes, "name"); -verifyConfigurable(Array.prototype.includes, "name"); +verifyProperty(Array.prototype.includes, "name", { + value: "includes", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/includes/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/includes/not-a-constructor.js index 0d673a9c31..937168e3e7 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/includes/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/includes/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.includes(1); -}, '`new Array.prototype.includes(1)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/indexOf/length.js b/js/src/tests/test262/built-ins/Array/prototype/indexOf/length.js index 36a44e19dc..b6d399a6be 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/indexOf/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/indexOf/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.indexOf.length, 1); - -verifyNotEnumerable(Array.prototype.indexOf, 'length'); -verifyNotWritable(Array.prototype.indexOf, 'length'); -verifyConfigurable(Array.prototype.indexOf, 'length'); +verifyProperty(Array.prototype.indexOf, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/indexOf/name.js b/js/src/tests/test262/built-ins/Array/prototype/indexOf/name.js index 5017f4381c..9d748ece9c 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/indexOf/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/indexOf/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.indexOf.name, "indexOf"); - -verifyNotEnumerable(Array.prototype.indexOf, "name"); -verifyNotWritable(Array.prototype.indexOf, "name"); -verifyConfigurable(Array.prototype.indexOf, "name"); +verifyProperty(Array.prototype.indexOf, "name", { + value: "indexOf", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/indexOf/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/indexOf/not-a-constructor.js index d297029668..f094f6b1c0 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/indexOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/indexOf/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.indexOf(); -}, '`new Array.prototype.indexOf()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/join/length.js b/js/src/tests/test262/built-ins/Array/prototype/join/length.js index bdef13a59f..f5c31044d1 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/join/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/join/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.join.length, 1); - -verifyNotEnumerable(Array.prototype.join, 'length'); -verifyNotWritable(Array.prototype.join, 'length'); -verifyConfigurable(Array.prototype.join, 'length'); +verifyProperty(Array.prototype.join, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/join/name.js b/js/src/tests/test262/built-ins/Array/prototype/join/name.js index 3af90e214e..536c306f82 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/join/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/join/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.join.name, "join"); - -verifyNotEnumerable(Array.prototype.join, "name"); -verifyNotWritable(Array.prototype.join, "name"); -verifyConfigurable(Array.prototype.join, "name"); +verifyProperty(Array.prototype.join, "name", { + value: "join", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/join/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/join/not-a-constructor.js index e92cd56335..f0953d9206 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/join/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/join/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Array.prototype.join), false, 'isConstructor(Arra assert.throws(TypeError, () => { new Array.prototype.join(); -}, '`new Array.prototype.join()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/keys/length.js b/js/src/tests/test262/built-ins/Array/prototype/keys/length.js index 6d997e5972..160dea0a2d 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/keys/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/keys/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Array.prototype.keys.length, 0, - 'The value of `Array.prototype.keys.length` is `0`' -); - -verifyNotEnumerable(Array.prototype.keys, 'length'); -verifyNotWritable(Array.prototype.keys, 'length'); -verifyConfigurable(Array.prototype.keys, 'length'); +verifyProperty(Array.prototype.keys, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/keys/name.js b/js/src/tests/test262/built-ins/Array/prototype/keys/name.js index 11ea5c508f..c20e6a2b6f 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/keys/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/keys/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Array.prototype.keys.name, 'keys', - 'The value of `Array.prototype.keys.name` is `"keys"`' -); - -verifyNotEnumerable(Array.prototype.keys, 'name'); -verifyNotWritable(Array.prototype.keys, 'name'); -verifyConfigurable(Array.prototype.keys, 'name'); +verifyProperty(Array.prototype.keys, "name", { + value: "keys", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/keys/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/keys/not-a-constructor.js index 8d0b5db966..4207eebb9b 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/keys/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/keys/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Array.prototype.keys), false, 'isConstructor(Arra assert.throws(TypeError, () => { new Array.prototype.keys(); -}, '`new Array.prototype.keys()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/lastIndexOf/length.js b/js/src/tests/test262/built-ins/Array/prototype/lastIndexOf/length.js index 56b0fd7f8b..71ba258f1b 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/lastIndexOf/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/lastIndexOf/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.lastIndexOf.length, 1); - -verifyNotEnumerable(Array.prototype.lastIndexOf, 'length'); -verifyNotWritable(Array.prototype.lastIndexOf, 'length'); -verifyConfigurable(Array.prototype.lastIndexOf, 'length'); +verifyProperty(Array.prototype.lastIndexOf, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/lastIndexOf/name.js b/js/src/tests/test262/built-ins/Array/prototype/lastIndexOf/name.js index 1ab52079e3..d2990a8553 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/lastIndexOf/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/lastIndexOf/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.lastIndexOf.name, "lastIndexOf"); - -verifyNotEnumerable(Array.prototype.lastIndexOf, "name"); -verifyNotWritable(Array.prototype.lastIndexOf, "name"); -verifyConfigurable(Array.prototype.lastIndexOf, "name"); +verifyProperty(Array.prototype.lastIndexOf, "name", { + value: "lastIndexOf", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/lastIndexOf/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/lastIndexOf/not-a-constructor.js index e3d126b8f9..076d85fcc9 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/lastIndexOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/lastIndexOf/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.lastIndexOf(); -}, '`new Array.prototype.lastIndexOf()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/map/callbackfn-resize-arraybuffer.js b/js/src/tests/test262/built-ins/Array/prototype/map/callbackfn-resize-arraybuffer.js index ec8caa847e..5496a2090a 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/map/callbackfn-resize-arraybuffer.js +++ b/js/src/tests/test262/built-ins/Array/prototype/map/callbackfn-resize-arraybuffer.js @@ -1,4 +1,4 @@ -// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options +// |reftest| shell-option(--enable-arraybuffer-resizable) shell-option(--enable-float16array) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options // Copyright (C) 2021 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Array/prototype/map/length.js b/js/src/tests/test262/built-ins/Array/prototype/map/length.js index f0402be9c5..9eacb86642 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/map/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/map/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.map.length, 1); - -verifyNotEnumerable(Array.prototype.map, 'length'); -verifyNotWritable(Array.prototype.map, 'length'); -verifyConfigurable(Array.prototype.map, 'length'); +verifyProperty(Array.prototype.map, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/map/name.js b/js/src/tests/test262/built-ins/Array/prototype/map/name.js index 75a94bbb83..c18af83c3f 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/map/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/map/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.map.name, "map"); - -verifyNotEnumerable(Array.prototype.map, "name"); -verifyNotWritable(Array.prototype.map, "name"); -verifyConfigurable(Array.prototype.map, "name"); +verifyProperty(Array.prototype.map, "name", { + value: "map", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/map/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/map/not-a-constructor.js index 98945bd366..8c54276eea 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/map/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/map/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Array.prototype.map), false, 'isConstructor(Array assert.throws(TypeError, () => { new Array.prototype.map(() => {}); -}, '`new Array.prototype.map(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/pop/length.js b/js/src/tests/test262/built-ins/Array/prototype/pop/length.js index 6285c752f0..2f0ec4f16e 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/pop/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/pop/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.pop.length, 0); - -verifyNotEnumerable(Array.prototype.pop, 'length'); -verifyNotWritable(Array.prototype.pop, 'length'); -verifyConfigurable(Array.prototype.pop, 'length'); +verifyProperty(Array.prototype.pop, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/pop/name.js b/js/src/tests/test262/built-ins/Array/prototype/pop/name.js index 891fb91858..19b678268a 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/pop/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/pop/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.pop.name, "pop"); - -verifyNotEnumerable(Array.prototype.pop, "name"); -verifyNotWritable(Array.prototype.pop, "name"); -verifyConfigurable(Array.prototype.pop, "name"); +verifyProperty(Array.prototype.pop, "name", { + value: "pop", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/pop/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/pop/not-a-constructor.js index 849c2b3305..ac67502c7e 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/pop/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/pop/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Array.prototype.pop), false, 'isConstructor(Array assert.throws(TypeError, () => { new Array.prototype.pop(); -}, '`new Array.prototype.pop()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/push/length.js b/js/src/tests/test262/built-ins/Array/prototype/push/length.js index d503ab3cfa..4df58993dd 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/push/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/push/length.js @@ -25,10 +25,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.push.length, 1); - -verifyNotEnumerable(Array.prototype.push, 'length'); -verifyNotWritable(Array.prototype.push, 'length'); -verifyConfigurable(Array.prototype.push, 'length'); +verifyProperty(Array.prototype.push, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/push/name.js b/js/src/tests/test262/built-ins/Array/prototype/push/name.js index 42e2e96314..1590bdf48b 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/push/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/push/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.push.name, "push"); - -verifyNotEnumerable(Array.prototype.push, "name"); -verifyNotWritable(Array.prototype.push, "name"); -verifyConfigurable(Array.prototype.push, "name"); +verifyProperty(Array.prototype.push, "name", { + value: "push", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/push/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/push/not-a-constructor.js index 291b72867d..f709507f93 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/push/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/push/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Array.prototype.push), false, 'isConstructor(Arra assert.throws(TypeError, () => { new Array.prototype.push(); -}, '`new Array.prototype.push()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/reduce/callbackfn-resize-arraybuffer.js b/js/src/tests/test262/built-ins/Array/prototype/reduce/callbackfn-resize-arraybuffer.js index 7196680bec..cead90d05f 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/reduce/callbackfn-resize-arraybuffer.js +++ b/js/src/tests/test262/built-ins/Array/prototype/reduce/callbackfn-resize-arraybuffer.js @@ -1,4 +1,4 @@ -// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options +// |reftest| shell-option(--enable-arraybuffer-resizable) shell-option(--enable-float16array) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options // Copyright (C) 2021 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Array/prototype/reduce/length.js b/js/src/tests/test262/built-ins/Array/prototype/reduce/length.js index 46705546bd..4ed6ddc04a 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/reduce/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/reduce/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.reduce.length, 1); - -verifyNotEnumerable(Array.prototype.reduce, 'length'); -verifyNotWritable(Array.prototype.reduce, 'length'); -verifyConfigurable(Array.prototype.reduce, 'length'); +verifyProperty(Array.prototype.reduce, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/reduce/name.js b/js/src/tests/test262/built-ins/Array/prototype/reduce/name.js index 0b368568bd..83b9a265e8 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/reduce/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/reduce/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.reduce.name, "reduce"); - -verifyNotEnumerable(Array.prototype.reduce, "name"); -verifyNotWritable(Array.prototype.reduce, "name"); -verifyConfigurable(Array.prototype.reduce, "name"); +verifyProperty(Array.prototype.reduce, "name", { + value: "reduce", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/reduce/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/reduce/not-a-constructor.js index 66a7e1f277..719facd021 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/reduce/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/reduce/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.reduce(() => {}, []); -}, '`new Array.prototype.reduce(() => {}, [])` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/reduceRight/callbackfn-resize-arraybuffer.js b/js/src/tests/test262/built-ins/Array/prototype/reduceRight/callbackfn-resize-arraybuffer.js index 8704bccee9..bf2ee11cc8 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/reduceRight/callbackfn-resize-arraybuffer.js +++ b/js/src/tests/test262/built-ins/Array/prototype/reduceRight/callbackfn-resize-arraybuffer.js @@ -1,4 +1,4 @@ -// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options +// |reftest| shell-option(--enable-arraybuffer-resizable) shell-option(--enable-float16array) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options // Copyright (C) 2021 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Array/prototype/reduceRight/length.js b/js/src/tests/test262/built-ins/Array/prototype/reduceRight/length.js index 4f02036c8d..9a2e44850c 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/reduceRight/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/reduceRight/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.reduceRight.length, 1); - -verifyNotEnumerable(Array.prototype.reduceRight, 'length'); -verifyNotWritable(Array.prototype.reduceRight, 'length'); -verifyConfigurable(Array.prototype.reduceRight, 'length'); +verifyProperty(Array.prototype.reduceRight, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/reduceRight/name.js b/js/src/tests/test262/built-ins/Array/prototype/reduceRight/name.js index c3e90f6957..b4a4060073 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/reduceRight/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/reduceRight/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.reduceRight.name, "reduceRight"); - -verifyNotEnumerable(Array.prototype.reduceRight, "name"); -verifyNotWritable(Array.prototype.reduceRight, "name"); -verifyConfigurable(Array.prototype.reduceRight, "name"); +verifyProperty(Array.prototype.reduceRight, "name", { + value: "reduceRight", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/reduceRight/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/reduceRight/not-a-constructor.js index 77e7e825b3..b42a04f7fc 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/reduceRight/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/reduceRight/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.reduceRight(() => {}, []); -}, '`new Array.prototype.reduceRight(() => {}, [])` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/reverse/length.js b/js/src/tests/test262/built-ins/Array/prototype/reverse/length.js index fb5562c43d..f55bae44fe 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/reverse/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/reverse/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.reverse.length, 0); - -verifyNotEnumerable(Array.prototype.reverse, 'length'); -verifyNotWritable(Array.prototype.reverse, 'length'); -verifyConfigurable(Array.prototype.reverse, 'length'); +verifyProperty(Array.prototype.reverse, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/reverse/name.js b/js/src/tests/test262/built-ins/Array/prototype/reverse/name.js index 450398c5d7..a964c72a4f 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/reverse/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/reverse/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.reverse.name, "reverse"); - -verifyNotEnumerable(Array.prototype.reverse, "name"); -verifyNotWritable(Array.prototype.reverse, "name"); -verifyConfigurable(Array.prototype.reverse, "name"); +verifyProperty(Array.prototype.reverse, "name", { + value: "reverse", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/reverse/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/reverse/not-a-constructor.js index 693a459165..2f25d7a324 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/reverse/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/reverse/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.reverse(); -}, '`new Array.prototype.reverse()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/shift/length.js b/js/src/tests/test262/built-ins/Array/prototype/shift/length.js index 08932c056d..447527ea3b 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/shift/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/shift/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.shift.length, 0); - -verifyNotEnumerable(Array.prototype.shift, 'length'); -verifyNotWritable(Array.prototype.shift, 'length'); -verifyConfigurable(Array.prototype.shift, 'length'); +verifyProperty(Array.prototype.shift, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/shift/name.js b/js/src/tests/test262/built-ins/Array/prototype/shift/name.js index a64cdab03f..0091e7e2cc 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/shift/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/shift/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.shift.name, "shift"); - -verifyNotEnumerable(Array.prototype.shift, "name"); -verifyNotWritable(Array.prototype.shift, "name"); -verifyConfigurable(Array.prototype.shift, "name"); +verifyProperty(Array.prototype.shift, "name", { + value: "shift", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/shift/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/shift/not-a-constructor.js index b58cbbb0fa..160d30240b 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/shift/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/shift/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.shift(); -}, '`new Array.prototype.shift()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/slice/length.js b/js/src/tests/test262/built-ins/Array/prototype/slice/length.js index 2d0204600c..21d3dcae6f 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/slice/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/slice/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.slice.length, 2); - -verifyNotEnumerable(Array.prototype.slice, 'length'); -verifyNotWritable(Array.prototype.slice, 'length'); -verifyConfigurable(Array.prototype.slice, 'length'); +verifyProperty(Array.prototype.slice, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/slice/name.js b/js/src/tests/test262/built-ins/Array/prototype/slice/name.js index b870be1e66..6a37b962e5 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/slice/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/slice/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.slice.name, "slice"); - -verifyNotEnumerable(Array.prototype.slice, "name"); -verifyNotWritable(Array.prototype.slice, "name"); -verifyConfigurable(Array.prototype.slice, "name"); +verifyProperty(Array.prototype.slice, "name", { + value: "slice", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/slice/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/slice/not-a-constructor.js index 3504fae508..08d6eb8820 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/slice/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/slice/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.slice(); -}, '`new Array.prototype.slice()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/some/callbackfn-resize-arraybuffer.js b/js/src/tests/test262/built-ins/Array/prototype/some/callbackfn-resize-arraybuffer.js index 0f42d15717..009ee20914 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/some/callbackfn-resize-arraybuffer.js +++ b/js/src/tests/test262/built-ins/Array/prototype/some/callbackfn-resize-arraybuffer.js @@ -1,4 +1,4 @@ -// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options +// |reftest| shell-option(--enable-arraybuffer-resizable) shell-option(--enable-float16array) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options // Copyright (C) 2021 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/Array/prototype/some/length.js b/js/src/tests/test262/built-ins/Array/prototype/some/length.js index 4afccd4124..91e160e62e 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/some/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/some/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.some.length, 1); - -verifyNotEnumerable(Array.prototype.some, 'length'); -verifyNotWritable(Array.prototype.some, 'length'); -verifyConfigurable(Array.prototype.some, 'length'); +verifyProperty(Array.prototype.some, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/some/name.js b/js/src/tests/test262/built-ins/Array/prototype/some/name.js index 3ccefd3f61..1c6748df51 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/some/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/some/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.some.name, "some"); - -verifyNotEnumerable(Array.prototype.some, "name"); -verifyNotWritable(Array.prototype.some, "name"); -verifyConfigurable(Array.prototype.some, "name"); +verifyProperty(Array.prototype.some, "name", { + value: "some", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/some/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/some/not-a-constructor.js index cff54f8d96..ea2d642790 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/some/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/some/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Array.prototype.some), false, 'isConstructor(Arra assert.throws(TypeError, () => { new Array.prototype.some(() => {}); -}, '`new Array.prototype.some(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/sort/length.js b/js/src/tests/test262/built-ins/Array/prototype/sort/length.js index 67a6be2969..2c386f8955 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/sort/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/sort/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.sort.length, 1); - -verifyNotEnumerable(Array.prototype.sort, 'length'); -verifyNotWritable(Array.prototype.sort, 'length'); -verifyConfigurable(Array.prototype.sort, 'length'); +verifyProperty(Array.prototype.sort, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/sort/name.js b/js/src/tests/test262/built-ins/Array/prototype/sort/name.js index 5ec58a1bb8..631cdd1816 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/sort/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/sort/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.sort.name, "sort"); - -verifyNotEnumerable(Array.prototype.sort, "name"); -verifyNotWritable(Array.prototype.sort, "name"); -verifyConfigurable(Array.prototype.sort, "name"); +verifyProperty(Array.prototype.sort, "name", { + value: "sort", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/sort/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/sort/not-a-constructor.js index e9dd5a40d3..b5cf5325a8 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/sort/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/sort/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Array.prototype.sort), false, 'isConstructor(Arra assert.throws(TypeError, () => { new Array.prototype.sort(); -}, '`new Array.prototype.sort()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/splice/length.js b/js/src/tests/test262/built-ins/Array/prototype/splice/length.js index d701b42ae5..051503da45 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/splice/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/splice/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.splice.length, 2); - -verifyNotEnumerable(Array.prototype.splice, 'length'); -verifyNotWritable(Array.prototype.splice, 'length'); -verifyConfigurable(Array.prototype.splice, 'length'); +verifyProperty(Array.prototype.splice, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/splice/name.js b/js/src/tests/test262/built-ins/Array/prototype/splice/name.js index a0107f69c4..4255958303 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/splice/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/splice/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.splice.name, "splice"); - -verifyNotEnumerable(Array.prototype.splice, "name"); -verifyNotWritable(Array.prototype.splice, "name"); -verifyConfigurable(Array.prototype.splice, "name"); +verifyProperty(Array.prototype.splice, "name", { + value: "splice", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/splice/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/splice/not-a-constructor.js index 674f869d3a..a19d07703c 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/splice/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/splice/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.splice(); -}, '`new Array.prototype.splice()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/toLocaleString/length.js b/js/src/tests/test262/built-ins/Array/prototype/toLocaleString/length.js index bc24898e1e..03232222e7 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/toLocaleString/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/toLocaleString/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.toLocaleString.length, 0); - -verifyNotEnumerable(Array.prototype.toLocaleString, 'length'); -verifyNotWritable(Array.prototype.toLocaleString, 'length'); -verifyConfigurable(Array.prototype.toLocaleString, 'length'); +verifyProperty(Array.prototype.toLocaleString, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/toLocaleString/name.js b/js/src/tests/test262/built-ins/Array/prototype/toLocaleString/name.js index 54f2c57bcb..418664ead2 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/toLocaleString/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/toLocaleString/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.toLocaleString.name, "toLocaleString"); - -verifyNotEnumerable(Array.prototype.toLocaleString, "name"); -verifyNotWritable(Array.prototype.toLocaleString, "name"); -verifyConfigurable(Array.prototype.toLocaleString, "name"); +verifyProperty(Array.prototype.toLocaleString, "name", { + value: "toLocaleString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/toLocaleString/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/toLocaleString/not-a-constructor.js index def6d25864..b040fae76f 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/toLocaleString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/toLocaleString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.toLocaleString(); -}, '`new Array.prototype.toLocaleString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/toReversed/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/toReversed/not-a-constructor.js index 6e848442c9..3b32ac58e3 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/toReversed/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/toReversed/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.toReversed(); -}, '`new Array.prototype.toReversed()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/toReversed/this-value-nullish.js b/js/src/tests/test262/built-ins/Array/prototype/toReversed/this-value-nullish.js index 682b28addf..1ebdb006c3 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/toReversed/this-value-nullish.js +++ b/js/src/tests/test262/built-ins/Array/prototype/toReversed/this-value-nullish.js @@ -15,10 +15,10 @@ features: [change-array-by-copy] assert.throws(TypeError, () => { Array.prototype.toReversed.call(null); -}, '`Array.prototype.toReversed.call(null)` throws TypeError'); +}); assert.throws(TypeError, () => { Array.prototype.toReversed.call(undefined); -}, '`Array.prototype.toReversed.call(undefined)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/toSorted/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/toSorted/not-a-constructor.js index dda671c3ee..bd2a05683d 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/toSorted/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/toSorted/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.toSorted(); -}, '`new Array.prototype.toSorted()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/toSorted/this-value-nullish.js b/js/src/tests/test262/built-ins/Array/prototype/toSorted/this-value-nullish.js index 65690075df..20f9664dfa 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/toSorted/this-value-nullish.js +++ b/js/src/tests/test262/built-ins/Array/prototype/toSorted/this-value-nullish.js @@ -15,10 +15,10 @@ features: [change-array-by-copy] assert.throws(TypeError, () => { Array.prototype.toSorted.call(null); -}, '`Array.prototype.toSorted.call(null)` throws TypeError'); +}); assert.throws(TypeError, () => { Array.prototype.toSorted.call(undefined); -}, '`Array.prototype.toSorted.call(undefined)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/toSpliced/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/toSpliced/not-a-constructor.js index 533e8c9eaa..34b5f34f00 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/toSpliced/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/toSpliced/not-a-constructor.js @@ -29,6 +29,6 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.toSpliced(); -}, '`new Array.prototype.toSpliced()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/toString/length.js b/js/src/tests/test262/built-ins/Array/prototype/toString/length.js index d9f0df584e..7b73cc2f87 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/toString/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/toString/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.toString.length, 0); - -verifyNotEnumerable(Array.prototype.toString, "length"); -verifyNotWritable(Array.prototype.toString, "length"); -verifyConfigurable(Array.prototype.toString, "length"); +verifyProperty(Array.prototype.toString, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/toString/name.js b/js/src/tests/test262/built-ins/Array/prototype/toString/name.js index d3fc9528d9..2bd19a5f84 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/toString/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/toString/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.toString.name, "toString"); - -verifyNotEnumerable(Array.prototype.toString, "name"); -verifyNotWritable(Array.prototype.toString, "name"); -verifyConfigurable(Array.prototype.toString, "name"); +verifyProperty(Array.prototype.toString, "name", { + value: "toString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/toString/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/toString/not-a-constructor.js index a70534ffd1..630f0301fa 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/toString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/toString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.toString(); -}, '`new Array.prototype.toString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/unshift/length.js b/js/src/tests/test262/built-ins/Array/prototype/unshift/length.js index e99bffa6d8..5538fb52aa 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/unshift/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/unshift/length.js @@ -25,10 +25,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.unshift.length, 1); - -verifyNotEnumerable(Array.prototype.unshift, 'length'); -verifyNotWritable(Array.prototype.unshift, 'length'); -verifyConfigurable(Array.prototype.unshift, 'length'); +verifyProperty(Array.prototype.unshift, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/unshift/name.js b/js/src/tests/test262/built-ins/Array/prototype/unshift/name.js index 4caa8c29b4..320911e6fe 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/unshift/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/unshift/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.unshift.name, "unshift"); - -verifyNotEnumerable(Array.prototype.unshift, "name"); -verifyNotWritable(Array.prototype.unshift, "name"); -verifyConfigurable(Array.prototype.unshift, "name"); +verifyProperty(Array.prototype.unshift, "name", { + value: "unshift", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/unshift/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/unshift/not-a-constructor.js index 415a6e738d..2f308932d8 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/unshift/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/unshift/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.unshift(); -}, '`new Array.prototype.unshift()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/values/length.js b/js/src/tests/test262/built-ins/Array/prototype/values/length.js index c87379d29f..850153c7a7 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/values/length.js +++ b/js/src/tests/test262/built-ins/Array/prototype/values/length.js @@ -18,10 +18,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.values.length, 0); - -verifyNotEnumerable(Array.prototype.values, 'length'); -verifyNotWritable(Array.prototype.values, 'length'); -verifyConfigurable(Array.prototype.values, 'length'); +verifyProperty(Array.prototype.values, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/values/name.js b/js/src/tests/test262/built-ins/Array/prototype/values/name.js index 71eb0fb243..0c311c38e7 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/values/name.js +++ b/js/src/tests/test262/built-ins/Array/prototype/values/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Array.prototype.values.name, 'values'); - -verifyNotEnumerable(Array.prototype.values, 'name'); -verifyNotWritable(Array.prototype.values, 'name'); -verifyConfigurable(Array.prototype.values, 'name'); +verifyProperty(Array.prototype.values, "name", { + value: "values", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/values/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/values/not-a-constructor.js index 2afdde1e37..3ef19e5a4e 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/values/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/values/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.values(); -}, '`new Array.prototype.values()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/with/not-a-constructor.js b/js/src/tests/test262/built-ins/Array/prototype/with/not-a-constructor.js index 257a21aa51..4d0e060ee4 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/with/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Array/prototype/with/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Array.prototype.with(); -}, '`new Array.prototype.with()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/with/this-value-nullish.js b/js/src/tests/test262/built-ins/Array/prototype/with/this-value-nullish.js index befef0642d..64f029d55e 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/with/this-value-nullish.js +++ b/js/src/tests/test262/built-ins/Array/prototype/with/this-value-nullish.js @@ -15,10 +15,10 @@ features: [change-array-by-copy] assert.throws(TypeError, () => { Array.prototype.with.call(null, 0, 0); -}, '`Array.prototype.with.call(null, 0, 0)` throws TypeError'); +}); assert.throws(TypeError, () => { Array.prototype.with.call(undefined, 0, 0); -}, '`Array.prototype.with.call(undefined, 0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/length.js b/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/length.js index 3d44fa0cae..1ce2f30b45 100644 --- a/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/length.js +++ b/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/length.js @@ -25,10 +25,11 @@ features: [Symbol.species] var desc = Object.getOwnPropertyDescriptor(ArrayBuffer, Symbol.species); -assert.sameValue(desc.get.length, 0); - -verifyNotEnumerable(desc.get, "length"); -verifyNotWritable(desc.get, "length"); -verifyConfigurable(desc.get, "length"); +verifyProperty(desc.get, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/symbol-species-name.js b/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/symbol-species-name.js index 2d9d0eb3e8..a5ae191321 100644 --- a/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/symbol-species-name.js +++ b/js/src/tests/test262/built-ins/ArrayBuffer/Symbol.species/symbol-species-name.js @@ -15,13 +15,11 @@ includes: [propertyHelper.js] var descriptor = Object.getOwnPropertyDescriptor(ArrayBuffer, Symbol.species); -assert.sameValue( - descriptor.get.name, - 'get [Symbol.species]' -); - -verifyNotEnumerable(descriptor.get, 'name'); -verifyNotWritable(descriptor.get, 'name'); -verifyConfigurable(descriptor.get, 'name'); +verifyProperty(descriptor.get, "name", { + value: "get [Symbol.species]", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/isView/arg-is-typedarray-buffer.js b/js/src/tests/test262/built-ins/ArrayBuffer/isView/arg-is-typedarray-buffer.js index 9e8918b388..c3d06668f0 100644 --- a/js/src/tests/test262/built-ins/ArrayBuffer/isView/arg-is-typedarray-buffer.js +++ b/js/src/tests/test262/built-ins/ArrayBuffer/isView/arg-is-typedarray-buffer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 The V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/isView/arg-is-typedarray-constructor.js b/js/src/tests/test262/built-ins/ArrayBuffer/isView/arg-is-typedarray-constructor.js index efd5d16984..feee8c989c 100644 --- a/js/src/tests/test262/built-ins/ArrayBuffer/isView/arg-is-typedarray-constructor.js +++ b/js/src/tests/test262/built-ins/ArrayBuffer/isView/arg-is-typedarray-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 The V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/isView/arg-is-typedarray-subclass-instance.js b/js/src/tests/test262/built-ins/ArrayBuffer/isView/arg-is-typedarray-subclass-instance.js index 3d17140d0f..b43ea03666 100644 --- a/js/src/tests/test262/built-ins/ArrayBuffer/isView/arg-is-typedarray-subclass-instance.js +++ b/js/src/tests/test262/built-ins/ArrayBuffer/isView/arg-is-typedarray-subclass-instance.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 The V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/isView/arg-is-typedarray.js b/js/src/tests/test262/built-ins/ArrayBuffer/isView/arg-is-typedarray.js index 78cbfbbf61..91c4c3330b 100644 --- a/js/src/tests/test262/built-ins/ArrayBuffer/isView/arg-is-typedarray.js +++ b/js/src/tests/test262/built-ins/ArrayBuffer/isView/arg-is-typedarray.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 The V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/isView/invoked-as-a-fn.js b/js/src/tests/test262/built-ins/ArrayBuffer/isView/invoked-as-a-fn.js index e58a330cdb..779ab1542a 100644 --- a/js/src/tests/test262/built-ins/ArrayBuffer/isView/invoked-as-a-fn.js +++ b/js/src/tests/test262/built-ins/ArrayBuffer/isView/invoked-as-a-fn.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 The V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/isView/length.js b/js/src/tests/test262/built-ins/ArrayBuffer/isView/length.js index d74f5ab42d..560f2060f8 100644 --- a/js/src/tests/test262/built-ins/ArrayBuffer/isView/length.js +++ b/js/src/tests/test262/built-ins/ArrayBuffer/isView/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(ArrayBuffer.isView.length, 1); - -verifyNotEnumerable(ArrayBuffer.isView, "length"); -verifyNotWritable(ArrayBuffer.isView, "length"); -verifyConfigurable(ArrayBuffer.isView, "length"); +verifyProperty(ArrayBuffer.isView, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/isView/name.js b/js/src/tests/test262/built-ins/ArrayBuffer/isView/name.js index e8ef8b04e5..aeecc5dbad 100644 --- a/js/src/tests/test262/built-ins/ArrayBuffer/isView/name.js +++ b/js/src/tests/test262/built-ins/ArrayBuffer/isView/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(ArrayBuffer.isView.name, "isView"); - -verifyNotEnumerable(ArrayBuffer.isView, "name"); -verifyNotWritable(ArrayBuffer.isView, "name"); -verifyConfigurable(ArrayBuffer.isView, "name"); +verifyProperty(ArrayBuffer.isView, "name", { + value: "isView", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/isView/not-a-constructor.js b/js/src/tests/test262/built-ins/ArrayBuffer/isView/not-a-constructor.js index 09f8d71685..5c99e23fc2 100644 --- a/js/src/tests/test262/built-ins/ArrayBuffer/isView/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/ArrayBuffer/isView/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(ArrayBuffer.isView), false, 'isConstructor(ArrayB assert.throws(TypeError, () => { new ArrayBuffer.isView(); -}, '`new ArrayBuffer.isView()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/options-maxbytelength-allocation-limit.js b/js/src/tests/test262/built-ins/ArrayBuffer/options-maxbytelength-allocation-limit.js new file mode 100644 index 0000000000..e9c5b221d9 --- /dev/null +++ b/js/src/tests/test262/built-ins/ArrayBuffer/options-maxbytelength-allocation-limit.js @@ -0,0 +1,43 @@ +// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-arraybuffer-length +description: > + Throws a RangeError if the requested Data Block is too large. +info: | + ArrayBuffer ( length [ , options ] ) + + ... + 4. Return ? AllocateArrayBuffer(NewTarget, byteLength, requestedMaxByteLength). + + AllocateArrayBuffer ( constructor, byteLength [ , maxByteLength ] ) + + ... + 5. Let block be ? CreateByteDataBlock(byteLength). + ... + + CreateByteDataBlock ( size ) + + ... + 2. Let db be a new Data Block value consisting of size bytes. If it is + impossible to create such a Data Block, throw a RangeError exception. + ... + +features: [resizable-arraybuffer] +---*/ + +assert.throws(RangeError, function() { + // Allocating 7 PiB should fail with a RangeError. + // Math.pow(1024, 5) = 1125899906842624 + new ArrayBuffer(0, {maxByteLength: 7 * 1125899906842624}); +}, "`maxByteLength` option is 7 PiB"); + +assert.throws(RangeError, function() { + // Allocating almost 8 PiB should fail with a RangeError. + // Math.pow(2, 53) = 9007199254740992 + new ArrayBuffer(0, {maxByteLength: 9007199254740992 - 1}); +}, "`maxByteLength` option is Math.pow(2, 53) - 1"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/options-maxbytelength-compared-before-object-creation.js b/js/src/tests/test262/built-ins/ArrayBuffer/options-maxbytelength-compared-before-object-creation.js new file mode 100644 index 0000000000..d2fd5ff1f1 --- /dev/null +++ b/js/src/tests/test262/built-ins/ArrayBuffer/options-maxbytelength-compared-before-object-creation.js @@ -0,0 +1,43 @@ +// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-arraybuffer-length +description: > + The byteLength argument is validated before OrdinaryCreateFromConstructor. +info: | + ArrayBuffer ( length [ , options ] ) + + ... + 4. Return ? AllocateArrayBuffer(NewTarget, byteLength, requestedMaxByteLength). + + AllocateArrayBuffer ( constructor, byteLength [ , maxByteLength ] ) + + ... + 3. If allocatingResizableBuffer is true, then + a. If byteLength > maxByteLength, throw a RangeError exception. + ... + 4. Let obj be ? OrdinaryCreateFromConstructor(constructor, "%ArrayBuffer.prototype%", slots). + ... + +features: [resizable-arraybuffer, Reflect.construct] +---*/ + +let newTarget = Object.defineProperty(function(){}.bind(null), "prototype", { + get() { + throw new Test262Error(); + } +}); + +assert.throws(RangeError, function() { + let byteLength = 10; + let options = { + maxByteLength: 0, + }; + + // Throws a RangeError, because `byteLength` is larger than `options.maxByteLength`. + Reflect.construct(ArrayBuffer, [byteLength, options], newTarget); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/options-maxbytelength-data-allocation-after-object-creation.js b/js/src/tests/test262/built-ins/ArrayBuffer/options-maxbytelength-data-allocation-after-object-creation.js new file mode 100644 index 0000000000..4e36933b64 --- /dev/null +++ b/js/src/tests/test262/built-ins/ArrayBuffer/options-maxbytelength-data-allocation-after-object-creation.js @@ -0,0 +1,44 @@ +// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-arraybuffer-length +description: > + The new ArrayBuffer instance is created prior to allocating the Data Block. +info: | + ArrayBuffer ( length [ , options ] ) + + ... + 4. Return ? AllocateArrayBuffer(NewTarget, byteLength, requestedMaxByteLength). + + AllocateArrayBuffer ( constructor, byteLength [ , maxByteLength ] ) + + ... + 4. Let obj be ? OrdinaryCreateFromConstructor(constructor, "%ArrayBuffer.prototype%", slots). + 5. Let block be ? CreateByteDataBlock(byteLength). + ... + +features: [resizable-arraybuffer, Reflect.construct] +---*/ + +function DummyError() {} + +let newTarget = Object.defineProperty(function(){}.bind(null), "prototype", { + get() { + throw new DummyError(); + } +}); + +assert.throws(DummyError, function() { + let byteLength = 0; + let options = { + maxByteLength: 7 * 1125899906842624 + }; + + // Allocating 7 PiB should fail with a RangeError. + // Math.pow(1024, 5) = 1125899906842624 + Reflect.construct(ArrayBuffer, [], newTarget); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/prototype/byteLength/length.js b/js/src/tests/test262/built-ins/ArrayBuffer/prototype/byteLength/length.js index 1fb8a5b7b1..a2cc47230a 100644 --- a/js/src/tests/test262/built-ins/ArrayBuffer/prototype/byteLength/length.js +++ b/js/src/tests/test262/built-ins/ArrayBuffer/prototype/byteLength/length.js @@ -24,10 +24,11 @@ includes: [propertyHelper.js] var desc = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength"); -assert.sameValue(desc.get.length, 0); - -verifyNotEnumerable(desc.get, "length"); -verifyNotWritable(desc.get, "length"); -verifyConfigurable(desc.get, "length"); +verifyProperty(desc.get, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/prototype/byteLength/name.js b/js/src/tests/test262/built-ins/ArrayBuffer/prototype/byteLength/name.js index adac94a271..0ac174bcd0 100644 --- a/js/src/tests/test262/built-ins/ArrayBuffer/prototype/byteLength/name.js +++ b/js/src/tests/test262/built-ins/ArrayBuffer/prototype/byteLength/name.js @@ -17,13 +17,11 @@ var descriptor = Object.getOwnPropertyDescriptor( ArrayBuffer.prototype, 'byteLength' ); -assert.sameValue( - descriptor.get.name, 'get byteLength', - 'The value of `descriptor.get.name` is `"get byteLength"`' -); - -verifyNotEnumerable(descriptor.get, 'name'); -verifyNotWritable(descriptor.get, 'name'); -verifyConfigurable(descriptor.get, 'name'); +verifyProperty(descriptor.get, "name", { + value: "get byteLength", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/prototype/slice/length.js b/js/src/tests/test262/built-ins/ArrayBuffer/prototype/slice/length.js index e2a15cec4a..2c1c8c198b 100644 --- a/js/src/tests/test262/built-ins/ArrayBuffer/prototype/slice/length.js +++ b/js/src/tests/test262/built-ins/ArrayBuffer/prototype/slice/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(ArrayBuffer.prototype.slice.length, 2); - -verifyNotEnumerable(ArrayBuffer.prototype.slice, "length"); -verifyNotWritable(ArrayBuffer.prototype.slice, "length"); -verifyConfigurable(ArrayBuffer.prototype.slice, "length"); +verifyProperty(ArrayBuffer.prototype.slice, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/prototype/slice/name.js b/js/src/tests/test262/built-ins/ArrayBuffer/prototype/slice/name.js index f80ab724da..98df67d368 100644 --- a/js/src/tests/test262/built-ins/ArrayBuffer/prototype/slice/name.js +++ b/js/src/tests/test262/built-ins/ArrayBuffer/prototype/slice/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(ArrayBuffer.prototype.slice.name, "slice"); - -verifyNotEnumerable(ArrayBuffer.prototype.slice, "name"); -verifyNotWritable(ArrayBuffer.prototype.slice, "name"); -verifyConfigurable(ArrayBuffer.prototype.slice, "name"); +verifyProperty(ArrayBuffer.prototype.slice, "name", { + value: "slice", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/ArrayBuffer/prototype/slice/not-a-constructor.js b/js/src/tests/test262/built-ins/ArrayBuffer/prototype/slice/not-a-constructor.js index 06ff78c2aa..306c5abdd6 100644 --- a/js/src/tests/test262/built-ins/ArrayBuffer/prototype/slice/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/ArrayBuffer/prototype/slice/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let ab = new ArrayBuffer(); new ab.slice(); -}, '`let ab = new ArrayBuffer(); new ab.slice()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/detach-typedarray-in-progress.js b/js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/detach-typedarray-in-progress.js index addce3aa70..e5362c7922 100644 --- a/js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/detach-typedarray-in-progress.js +++ b/js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/detach-typedarray-in-progress.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/length.js b/js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/length.js index 22f673c500..a992d46b6b 100644 --- a/js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/length.js +++ b/js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/length.js @@ -25,10 +25,11 @@ features: [Symbol.iterator] var ArrayIteratorProto = Object.getPrototypeOf([][Symbol.iterator]()); -assert.sameValue(ArrayIteratorProto.next.length, 0); - -verifyNotEnumerable(ArrayIteratorProto.next, "length"); -verifyNotWritable(ArrayIteratorProto.next, "length"); -verifyConfigurable(ArrayIteratorProto.next, "length"); +verifyProperty(ArrayIteratorProto.next, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/name.js b/js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/name.js index b6e90d9645..781400569e 100644 --- a/js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/name.js +++ b/js/src/tests/test262/built-ins/ArrayIteratorPrototype/next/name.js @@ -22,10 +22,11 @@ features: [Symbol.iterator] var ArrayIteratorProto = Object.getPrototypeOf([][Symbol.iterator]()); -assert.sameValue(ArrayIteratorProto.next.name, "next"); - -verifyNotEnumerable(ArrayIteratorProto.next, "name"); -verifyNotWritable(ArrayIteratorProto.next, "name"); -verifyConfigurable(ArrayIteratorProto.next, "name"); +verifyProperty(ArrayIteratorProto.next, "name", { + value: "next", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); |