From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- js/src/tests/test262/GIT-INFO | 12 +- .../Date/prototype/getYear/not-a-constructor.js | 2 +- .../Date/prototype/setYear/not-a-constructor.js | 2 +- .../prototype/toGMTString/not-a-constructor.js | 2 +- .../prototype/compile/this-cross-realm-instance.js | 4 +- .../prototype/compile/this-subclass-instance.js | 8 +- .../String/prototype/anchor/not-a-constructor.js | 2 +- .../String/prototype/big/not-a-constructor.js | 2 +- .../String/prototype/blink/not-a-constructor.js | 2 +- .../String/prototype/bold/not-a-constructor.js | 2 +- .../String/prototype/fixed/not-a-constructor.js | 2 +- .../prototype/fontcolor/not-a-constructor.js | 2 +- .../String/prototype/fontsize/not-a-constructor.js | 2 +- .../String/prototype/italics/not-a-constructor.js | 2 +- .../String/prototype/link/not-a-constructor.js | 2 +- .../String/prototype/small/not-a-constructor.js | 2 +- .../String/prototype/strike/not-a-constructor.js | 2 +- .../String/prototype/sub/not-a-constructor.js | 2 +- .../String/prototype/substr/not-a-constructor.js | 2 +- .../String/prototype/sup/not-a-constructor.js | 2 +- .../from/iterator-method-emulates-undefined.js | 1 + .../annexB/built-ins/escape/not-a-constructor.js | 2 +- .../annexB/built-ins/unescape/not-a-constructor.js | 2 +- .../single-line-html-close-first-line-1.js | 34 ++ .../single-line-html-close-first-line-2.js | 34 ++ .../single-line-html-close-first-line-3.js | 34 ++ .../script-decl-lex-collision-in-sloppy-mode.js | 23 - ...-decl-lex-no-collision-in-strict-mode-strict.js | 24 - .../direct/script-decl-lex-no-collision.js | 35 ++ .../built-ins/Array/Symbol.species/length.js | 11 +- .../Array/Symbol.species/symbol-species-name.js | 14 +- .../built-ins/Array/from/Array.from-name.js | 15 +- .../built-ins/Array/from/Array.from_arity.js | 11 +- .../test262/built-ins/Array/fromAsync/shell.js | 8 + .../tests/test262/built-ins/Array/isArray/name.js | 11 +- js/src/tests/test262/built-ins/Array/length.js | 11 +- js/src/tests/test262/built-ins/Array/name.js | 11 +- js/src/tests/test262/built-ins/Array/of/length.js | 14 +- js/src/tests/test262/built-ins/Array/of/name.js | 14 +- .../prototype/Symbol.iterator/not-a-constructor.js | 2 +- .../test262/built-ins/Array/prototype/at/length.js | 14 +- .../built-ins/Array/prototype/concat/length.js | 11 +- .../built-ins/Array/prototype/concat/name.js | 15 +- .../built-ins/Array/prototype/copyWithin/length.js | 14 +- .../built-ins/Array/prototype/copyWithin/name.js | 14 +- .../prototype/copyWithin/not-a-constructor.js | 2 +- .../built-ins/Array/prototype/entries/length.js | 14 +- .../built-ins/Array/prototype/entries/name.js | 14 +- .../Array/prototype/entries/not-a-constructor.js | 2 +- .../every/callbackfn-resize-arraybuffer.js | 2 +- .../built-ins/Array/prototype/every/length.js | 14 +- .../built-ins/Array/prototype/every/name.js | 11 +- .../Array/prototype/every/not-a-constructor.js | 2 +- .../built-ins/Array/prototype/fill/length.js | 14 +- .../test262/built-ins/Array/prototype/fill/name.js | 14 +- .../Array/prototype/fill/not-a-constructor.js | 2 +- .../filter/callbackfn-resize-arraybuffer.js | 2 +- .../built-ins/Array/prototype/filter/length.js | 11 +- .../built-ins/Array/prototype/filter/name.js | 11 +- .../Array/prototype/filter/not-a-constructor.js | 2 +- .../find/callbackfn-resize-arraybuffer.js | 2 +- .../built-ins/Array/prototype/find/length.js | 14 +- .../test262/built-ins/Array/prototype/find/name.js | 14 +- .../Array/prototype/find/not-a-constructor.js | 2 +- .../findIndex/callbackfn-resize-arraybuffer.js | 2 +- .../built-ins/Array/prototype/findIndex/length.js | 14 +- .../built-ins/Array/prototype/findIndex/name.js | 14 +- .../Array/prototype/findIndex/not-a-constructor.js | 2 +- .../findLast/callbackfn-resize-arraybuffer.js | 2 +- .../Array/prototype/findLast/not-a-constructor.js | 2 +- .../findLastIndex/callbackfn-resize-arraybuffer.js | 2 +- .../prototype/findLastIndex/not-a-constructor.js | 2 +- .../Array/prototype/flat/not-a-constructor.js | 2 +- .../Array/prototype/flatMap/not-a-constructor.js | 2 +- .../forEach/callbackfn-resize-arraybuffer.js | 2 +- .../built-ins/Array/prototype/forEach/length.js | 11 +- .../built-ins/Array/prototype/forEach/name.js | 11 +- .../Array/prototype/forEach/not-a-constructor.js | 2 +- .../built-ins/Array/prototype/includes/length.js | 11 +- .../built-ins/Array/prototype/includes/name.js | 11 +- .../Array/prototype/includes/not-a-constructor.js | 2 +- .../built-ins/Array/prototype/indexOf/length.js | 11 +- .../built-ins/Array/prototype/indexOf/name.js | 11 +- .../Array/prototype/indexOf/not-a-constructor.js | 2 +- .../built-ins/Array/prototype/join/length.js | 11 +- .../test262/built-ins/Array/prototype/join/name.js | 11 +- .../Array/prototype/join/not-a-constructor.js | 2 +- .../built-ins/Array/prototype/keys/length.js | 14 +- .../test262/built-ins/Array/prototype/keys/name.js | 14 +- .../Array/prototype/keys/not-a-constructor.js | 2 +- .../Array/prototype/lastIndexOf/length.js | 11 +- .../built-ins/Array/prototype/lastIndexOf/name.js | 11 +- .../prototype/lastIndexOf/not-a-constructor.js | 2 +- .../prototype/map/callbackfn-resize-arraybuffer.js | 2 +- .../built-ins/Array/prototype/map/length.js | 11 +- .../test262/built-ins/Array/prototype/map/name.js | 11 +- .../Array/prototype/map/not-a-constructor.js | 2 +- .../built-ins/Array/prototype/pop/length.js | 11 +- .../test262/built-ins/Array/prototype/pop/name.js | 11 +- .../Array/prototype/pop/not-a-constructor.js | 2 +- .../built-ins/Array/prototype/push/length.js | 11 +- .../test262/built-ins/Array/prototype/push/name.js | 11 +- .../Array/prototype/push/not-a-constructor.js | 2 +- .../reduce/callbackfn-resize-arraybuffer.js | 2 +- .../built-ins/Array/prototype/reduce/length.js | 11 +- .../built-ins/Array/prototype/reduce/name.js | 11 +- .../Array/prototype/reduce/not-a-constructor.js | 2 +- .../reduceRight/callbackfn-resize-arraybuffer.js | 2 +- .../Array/prototype/reduceRight/length.js | 11 +- .../built-ins/Array/prototype/reduceRight/name.js | 11 +- .../prototype/reduceRight/not-a-constructor.js | 2 +- .../built-ins/Array/prototype/reverse/length.js | 11 +- .../built-ins/Array/prototype/reverse/name.js | 11 +- .../Array/prototype/reverse/not-a-constructor.js | 2 +- .../built-ins/Array/prototype/shift/length.js | 11 +- .../built-ins/Array/prototype/shift/name.js | 11 +- .../Array/prototype/shift/not-a-constructor.js | 2 +- .../built-ins/Array/prototype/slice/length.js | 11 +- .../built-ins/Array/prototype/slice/name.js | 11 +- .../Array/prototype/slice/not-a-constructor.js | 2 +- .../some/callbackfn-resize-arraybuffer.js | 2 +- .../built-ins/Array/prototype/some/length.js | 11 +- .../test262/built-ins/Array/prototype/some/name.js | 11 +- .../Array/prototype/some/not-a-constructor.js | 2 +- .../built-ins/Array/prototype/sort/length.js | 11 +- .../test262/built-ins/Array/prototype/sort/name.js | 11 +- .../Array/prototype/sort/not-a-constructor.js | 2 +- .../built-ins/Array/prototype/splice/length.js | 11 +- .../built-ins/Array/prototype/splice/name.js | 11 +- .../Array/prototype/splice/not-a-constructor.js | 2 +- .../Array/prototype/toLocaleString/length.js | 11 +- .../Array/prototype/toLocaleString/name.js | 11 +- .../prototype/toLocaleString/not-a-constructor.js | 2 +- .../prototype/toReversed/not-a-constructor.js | 2 +- .../prototype/toReversed/this-value-nullish.js | 4 +- .../Array/prototype/toSorted/not-a-constructor.js | 2 +- .../Array/prototype/toSorted/this-value-nullish.js | 4 +- .../Array/prototype/toSpliced/not-a-constructor.js | 2 +- .../built-ins/Array/prototype/toString/length.js | 11 +- .../built-ins/Array/prototype/toString/name.js | 11 +- .../Array/prototype/toString/not-a-constructor.js | 2 +- .../built-ins/Array/prototype/unshift/length.js | 11 +- .../built-ins/Array/prototype/unshift/name.js | 11 +- .../Array/prototype/unshift/not-a-constructor.js | 2 +- .../built-ins/Array/prototype/values/length.js | 11 +- .../built-ins/Array/prototype/values/name.js | 11 +- .../Array/prototype/values/not-a-constructor.js | 2 +- .../Array/prototype/with/not-a-constructor.js | 2 +- .../Array/prototype/with/this-value-nullish.js | 4 +- .../built-ins/ArrayBuffer/Symbol.species/length.js | 11 +- .../Symbol.species/symbol-species-name.js | 14 +- .../ArrayBuffer/isView/arg-is-typedarray-buffer.js | 1 + .../isView/arg-is-typedarray-constructor.js | 1 + .../isView/arg-is-typedarray-subclass-instance.js | 1 + .../ArrayBuffer/isView/arg-is-typedarray.js | 1 + .../ArrayBuffer/isView/invoked-as-a-fn.js | 1 + .../test262/built-ins/ArrayBuffer/isView/length.js | 11 +- .../test262/built-ins/ArrayBuffer/isView/name.js | 11 +- .../ArrayBuffer/isView/not-a-constructor.js | 2 +- .../options-maxbytelength-allocation-limit.js | 43 ++ ...axbytelength-compared-before-object-creation.js | 43 ++ ...length-data-allocation-after-object-creation.js | 44 ++ .../ArrayBuffer/prototype/byteLength/length.js | 11 +- .../ArrayBuffer/prototype/byteLength/name.js | 14 +- .../ArrayBuffer/prototype/slice/length.js | 11 +- .../built-ins/ArrayBuffer/prototype/slice/name.js | 11 +- .../prototype/slice/not-a-constructor.js | 2 +- .../next/detach-typedarray-in-progress.js | 1 + .../ArrayIteratorPrototype/next/length.js | 11 +- .../built-ins/ArrayIteratorPrototype/next/name.js | 11 +- .../AsyncFunction/AsyncFunction-length.js | 10 +- .../built-ins/AsyncFunction/AsyncFunction-name.js | 10 +- .../built-ins/AsyncFunction/instance-has-name.js | 10 +- .../test262/built-ins/Atomics/add/bad-range.js | 4 +- .../built-ins/Atomics/add/bigint/bad-range.js | 2 +- .../test262/built-ins/Atomics/add/good-views.js | 2 +- .../built-ins/Atomics/add/non-shared-bufferdata.js | 2 +- .../Atomics/add/non-shared-int-views-throws.js | 2 +- .../test262/built-ins/Atomics/add/non-views.js | 2 +- .../built-ins/Atomics/add/not-a-constructor.js | 2 +- .../validate-arraytype-before-index-coercion.js | 2 +- .../validate-arraytype-before-value-coercion.js | 2 +- .../test262/built-ins/Atomics/and/bad-range.js | 4 +- .../built-ins/Atomics/and/bigint/bad-range.js | 2 +- .../test262/built-ins/Atomics/and/good-views.js | 2 +- .../built-ins/Atomics/and/non-shared-bufferdata.js | 2 +- .../Atomics/and/non-shared-int-views-throws.js | 2 +- .../test262/built-ins/Atomics/and/non-views.js | 2 +- .../built-ins/Atomics/and/not-a-constructor.js | 2 +- .../validate-arraytype-before-index-coercion.js | 2 +- .../validate-arraytype-before-value-coercion.js | 2 +- .../built-ins/Atomics/compareExchange/bad-range.js | 4 +- .../Atomics/compareExchange/bigint/bad-range.js | 2 +- .../Atomics/compareExchange/good-views.js | 2 +- .../compareExchange/non-shared-bufferdata.js | 2 +- .../compareExchange/non-shared-int-views-throws.js | 2 +- .../built-ins/Atomics/compareExchange/non-views.js | 2 +- .../Atomics/compareExchange/not-a-constructor.js | 2 +- ...date-arraytype-before-expectedValue-coercion.js | 2 +- .../validate-arraytype-before-index-coercion.js | 2 +- ...e-arraytype-before-replacementValue-coercion.js | 2 +- .../built-ins/Atomics/exchange/bad-range.js | 4 +- .../built-ins/Atomics/exchange/bigint/bad-range.js | 2 +- .../built-ins/Atomics/exchange/good-views.js | 2 +- .../Atomics/exchange/non-shared-bufferdata.js | 2 +- .../exchange/non-shared-int-views-throws.js | 2 +- .../built-ins/Atomics/exchange/non-views.js | 2 +- .../Atomics/exchange/nonshared-int-views.js | 2 +- .../Atomics/exchange/not-a-constructor.js | 2 +- .../validate-arraytype-before-index-coercion.js | 2 +- .../validate-arraytype-before-value-coercion.js | 2 +- .../Atomics/isLockFree/not-a-constructor.js | 2 +- .../test262/built-ins/Atomics/load/bad-range.js | 4 +- .../built-ins/Atomics/load/bigint/bad-range.js | 2 +- .../test262/built-ins/Atomics/load/good-views.js | 2 +- .../Atomics/load/non-shared-bufferdata.js | 2 +- .../Atomics/load/non-shared-int-views-throws.js | 2 +- .../test262/built-ins/Atomics/load/non-views.js | 2 +- .../built-ins/Atomics/load/not-a-constructor.js | 2 +- .../validate-arraytype-before-index-coercion.js | 2 +- .../test262/built-ins/Atomics/notify/bad-range.js | 2 +- .../built-ins/Atomics/notify/bigint/bad-range.js | 2 +- .../bigint/non-bigint64-typedarray-throws.js | 4 +- ...on-shared-bufferdata-count-evaluation-throws.js | 2 +- ...on-shared-bufferdata-index-evaluation-throws.js | 2 +- ...hared-bufferdata-non-shared-int-views-throws.js | 2 +- .../notify/bigint/null-bufferdata-throws.js | 2 +- .../Atomics/notify/count-symbol-throws.js | 2 +- .../count-tointeger-throws-then-wake-throws.js | 2 +- .../Atomics/notify/negative-index-throws.js | 8 +- .../Atomics/notify/non-int32-typedarray-throws.js | 18 +- ...on-shared-bufferdata-count-evaluation-throws.js | 2 +- ...on-shared-bufferdata-index-evaluation-throws.js | 2 +- ...hared-bufferdata-non-shared-int-views-throws.js | 12 +- .../Atomics/notify/non-shared-int-views.js | 12 +- .../test262/built-ins/Atomics/notify/non-views.js | 2 +- .../built-ins/Atomics/notify/not-a-constructor.js | 2 +- .../Atomics/notify/not-a-typedarray-throws.js | 4 +- .../Atomics/notify/not-an-object-throws.js | 14 +- .../Atomics/notify/null-bufferdata-throws.js | 2 +- .../Atomics/notify/out-of-range-index-throws.js | 6 +- .../Atomics/notify/symbol-for-index-throws.js | 8 +- .../validate-arraytype-before-count-coercion.js | 2 +- .../validate-arraytype-before-index-coercion.js | 2 +- .../test262/built-ins/Atomics/or/bad-range.js | 4 +- .../built-ins/Atomics/or/bigint/bad-range.js | 2 +- .../test262/built-ins/Atomics/or/good-views.js | 2 +- .../built-ins/Atomics/or/non-shared-bufferdata.js | 2 +- .../Atomics/or/non-shared-int-views-throws.js | 2 +- .../test262/built-ins/Atomics/or/non-views.js | 2 +- .../built-ins/Atomics/or/not-a-constructor.js | 2 +- .../or/validate-arraytype-before-index-coercion.js | 2 +- .../or/validate-arraytype-before-value-coercion.js | 2 +- .../tests/test262/built-ins/Atomics/prop-desc.js | 4 +- .../test262/built-ins/Atomics/store/bad-range.js | 4 +- .../built-ins/Atomics/store/bigint/bad-range.js | 2 +- .../test262/built-ins/Atomics/store/good-views.js | 2 +- .../Atomics/store/non-shared-bufferdata.js | 2 +- .../Atomics/store/non-shared-int-views-throws.js | 2 +- .../test262/built-ins/Atomics/store/non-views.js | 2 +- .../built-ins/Atomics/store/not-a-constructor.js | 2 +- .../validate-arraytype-before-index-coercion.js | 2 +- .../validate-arraytype-before-value-coercion.js | 2 +- .../test262/built-ins/Atomics/sub/bad-range.js | 4 +- .../built-ins/Atomics/sub/bigint/bad-range.js | 2 +- .../test262/built-ins/Atomics/sub/good-views.js | 2 +- .../built-ins/Atomics/sub/non-shared-bufferdata.js | 2 +- .../Atomics/sub/non-shared-int-views-throws.js | 2 +- .../test262/built-ins/Atomics/sub/non-views.js | 2 +- .../built-ins/Atomics/sub/not-a-constructor.js | 2 +- .../validate-arraytype-before-index-coercion.js | 2 +- .../validate-arraytype-before-value-coercion.js | 2 +- .../test262/built-ins/Atomics/wait/bad-range.js | 2 +- .../built-ins/Atomics/wait/bigint/bad-range.js | 2 +- .../Atomics/wait/bigint/cannot-suspend-throws.js | 2 +- .../Atomics/wait/bigint/negative-index-throws.js | 8 +- .../wait/bigint/non-bigint64-typedarray-throws.js | 4 +- .../wait/bigint/non-shared-bufferdata-throws.js | 4 +- .../Atomics/wait/bigint/null-bufferdata-throws.js | 2 +- .../wait/bigint/out-of-range-index-throws.js | 6 +- .../Atomics/wait/cannot-suspend-throws.js | 2 +- .../Atomics/wait/negative-index-throws.js | 8 +- .../Atomics/wait/non-int32-typedarray-throws.js | 18 +- .../Atomics/wait/non-shared-bufferdata-throws.js | 4 +- .../Atomics/wait/not-a-typedarray-throws.js | 4 +- .../built-ins/Atomics/wait/not-an-object-throws.js | 14 +- .../Atomics/wait/null-bufferdata-throws.js | 2 +- .../Atomics/wait/out-of-range-index-throws.js | 8 +- .../wait/poisoned-object-for-timeout-throws.js | 4 +- .../Atomics/wait/symbol-for-index-throws.js | 8 +- .../Atomics/wait/symbol-for-timeout-throws.js | 8 +- .../Atomics/wait/symbol-for-value-throws.js | 8 +- .../validate-arraytype-before-index-coercion.js | 2 +- .../validate-arraytype-before-timeout-coercion.js | 2 +- .../validate-arraytype-before-value-coercion.js | 2 +- .../validate-arraytype-before-index-coercion.js | 2 +- .../validate-arraytype-before-value-coercion.js | 2 +- .../test262/built-ins/Atomics/xor/bad-range.js | 4 +- .../built-ins/Atomics/xor/bigint/bad-range.js | 2 +- .../test262/built-ins/Atomics/xor/good-views.js | 2 +- .../built-ins/Atomics/xor/non-shared-bufferdata.js | 2 +- .../Atomics/xor/non-shared-int-views-throws.js | 2 +- .../test262/built-ins/Atomics/xor/non-views.js | 2 +- .../built-ins/Atomics/xor/not-a-constructor.js | 2 +- .../validate-arraytype-before-index-coercion.js | 2 +- .../validate-arraytype-before-value-coercion.js | 2 +- .../built-ins/BigInt/asIntN/not-a-constructor.js | 2 +- .../built-ins/BigInt/asUintN/not-a-constructor.js | 2 +- .../prototype/toLocaleString/not-a-constructor.js | 2 +- .../BigInt/prototype/toString/not-a-constructor.js | 2 +- .../BigInt/prototype/valueOf/not-a-constructor.js | 2 +- .../built-ins/Boolean/prototype/toString/length.js | 11 +- .../built-ins/Boolean/prototype/toString/name.js | 11 +- .../prototype/toString/not-a-constructor.js | 2 +- .../built-ins/Boolean/prototype/valueOf/length.js | 11 +- .../built-ins/Boolean/prototype/valueOf/name.js | 11 +- .../Boolean/prototype/valueOf/not-a-constructor.js | 2 +- ...fset-validated-against-initial-buffer-length.js | 46 ++ js/src/tests/test262/built-ins/DataView/name.js | 11 +- .../built-ins/DataView/prototype/buffer/length.js | 11 +- .../built-ins/DataView/prototype/buffer/name.js | 14 +- .../DataView/prototype/byteLength/length.js | 11 +- .../DataView/prototype/byteLength/name.js | 14 +- .../DataView/prototype/byteOffset/length.js | 11 +- .../DataView/prototype/byteOffset/name.js | 14 +- .../prototype/getBigInt64/not-a-constructor.js | 2 +- .../prototype/getBigUint64/not-a-constructor.js | 2 +- .../DataView/prototype/getFloat16/browser.js | 0 .../detached-buffer-after-toindex-byteoffset.js | 26 + ...detached-buffer-before-outofrange-byteoffset.js | 24 + .../prototype/getFloat16/detached-buffer.js | 21 + .../prototype/getFloat16/index-is-out-of-range.js | 63 ++ .../DataView/prototype/getFloat16/length.js | 20 + .../DataView/prototype/getFloat16/minus-zero.js | 21 + .../DataView/prototype/getFloat16/name.js | 20 + .../getFloat16/negative-byteoffset-throws.js | 23 + .../prototype/getFloat16/not-a-constructor.js | 24 + .../prototype/getFloat16/resizable-buffer.js | 44 ++ ...eturn-abrupt-from-tonumber-byteoffset-symbol.js | 21 + .../return-abrupt-from-tonumber-byteoffset.js | 35 ++ .../prototype/getFloat16/return-infinity.js | 23 + .../DataView/prototype/getFloat16/return-nan.js | 23 + .../getFloat16/return-value-clean-arraybuffer.js | 26 + .../getFloat16/return-values-custom-offset.js | 29 + .../DataView/prototype/getFloat16/return-values.js | 40 ++ .../DataView/prototype/getFloat16/shell.js | 0 .../getFloat16/this-has-no-dataview-internal.js | 32 + .../prototype/getFloat16/this-is-not-object.js | 42 ++ .../getFloat16/to-boolean-littleendian.js | 31 + .../prototype/getFloat16/toindex-byteoffset.js | 53 ++ .../DataView/prototype/getFloat32/length.js | 11 +- .../DataView/prototype/getFloat32/name.js | 11 +- .../prototype/getFloat32/not-a-constructor.js | 2 +- .../DataView/prototype/getFloat64/length.js | 11 +- .../DataView/prototype/getFloat64/name.js | 11 +- .../prototype/getFloat64/not-a-constructor.js | 2 +- .../DataView/prototype/getInt16/length.js | 11 +- .../built-ins/DataView/prototype/getInt16/name.js | 11 +- .../prototype/getInt16/not-a-constructor.js | 2 +- .../DataView/prototype/getInt32/length.js | 11 +- .../built-ins/DataView/prototype/getInt32/name.js | 11 +- .../prototype/getInt32/not-a-constructor.js | 2 +- .../built-ins/DataView/prototype/getInt8/length.js | 11 +- .../built-ins/DataView/prototype/getInt8/name.js | 11 +- .../prototype/getInt8/not-a-constructor.js | 2 +- .../DataView/prototype/getUint16/length.js | 11 +- .../built-ins/DataView/prototype/getUint16/name.js | 11 +- .../prototype/getUint16/not-a-constructor.js | 2 +- .../DataView/prototype/getUint32/length.js | 11 +- .../built-ins/DataView/prototype/getUint32/name.js | 11 +- .../prototype/getUint32/not-a-constructor.js | 2 +- .../DataView/prototype/getUint8/length.js | 11 +- .../built-ins/DataView/prototype/getUint8/name.js | 11 +- .../prototype/getUint8/not-a-constructor.js | 2 +- .../prototype/setBigInt64/not-a-constructor.js | 2 +- .../prototype/setBigUint64/not-a-constructor.js | 2 +- .../DataView/prototype/setFloat16/browser.js | 0 .../detached-buffer-after-number-value.js | 27 + .../detached-buffer-after-toindex-byteoffset.js | 26 + ...detached-buffer-before-outofrange-byteoffset.js | 24 + .../prototype/setFloat16/detached-buffer.js | 21 + .../index-check-before-value-conversion.js | 36 ++ .../prototype/setFloat16/index-is-out-of-range.js | 71 +++ .../DataView/prototype/setFloat16/length.js | 20 + .../DataView/prototype/setFloat16/name.js | 20 + .../setFloat16/negative-byteoffset-throws.js | 25 + .../DataView/prototype/setFloat16/no-value-arg.js | 20 + .../prototype/setFloat16/not-a-constructor.js | 24 + .../range-check-after-value-conversion.js | 28 + .../prototype/setFloat16/resizable-buffer.js | 44 ++ ...eturn-abrupt-from-tonumber-byteoffset-symbol.js | 21 + .../return-abrupt-from-tonumber-byteoffset.js | 35 ++ .../return-abrupt-from-tonumber-value-symbol.js | 21 + .../return-abrupt-from-tonumber-value.js | 35 ++ .../setFloat16/set-values-little-endian-order.js | 25 + .../setFloat16/set-values-return-undefined.js | 36 ++ .../DataView/prototype/setFloat16/shell.js | 0 .../setFloat16/this-has-no-dataview-internal.js | 32 + .../prototype/setFloat16/this-is-not-object.js | 42 ++ .../setFloat16/to-boolean-littleendian.js | 37 ++ .../prototype/setFloat16/toindex-byteoffset.js | 99 +++ .../DataView/prototype/setFloat32/length.js | 11 +- .../DataView/prototype/setFloat32/name.js | 11 +- .../prototype/setFloat32/not-a-constructor.js | 2 +- .../DataView/prototype/setFloat64/length.js | 11 +- .../DataView/prototype/setFloat64/name.js | 11 +- .../prototype/setFloat64/not-a-constructor.js | 2 +- .../DataView/prototype/setInt16/length.js | 11 +- .../built-ins/DataView/prototype/setInt16/name.js | 11 +- .../prototype/setInt16/not-a-constructor.js | 2 +- .../DataView/prototype/setInt32/length.js | 11 +- .../built-ins/DataView/prototype/setInt32/name.js | 11 +- .../prototype/setInt32/not-a-constructor.js | 2 +- .../built-ins/DataView/prototype/setInt8/length.js | 11 +- .../built-ins/DataView/prototype/setInt8/name.js | 11 +- .../prototype/setInt8/not-a-constructor.js | 2 +- .../DataView/prototype/setUint16/length.js | 11 +- .../built-ins/DataView/prototype/setUint16/name.js | 11 +- .../prototype/setUint16/not-a-constructor.js | 2 +- .../DataView/prototype/setUint32/length.js | 11 +- .../built-ins/DataView/prototype/setUint32/name.js | 11 +- .../prototype/setUint32/not-a-constructor.js | 2 +- .../DataView/prototype/setUint8/length.js | 11 +- .../built-ins/DataView/prototype/setUint8/name.js | 11 +- .../prototype/setUint8/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/DataView/shell.js | 347 ++++++++--- js/src/tests/test262/built-ins/Date/UTC/name.js | 11 +- .../built-ins/Date/UTC/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Date/name.js | 11 +- js/src/tests/test262/built-ins/Date/now/name.js | 11 +- .../built-ins/Date/now/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Date/parse/name.js | 11 +- .../built-ins/Date/parse/not-a-constructor.js | 2 +- .../Date/prototype/Symbol.toPrimitive/length.js | 11 +- .../Date/prototype/Symbol.toPrimitive/name.js | 13 +- .../built-ins/Date/prototype/getDate/name.js | 11 +- .../Date/prototype/getDate/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/getDay/name.js | 11 +- .../Date/prototype/getDay/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/getFullYear/name.js | 11 +- .../prototype/getFullYear/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/getHours/name.js | 11 +- .../Date/prototype/getHours/not-a-constructor.js | 2 +- .../Date/prototype/getMilliseconds/name.js | 11 +- .../prototype/getMilliseconds/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/getMinutes/name.js | 11 +- .../Date/prototype/getMinutes/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/getMonth/name.js | 11 +- .../Date/prototype/getMonth/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/getSeconds/name.js | 11 +- .../Date/prototype/getSeconds/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/getTime/name.js | 11 +- .../Date/prototype/getTime/not-a-constructor.js | 2 +- .../Date/prototype/getTimezoneOffset/name.js | 11 +- .../getTimezoneOffset/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/getUTCDate/name.js | 11 +- .../Date/prototype/getUTCDate/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/getUTCDay/name.js | 11 +- .../Date/prototype/getUTCDay/not-a-constructor.js | 2 +- .../Date/prototype/getUTCFullYear/name.js | 11 +- .../prototype/getUTCFullYear/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/getUTCHours/name.js | 11 +- .../prototype/getUTCHours/not-a-constructor.js | 2 +- .../Date/prototype/getUTCMilliseconds/name.js | 11 +- .../getUTCMilliseconds/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/getUTCMinutes/name.js | 11 +- .../prototype/getUTCMinutes/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/getUTCMonth/name.js | 11 +- .../prototype/getUTCMonth/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/getUTCSeconds/name.js | 11 +- .../prototype/getUTCSeconds/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/setDate/name.js | 11 +- .../Date/prototype/setDate/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/setFullYear/name.js | 11 +- .../prototype/setFullYear/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/setHours/name.js | 11 +- .../Date/prototype/setHours/not-a-constructor.js | 2 +- .../Date/prototype/setMilliseconds/name.js | 11 +- .../prototype/setMilliseconds/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/setMinutes/name.js | 11 +- .../Date/prototype/setMinutes/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/setMonth/name.js | 11 +- .../Date/prototype/setMonth/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/setSeconds/name.js | 11 +- .../Date/prototype/setSeconds/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/setTime/name.js | 11 +- .../Date/prototype/setTime/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/setUTCDate/name.js | 11 +- .../Date/prototype/setUTCDate/not-a-constructor.js | 2 +- .../Date/prototype/setUTCFullYear/name.js | 11 +- .../prototype/setUTCFullYear/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/setUTCHours/name.js | 11 +- .../prototype/setUTCHours/not-a-constructor.js | 2 +- .../Date/prototype/setUTCMilliseconds/name.js | 11 +- .../setUTCMilliseconds/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/setUTCMinutes/name.js | 11 +- .../prototype/setUTCMinutes/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/setUTCMonth/name.js | 11 +- .../prototype/setUTCMonth/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/setUTCSeconds/name.js | 11 +- .../prototype/setUTCSeconds/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/toDateString/name.js | 11 +- .../prototype/toDateString/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/toISOString/name.js | 11 +- .../prototype/toISOString/not-a-constructor.js | 2 +- .../Date/prototype/toJSON/not-a-constructor.js | 2 +- .../Date/prototype/toLocaleDateString/name.js | 11 +- .../toLocaleDateString/not-a-constructor.js | 2 +- .../Date/prototype/toLocaleString/name.js | 11 +- .../prototype/toLocaleString/not-a-constructor.js | 2 +- .../Date/prototype/toLocaleTimeString/name.js | 11 +- .../toLocaleTimeString/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/toString/name.js | 11 +- .../Date/prototype/toString/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/toTimeString/name.js | 11 +- .../prototype/toTimeString/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/toUTCString/name.js | 11 +- .../prototype/toUTCString/not-a-constructor.js | 2 +- .../built-ins/Date/prototype/valueOf/name.js | 11 +- .../Date/prototype/valueOf/not-a-constructor.js | 2 +- .../built-ins/Error/prototype/toString/length.js | 11 +- .../built-ins/Error/prototype/toString/name.js | 11 +- .../Error/prototype/toString/not-a-constructor.js | 2 +- .../prototype/cleanupSome/not-a-constructor.js | 2 +- .../prototype/register/not-a-constructor.js | 2 +- .../prototype/unregister/not-a-constructor.js | 2 +- .../prototype/Symbol.hasInstance/length.js | 11 +- .../Function/prototype/Symbol.hasInstance/name.js | 13 +- .../built-ins/Function/prototype/apply/name.js | 11 +- .../Function/prototype/apply/not-a-constructor.js | 4 +- .../built-ins/Function/prototype/bind/name.js | 11 +- .../Function/prototype/bind/not-a-constructor.js | 2 +- .../built-ins/Function/prototype/call/name.js | 11 +- .../Function/prototype/call/not-a-constructor.js | 4 +- .../test262/built-ins/Function/prototype/name.js | 10 +- .../built-ins/Function/prototype/toString/name.js | 11 +- .../prototype/toString/not-a-constructor.js | 4 +- .../test262/built-ins/GeneratorFunction/length.js | 11 +- .../test262/built-ins/GeneratorFunction/name.js | 11 +- .../built-ins/GeneratorPrototype/next/length.js | 11 +- .../built-ins/GeneratorPrototype/next/name.js | 11 +- .../GeneratorPrototype/next/not-a-constructor.js | 2 +- .../built-ins/GeneratorPrototype/return/length.js | 11 +- .../built-ins/GeneratorPrototype/return/name.js | 11 +- .../GeneratorPrototype/return/not-a-constructor.js | 2 +- .../built-ins/GeneratorPrototype/throw/length.js | 11 +- .../built-ins/GeneratorPrototype/throw/name.js | 11 +- .../GeneratorPrototype/throw/not-a-constructor.js | 2 +- .../built-ins/JSON/parse/not-a-constructor.js | 2 +- .../built-ins/JSON/stringify/not-a-constructor.js | 2 +- .../test262/built-ins/Map/Symbol.species/length.js | 11 +- .../tests/test262/built-ins/Map/groupBy/string.js | 24 + js/src/tests/test262/built-ins/Map/length.js | 11 +- js/src/tests/test262/built-ins/Map/name.js | 11 +- .../prototype/Symbol.iterator/not-a-constructor.js | 2 +- .../built-ins/Map/prototype/clear/length.js | 14 +- .../test262/built-ins/Map/prototype/clear/name.js | 14 +- .../Map/prototype/clear/not-a-constructor.js | 2 +- .../built-ins/Map/prototype/delete/length.js | 14 +- .../test262/built-ins/Map/prototype/delete/name.js | 14 +- .../Map/prototype/delete/not-a-constructor.js | 2 +- .../built-ins/Map/prototype/entries/length.js | 14 +- .../built-ins/Map/prototype/entries/name.js | 14 +- .../Map/prototype/entries/not-a-constructor.js | 2 +- .../built-ins/Map/prototype/forEach/length.js | 14 +- .../built-ins/Map/prototype/forEach/name.js | 14 +- .../Map/prototype/forEach/not-a-constructor.js | 2 +- .../test262/built-ins/Map/prototype/get/length.js | 14 +- .../test262/built-ins/Map/prototype/get/name.js | 14 +- .../Map/prototype/get/not-a-constructor.js | 2 +- .../test262/built-ins/Map/prototype/has/length.js | 14 +- .../test262/built-ins/Map/prototype/has/name.js | 14 +- .../Map/prototype/has/not-a-constructor.js | 2 +- .../test262/built-ins/Map/prototype/keys/length.js | 14 +- .../test262/built-ins/Map/prototype/keys/name.js | 14 +- .../Map/prototype/keys/not-a-constructor.js | 2 +- .../test262/built-ins/Map/prototype/set/length.js | 14 +- .../test262/built-ins/Map/prototype/set/name.js | 14 +- .../Map/prototype/set/not-a-constructor.js | 2 +- .../test262/built-ins/Map/prototype/size/length.js | 14 +- .../test262/built-ins/Map/prototype/size/name.js | 14 +- .../built-ins/Map/prototype/values/length.js | 14 +- .../test262/built-ins/Map/prototype/values/name.js | 14 +- .../Map/prototype/values/not-a-constructor.js | 2 +- .../built-ins/MapIteratorPrototype/next/length.js | 11 +- .../built-ins/MapIteratorPrototype/next/name.js | 11 +- js/src/tests/test262/built-ins/Math/abs/length.js | 11 +- js/src/tests/test262/built-ins/Math/abs/name.js | 11 +- .../built-ins/Math/abs/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/acos/length.js | 11 +- js/src/tests/test262/built-ins/Math/acos/name.js | 11 +- .../built-ins/Math/acos/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Math/acosh/length.js | 11 +- js/src/tests/test262/built-ins/Math/acosh/name.js | 11 +- .../built-ins/Math/acosh/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/asin/length.js | 11 +- js/src/tests/test262/built-ins/Math/asin/name.js | 11 +- .../built-ins/Math/asin/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Math/asinh/length.js | 11 +- js/src/tests/test262/built-ins/Math/asinh/name.js | 11 +- .../built-ins/Math/asinh/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/atan/length.js | 11 +- js/src/tests/test262/built-ins/Math/atan/name.js | 11 +- .../built-ins/Math/atan/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Math/atan2/length.js | 11 +- js/src/tests/test262/built-ins/Math/atan2/name.js | 11 +- .../built-ins/Math/atan2/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Math/atanh/length.js | 11 +- js/src/tests/test262/built-ins/Math/atanh/name.js | 11 +- .../built-ins/Math/atanh/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/cbrt/length.js | 11 +- js/src/tests/test262/built-ins/Math/cbrt/name.js | 11 +- .../built-ins/Math/cbrt/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/ceil/length.js | 11 +- js/src/tests/test262/built-ins/Math/ceil/name.js | 11 +- .../built-ins/Math/ceil/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Math/clz32/length.js | 11 +- js/src/tests/test262/built-ins/Math/clz32/name.js | 11 +- .../built-ins/Math/clz32/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/cos/length.js | 11 +- js/src/tests/test262/built-ins/Math/cos/name.js | 11 +- .../built-ins/Math/cos/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/cosh/length.js | 11 +- js/src/tests/test262/built-ins/Math/cosh/name.js | 11 +- .../built-ins/Math/cosh/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/exp/length.js | 11 +- js/src/tests/test262/built-ins/Math/exp/name.js | 11 +- .../built-ins/Math/exp/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Math/expm1/length.js | 11 +- js/src/tests/test262/built-ins/Math/expm1/name.js | 11 +- .../built-ins/Math/expm1/not-a-constructor.js | 2 +- .../test262/built-ins/Math/f16round/browser.js | 0 .../test262/built-ins/Math/f16round/length.js | 20 + .../tests/test262/built-ins/Math/f16round/name.js | 20 + .../built-ins/Math/f16round/not-a-constructor.js | 19 + .../test262/built-ins/Math/f16round/prop-desc.js | 17 + .../tests/test262/built-ins/Math/f16round/shell.js | 680 +++++++++++++++++++++ .../built-ins/Math/f16round/value-conversion.js | 28 + .../tests/test262/built-ins/Math/floor/length.js | 11 +- js/src/tests/test262/built-ins/Math/floor/name.js | 11 +- .../built-ins/Math/floor/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Math/fround/length.js | 11 +- js/src/tests/test262/built-ins/Math/fround/name.js | 11 +- .../built-ins/Math/fround/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Math/hypot/length.js | 11 +- js/src/tests/test262/built-ins/Math/hypot/name.js | 11 +- .../built-ins/Math/hypot/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/imul/length.js | 11 +- js/src/tests/test262/built-ins/Math/imul/name.js | 11 +- .../built-ins/Math/imul/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/log/length.js | 11 +- js/src/tests/test262/built-ins/Math/log/name.js | 11 +- .../built-ins/Math/log/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Math/log10/length.js | 11 +- js/src/tests/test262/built-ins/Math/log10/name.js | 11 +- .../built-ins/Math/log10/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Math/log1p/length.js | 11 +- js/src/tests/test262/built-ins/Math/log1p/name.js | 11 +- .../built-ins/Math/log1p/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/log2/length.js | 11 +- js/src/tests/test262/built-ins/Math/log2/name.js | 11 +- .../built-ins/Math/log2/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/max/length.js | 11 +- js/src/tests/test262/built-ins/Math/max/name.js | 11 +- .../built-ins/Math/max/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/min/length.js | 11 +- js/src/tests/test262/built-ins/Math/min/name.js | 11 +- .../built-ins/Math/min/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/pow/length.js | 11 +- js/src/tests/test262/built-ins/Math/pow/name.js | 11 +- .../built-ins/Math/pow/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Math/random/length.js | 11 +- js/src/tests/test262/built-ins/Math/random/name.js | 11 +- .../built-ins/Math/random/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Math/round/length.js | 11 +- js/src/tests/test262/built-ins/Math/round/name.js | 11 +- .../built-ins/Math/round/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/sign/length.js | 11 +- js/src/tests/test262/built-ins/Math/sign/name.js | 11 +- .../built-ins/Math/sign/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/sin/length.js | 11 +- js/src/tests/test262/built-ins/Math/sin/name.js | 11 +- .../built-ins/Math/sin/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/sinh/length.js | 11 +- js/src/tests/test262/built-ins/Math/sinh/name.js | 11 +- .../built-ins/Math/sinh/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/sqrt/length.js | 11 +- js/src/tests/test262/built-ins/Math/sqrt/name.js | 11 +- .../built-ins/Math/sqrt/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/tan/length.js | 11 +- js/src/tests/test262/built-ins/Math/tan/name.js | 11 +- .../built-ins/Math/tan/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Math/tanh/length.js | 11 +- js/src/tests/test262/built-ins/Math/tanh/name.js | 11 +- .../built-ins/Math/tanh/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Math/trunc/length.js | 11 +- js/src/tests/test262/built-ins/Math/trunc/name.js | 11 +- .../built-ins/Math/trunc/not-a-constructor.js | 2 +- .../built-ins/NativeErrors/EvalError/length.js | 11 +- .../built-ins/NativeErrors/EvalError/name.js | 11 +- .../NativeErrors/EvalError/prototype/name.js | 11 +- .../built-ins/NativeErrors/RangeError/length.js | 11 +- .../built-ins/NativeErrors/RangeError/name.js | 11 +- .../NativeErrors/RangeError/prototype/name.js | 11 +- .../NativeErrors/ReferenceError/length.js | 11 +- .../built-ins/NativeErrors/ReferenceError/name.js | 11 +- .../NativeErrors/ReferenceError/prototype/name.js | 11 +- .../built-ins/NativeErrors/SyntaxError/length.js | 11 +- .../built-ins/NativeErrors/SyntaxError/name.js | 11 +- .../NativeErrors/SyntaxError/prototype/name.js | 11 +- .../built-ins/NativeErrors/TypeError/length.js | 11 +- .../built-ins/NativeErrors/TypeError/name.js | 11 +- .../NativeErrors/TypeError/prototype/name.js | 11 +- .../built-ins/NativeErrors/URIError/length.js | 11 +- .../built-ins/NativeErrors/URIError/name.js | 11 +- .../NativeErrors/URIError/prototype/name.js | 11 +- .../test262/built-ins/Number/isFinite/length.js | 11 +- .../test262/built-ins/Number/isFinite/name.js | 11 +- .../built-ins/Number/isFinite/not-a-constructor.js | 2 +- .../test262/built-ins/Number/isInteger/length.js | 11 +- .../test262/built-ins/Number/isInteger/name.js | 11 +- .../Number/isInteger/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Number/isNaN/length.js | 11 +- .../tests/test262/built-ins/Number/isNaN/name.js | 11 +- .../built-ins/Number/isNaN/not-a-constructor.js | 2 +- .../built-ins/Number/isSafeInteger/length.js | 11 +- .../test262/built-ins/Number/isSafeInteger/name.js | 11 +- .../Number/isSafeInteger/not-a-constructor.js | 2 +- .../Number/parseFloat/not-a-constructor.js | 2 +- .../built-ins/Number/parseInt/not-a-constructor.js | 2 +- .../Number/prototype/toExponential/length.js | 11 +- .../Number/prototype/toExponential/name.js | 11 +- .../prototype/toExponential/not-a-constructor.js | 2 +- .../built-ins/Number/prototype/toFixed/length.js | 11 +- .../built-ins/Number/prototype/toFixed/name.js | 11 +- .../Number/prototype/toFixed/not-a-constructor.js | 2 +- .../Number/prototype/toLocaleString/length.js | 11 +- .../Number/prototype/toLocaleString/name.js | 11 +- .../prototype/toLocaleString/not-a-constructor.js | 2 +- .../Number/prototype/toPrecision/length.js | 11 +- .../built-ins/Number/prototype/toPrecision/name.js | 11 +- .../prototype/toPrecision/not-a-constructor.js | 2 +- .../built-ins/Number/prototype/toString/length.js | 11 +- .../built-ins/Number/prototype/toString/name.js | 11 +- .../Number/prototype/toString/not-a-constructor.js | 2 +- .../built-ins/Number/prototype/valueOf/length.js | 11 +- .../built-ins/Number/prototype/valueOf/name.js | 11 +- .../Number/prototype/valueOf/not-a-constructor.js | 2 +- .../built-ins/Object/assign/assign-descriptor.js | 8 +- .../built-ins/Object/assign/assign-length.js | 13 +- .../tests/test262/built-ins/Object/assign/name.js | 15 +- .../built-ins/Object/assign/not-a-constructor.js | 2 +- .../built-ins/Object/create/15.2.3.5-4-100.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-101.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-103.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-104.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-107.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-108.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-109.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-110.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-111.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-125.js | 6 +- .../built-ins/Object/create/15.2.3.5-4-126.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-128.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-129.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-130.js | 6 +- .../built-ins/Object/create/15.2.3.5-4-131.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-132.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-135.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-179.js | 6 +- .../built-ins/Object/create/15.2.3.5-4-188.js | 6 +- .../built-ins/Object/create/15.2.3.5-4-189.js | 7 +- .../built-ins/Object/create/15.2.3.5-4-190.js | 6 +- .../built-ins/Object/create/15.2.3.5-4-204.js | 7 +- .../built-ins/Object/create/15.2.3.5-4-205.js | 7 +- .../built-ins/Object/create/15.2.3.5-4-207.js | 7 +- .../built-ins/Object/create/15.2.3.5-4-208.js | 7 +- .../built-ins/Object/create/15.2.3.5-4-209.js | 7 +- .../built-ins/Object/create/15.2.3.5-4-210.js | 7 +- .../built-ins/Object/create/15.2.3.5-4-211.js | 7 +- .../built-ins/Object/create/15.2.3.5-4-214.js | 7 +- .../built-ins/Object/create/15.2.3.5-4-307.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-309.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-311.js | 20 +- .../built-ins/Object/create/15.2.3.5-4-313.js | 5 +- .../built-ins/Object/create/15.2.3.5-4-315.js | 20 +- .../tests/test262/built-ins/Object/create/name.js | 11 +- .../built-ins/Object/create/not-a-constructor.js | 2 +- .../Object/defineProperties/15.2.3.7-5-b-138.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-139.js | 4 +- .../Object/defineProperties/15.2.3.7-5-b-140.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-141.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-142.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-143.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-144.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-146.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-147.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-148.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-149.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-150.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-151.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-152.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-153.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-154.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-155.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-156.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-157.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-158.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-159.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-160.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-161.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-163.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-164.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-165.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-167.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-168.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-169.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-170.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-171.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-174.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-60.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-63.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-64.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-67.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-68.js | 6 +- .../Object/defineProperties/15.2.3.7-5-b-69.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-70.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-71.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-85.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-86.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-88.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-89.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-90.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-91.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-92.js | 5 +- .../Object/defineProperties/15.2.3.7-5-b-95.js | 5 +- .../Object/defineProperties/15.2.3.7-6-a-100.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-101.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-102.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-103.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-104.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-105.js | 20 +- .../Object/defineProperties/15.2.3.7-6-a-106.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-107.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-108.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-109.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-110.js | 18 +- .../Object/defineProperties/15.2.3.7-6-a-114-b.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-114.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-115.js | 9 +- .../Object/defineProperties/15.2.3.7-6-a-12.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-120.js | 13 +- .../Object/defineProperties/15.2.3.7-6-a-13.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-14.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-15.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-16.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-163.js | 6 +- .../Object/defineProperties/15.2.3.7-6-a-164.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-176.js | 15 +- .../Object/defineProperties/15.2.3.7-6-a-177.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-18.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-19.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-195.js | 13 +- .../Object/defineProperties/15.2.3.7-6-a-197.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-199.js | 6 +- .../Object/defineProperties/15.2.3.7-6-a-2.js | 13 +- .../Object/defineProperties/15.2.3.7-6-a-200.js | 13 +- .../Object/defineProperties/15.2.3.7-6-a-202.js | 19 +- .../Object/defineProperties/15.2.3.7-6-a-204.js | 4 +- .../Object/defineProperties/15.2.3.7-6-a-205.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-206.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-207.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-208.js | 14 +- .../Object/defineProperties/15.2.3.7-6-a-209.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-21.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-210.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-211.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-212.js | 13 +- .../Object/defineProperties/15.2.3.7-6-a-213.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-214.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-215.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-216.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-217.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-218.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-219.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-220.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-221.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-222.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-223.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-224.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-225.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-226.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-227.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-228.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-229.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-230.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-231.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-232.js | 13 +- .../Object/defineProperties/15.2.3.7-6-a-233.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-234.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-235.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-236.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-237.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-238.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-239.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-24.js | 13 +- .../Object/defineProperties/15.2.3.7-6-a-240.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-241.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-242.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-243.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-244.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-245.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-246.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-247.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-248.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-249.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-250.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-251.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-252.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-253.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-254.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-255.js | 6 +- .../Object/defineProperties/15.2.3.7-6-a-256.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-257.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-258.js | 6 +- .../Object/defineProperties/15.2.3.7-6-a-259.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-260.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-261.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-262.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-266.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-267.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-268.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-269.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-270.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-271.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-272.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-273.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-274.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-275.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-276.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-277.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-278.js | 13 +- .../Object/defineProperties/15.2.3.7-6-a-279.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-28.js | 13 +- .../Object/defineProperties/15.2.3.7-6-a-281.js | 13 +- .../Object/defineProperties/15.2.3.7-6-a-282.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-283.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-284.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-285.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-288.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-289.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-290.js | 13 +- .../Object/defineProperties/15.2.3.7-6-a-291.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-292.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-293.js | 13 +- .../Object/defineProperties/15.2.3.7-6-a-294.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-295.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-296.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-297.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-298.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-299.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-30.js | 13 +- .../Object/defineProperties/15.2.3.7-6-a-300.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-301.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-302.js | 13 +- .../Object/defineProperties/15.2.3.7-6-a-303.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-304.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-305.js | 13 +- .../Object/defineProperties/15.2.3.7-6-a-306.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-307.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-308.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-309.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-31.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-310.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-311.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-312.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-313.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-33.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-35.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-36.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-37.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-38-1.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-38.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-39.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-40.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-41.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-42.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-43.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-44.js | 8 +- .../Object/defineProperties/15.2.3.7-6-a-45.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-46.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-47.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-48.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-49.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-5.js | 14 +- .../Object/defineProperties/15.2.3.7-6-a-50.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-51.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-52.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-53.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-54.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-55.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-56.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-57.js | 6 +- .../Object/defineProperties/15.2.3.7-6-a-58.js | 21 +- .../Object/defineProperties/15.2.3.7-6-a-59.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-60.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-61.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-62.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-63.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-64.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-65.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-66-1.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-66.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-67.js | 6 +- .../Object/defineProperties/15.2.3.7-6-a-68.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-69.js | 21 +- .../Object/defineProperties/15.2.3.7-6-a-70.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-71.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-72.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-73.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-74.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-75.js | 8 +- .../Object/defineProperties/15.2.3.7-6-a-76.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-77.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-78.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-79.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-80.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-81.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-82.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-83.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-84-1.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-84.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-85.js | 16 +- .../Object/defineProperties/15.2.3.7-6-a-86-1.js | 14 +- .../Object/defineProperties/15.2.3.7-6-a-86.js | 6 +- .../Object/defineProperties/15.2.3.7-6-a-87.js | 14 +- .../Object/defineProperties/15.2.3.7-6-a-88.js | 20 +- .../Object/defineProperties/15.2.3.7-6-a-89.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-90.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-91.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-92.js | 10 +- .../Object/defineProperties/15.2.3.7-6-a-93-1.js | 30 +- .../Object/defineProperties/15.2.3.7-6-a-93-2.js | 30 +- .../Object/defineProperties/15.2.3.7-6-a-93-3.js | 31 +- .../Object/defineProperties/15.2.3.7-6-a-93-4.js | 30 +- .../Object/defineProperties/15.2.3.7-6-a-93.js | 7 +- .../Object/defineProperties/15.2.3.7-6-a-94.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-95.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-96.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-97.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-98.js | 12 +- .../Object/defineProperties/15.2.3.7-6-a-99.js | 12 +- .../built-ins/Object/defineProperties/name.js | 11 +- .../Object/defineProperties/not-a-constructor.js | 2 +- .../Object/defineProperty/15.2.3.6-3-100.js | 5 +- .../Object/defineProperty/15.2.3.6-3-102.js | 5 +- .../Object/defineProperty/15.2.3.6-3-103.js | 5 +- .../Object/defineProperty/15.2.3.6-3-104.js | 5 +- .../Object/defineProperty/15.2.3.6-3-105.js | 5 +- .../Object/defineProperty/15.2.3.6-3-106.js | 5 +- .../Object/defineProperty/15.2.3.6-3-109.js | 5 +- .../Object/defineProperty/15.2.3.6-3-152.js | 7 +- .../Object/defineProperty/15.2.3.6-3-153.js | 5 +- .../Object/defineProperty/15.2.3.6-3-162.js | 5 +- .../Object/defineProperty/15.2.3.6-3-163.js | 5 +- .../Object/defineProperty/15.2.3.6-3-164.js | 5 +- .../Object/defineProperty/15.2.3.6-3-171-1.js | 4 +- .../Object/defineProperty/15.2.3.6-3-178.js | 5 +- .../Object/defineProperty/15.2.3.6-3-179.js | 5 +- .../Object/defineProperty/15.2.3.6-3-181.js | 5 +- .../Object/defineProperty/15.2.3.6-3-182.js | 5 +- .../Object/defineProperty/15.2.3.6-3-183.js | 5 +- .../Object/defineProperty/15.2.3.6-3-184.js | 5 +- .../Object/defineProperty/15.2.3.6-3-185.js | 9 +- .../Object/defineProperty/15.2.3.6-3-188.js | 5 +- .../Object/defineProperty/15.2.3.6-3-73.js | 5 +- .../Object/defineProperty/15.2.3.6-3-74.js | 5 +- .../Object/defineProperty/15.2.3.6-3-76.js | 11 +- .../Object/defineProperty/15.2.3.6-3-83.js | 5 +- .../Object/defineProperty/15.2.3.6-3-84.js | 5 +- .../Object/defineProperty/15.2.3.6-3-85.js | 7 +- .../Object/defineProperty/15.2.3.6-3-99.js | 5 +- .../Object/defineProperty/15.2.3.6-4-100.js | 12 +- .../Object/defineProperty/15.2.3.6-4-101.js | 12 +- .../Object/defineProperty/15.2.3.6-4-102.js | 12 +- .../Object/defineProperty/15.2.3.6-4-103.js | 12 +- .../Object/defineProperty/15.2.3.6-4-104.js | 12 +- .../Object/defineProperty/15.2.3.6-4-105.js | 13 +- .../Object/defineProperty/15.2.3.6-4-106.js | 12 +- .../Object/defineProperty/15.2.3.6-4-107.js | 7 +- .../Object/defineProperty/15.2.3.6-4-108.js | 7 +- .../Object/defineProperty/15.2.3.6-4-109.js | 7 +- .../Object/defineProperty/15.2.3.6-4-110.js | 7 +- .../Object/defineProperty/15.2.3.6-4-112.js | 7 +- .../Object/defineProperty/15.2.3.6-4-113.js | 7 +- .../Object/defineProperty/15.2.3.6-4-114.js | 7 +- .../Object/defineProperty/15.2.3.6-4-115.js | 7 +- .../Object/defineProperty/15.2.3.6-4-118.js | 9 +- .../Object/defineProperty/15.2.3.6-4-119.js | 9 +- .../Object/defineProperty/15.2.3.6-4-124.js | 12 +- .../Object/defineProperty/15.2.3.6-4-167.js | 7 +- .../Object/defineProperty/15.2.3.6-4-181.js | 8 +- .../Object/defineProperty/15.2.3.6-4-190.js | 15 +- .../Object/defineProperty/15.2.3.6-4-194.js | 10 +- .../Object/defineProperty/15.2.3.6-4-195.js | 7 +- .../Object/defineProperty/15.2.3.6-4-199.js | 13 +- .../Object/defineProperty/15.2.3.6-4-200.js | 13 +- .../Object/defineProperty/15.2.3.6-4-201.js | 12 +- .../Object/defineProperty/15.2.3.6-4-202.js | 12 +- .../Object/defineProperty/15.2.3.6-4-203.js | 12 +- .../Object/defineProperty/15.2.3.6-4-204.js | 13 +- .../Object/defineProperty/15.2.3.6-4-205.js | 7 +- .../Object/defineProperty/15.2.3.6-4-207.js | 7 +- .../Object/defineProperty/15.2.3.6-4-208.js | 7 +- .../Object/defineProperty/15.2.3.6-4-209.js | 7 +- .../Object/defineProperty/15.2.3.6-4-210.js | 12 +- .../Object/defineProperty/15.2.3.6-4-211.js | 7 +- .../Object/defineProperty/15.2.3.6-4-212.js | 13 +- .../Object/defineProperty/15.2.3.6-4-213.js | 7 +- .../Object/defineProperty/15.2.3.6-4-214.js | 16 +- .../Object/defineProperty/15.2.3.6-4-215.js | 12 +- .../Object/defineProperty/15.2.3.6-4-216.js | 12 +- .../Object/defineProperty/15.2.3.6-4-217.js | 12 +- .../Object/defineProperty/15.2.3.6-4-218.js | 16 +- .../Object/defineProperty/15.2.3.6-4-219.js | 16 +- .../Object/defineProperty/15.2.3.6-4-220.js | 12 +- .../Object/defineProperty/15.2.3.6-4-221.js | 16 +- .../Object/defineProperty/15.2.3.6-4-222.js | 12 +- .../Object/defineProperty/15.2.3.6-4-223.js | 16 +- .../Object/defineProperty/15.2.3.6-4-224.js | 12 +- .../Object/defineProperty/15.2.3.6-4-225.js | 16 +- .../Object/defineProperty/15.2.3.6-4-226.js | 11 +- .../Object/defineProperty/15.2.3.6-4-227.js | 16 +- .../Object/defineProperty/15.2.3.6-4-228.js | 12 +- .../Object/defineProperty/15.2.3.6-4-229.js | 12 +- .../Object/defineProperty/15.2.3.6-4-230.js | 7 +- .../Object/defineProperty/15.2.3.6-4-231.js | 7 +- .../Object/defineProperty/15.2.3.6-4-232.js | 7 +- .../Object/defineProperty/15.2.3.6-4-233.js | 7 +- .../Object/defineProperty/15.2.3.6-4-234.js | 12 +- .../Object/defineProperty/15.2.3.6-4-235.js | 12 +- .../Object/defineProperty/15.2.3.6-4-236.js | 12 +- .../Object/defineProperty/15.2.3.6-4-237.js | 12 +- .../Object/defineProperty/15.2.3.6-4-238.js | 17 +- .../Object/defineProperty/15.2.3.6-4-239.js | 17 +- .../Object/defineProperty/15.2.3.6-4-240.js | 10 +- .../Object/defineProperty/15.2.3.6-4-241.js | 17 +- .../Object/defineProperty/15.2.3.6-4-242-1.js | 13 +- .../Object/defineProperty/15.2.3.6-4-242.js | 7 +- .../Object/defineProperty/15.2.3.6-4-243-1.js | 7 +- .../defineProperty/15.2.3.6-4-243-2-strict.js | 7 +- .../Object/defineProperty/15.2.3.6-4-243.js | 13 +- .../Object/defineProperty/15.2.3.6-4-244.js | 18 +- .../Object/defineProperty/15.2.3.6-4-245.js | 16 +- .../Object/defineProperty/15.2.3.6-4-246.js | 17 +- .../Object/defineProperty/15.2.3.6-4-247.js | 16 +- .../Object/defineProperty/15.2.3.6-4-248.js | 16 +- .../Object/defineProperty/15.2.3.6-4-249.js | 16 +- .../Object/defineProperty/15.2.3.6-4-250.js | 16 +- .../Object/defineProperty/15.2.3.6-4-251.js | 16 +- .../Object/defineProperty/15.2.3.6-4-252.js | 10 +- .../Object/defineProperty/15.2.3.6-4-253.js | 10 +- .../Object/defineProperty/15.2.3.6-4-254.js | 6 +- .../Object/defineProperty/15.2.3.6-4-255.js | 8 +- .../Object/defineProperty/15.2.3.6-4-256.js | 6 +- .../Object/defineProperty/15.2.3.6-4-257.js | 7 +- .../Object/defineProperty/15.2.3.6-4-258.js | 12 +- .../Object/defineProperty/15.2.3.6-4-259.js | 12 +- .../Object/defineProperty/15.2.3.6-4-260.js | 12 +- .../Object/defineProperty/15.2.3.6-4-261.js | 12 +- .../Object/defineProperty/15.2.3.6-4-262.js | 12 +- .../Object/defineProperty/15.2.3.6-4-263.js | 12 +- .../Object/defineProperty/15.2.3.6-4-264.js | 12 +- .../Object/defineProperty/15.2.3.6-4-265.js | 7 +- .../Object/defineProperty/15.2.3.6-4-266.js | 6 +- .../Object/defineProperty/15.2.3.6-4-267.js | 7 +- .../Object/defineProperty/15.2.3.6-4-268.js | 7 +- .../Object/defineProperty/15.2.3.6-4-269.js | 6 +- .../Object/defineProperty/15.2.3.6-4-270.js | 7 +- .../Object/defineProperty/15.2.3.6-4-271.js | 7 +- .../Object/defineProperty/15.2.3.6-4-272.js | 7 +- .../Object/defineProperty/15.2.3.6-4-273.js | 7 +- .../Object/defineProperty/15.2.3.6-4-277.js | 13 +- .../Object/defineProperty/15.2.3.6-4-278.js | 7 +- .../Object/defineProperty/15.2.3.6-4-279.js | 7 +- .../Object/defineProperty/15.2.3.6-4-280.js | 13 +- .../Object/defineProperty/15.2.3.6-4-281.js | 16 +- .../Object/defineProperty/15.2.3.6-4-282.js | 16 +- .../Object/defineProperty/15.2.3.6-4-283.js | 16 +- .../Object/defineProperty/15.2.3.6-4-284.js | 16 +- .../Object/defineProperty/15.2.3.6-4-285.js | 10 +- .../Object/defineProperty/15.2.3.6-4-286.js | 10 +- .../Object/defineProperty/15.2.3.6-4-287.js | 10 +- .../Object/defineProperty/15.2.3.6-4-288.js | 10 +- .../Object/defineProperty/15.2.3.6-4-289-1.js | 13 +- .../Object/defineProperty/15.2.3.6-4-289.js | 12 +- .../Object/defineProperty/15.2.3.6-4-290-1.js | 7 +- .../Object/defineProperty/15.2.3.6-4-290.js | 7 +- .../Object/defineProperty/15.2.3.6-4-291-1.js | 7 +- .../Object/defineProperty/15.2.3.6-4-291.js | 7 +- .../Object/defineProperty/15.2.3.6-4-292-1.js | 13 +- .../defineProperty/15.2.3.6-4-292-2-strict.js | 13 +- .../Object/defineProperty/15.2.3.6-4-292.js | 12 +- .../Object/defineProperty/15.2.3.6-4-293-1.js | 12 +- .../Object/defineProperty/15.2.3.6-4-293-2.js | 17 +- .../Object/defineProperty/15.2.3.6-4-293-3.js | 13 +- .../defineProperty/15.2.3.6-4-293-4-strict.js | 13 +- .../Object/defineProperty/15.2.3.6-4-293.js | 16 +- .../Object/defineProperty/15.2.3.6-4-294-1.js | 15 +- .../Object/defineProperty/15.2.3.6-4-294.js | 16 +- .../Object/defineProperty/15.2.3.6-4-295-1.js | 15 +- .../Object/defineProperty/15.2.3.6-4-295.js | 16 +- .../Object/defineProperty/15.2.3.6-4-296-1.js | 15 +- .../Object/defineProperty/15.2.3.6-4-296.js | 16 +- .../Object/defineProperty/15.2.3.6-4-297-1.js | 10 +- .../Object/defineProperty/15.2.3.6-4-297.js | 10 +- .../Object/defineProperty/15.2.3.6-4-298-1.js | 10 +- .../Object/defineProperty/15.2.3.6-4-298.js | 10 +- .../Object/defineProperty/15.2.3.6-4-299-1.js | 10 +- .../Object/defineProperty/15.2.3.6-4-299.js | 10 +- .../Object/defineProperty/15.2.3.6-4-300-1.js | 10 +- .../Object/defineProperty/15.2.3.6-4-300.js | 10 +- .../Object/defineProperty/15.2.3.6-4-301-1.js | 12 +- .../Object/defineProperty/15.2.3.6-4-301.js | 12 +- .../Object/defineProperty/15.2.3.6-4-302-1.js | 7 +- .../Object/defineProperty/15.2.3.6-4-302.js | 7 +- .../Object/defineProperty/15.2.3.6-4-303.js | 7 +- .../Object/defineProperty/15.2.3.6-4-304.js | 12 +- .../Object/defineProperty/15.2.3.6-4-305.js | 16 +- .../Object/defineProperty/15.2.3.6-4-306.js | 16 +- .../Object/defineProperty/15.2.3.6-4-307.js | 16 +- .../Object/defineProperty/15.2.3.6-4-308.js | 16 +- .../Object/defineProperty/15.2.3.6-4-309.js | 10 +- .../Object/defineProperty/15.2.3.6-4-310.js | 10 +- .../Object/defineProperty/15.2.3.6-4-311.js | 10 +- .../Object/defineProperty/15.2.3.6-4-312.js | 10 +- .../Object/defineProperty/15.2.3.6-4-313-1.js | 12 +- .../Object/defineProperty/15.2.3.6-4-313.js | 12 +- .../Object/defineProperty/15.2.3.6-4-314-1.js | 7 +- .../Object/defineProperty/15.2.3.6-4-314.js | 7 +- .../Object/defineProperty/15.2.3.6-4-315-1.js | 7 +- .../Object/defineProperty/15.2.3.6-4-315.js | 7 +- .../Object/defineProperty/15.2.3.6-4-316-1.js | 12 +- .../Object/defineProperty/15.2.3.6-4-316.js | 12 +- .../Object/defineProperty/15.2.3.6-4-317-1.js | 16 +- .../Object/defineProperty/15.2.3.6-4-317.js | 16 +- .../Object/defineProperty/15.2.3.6-4-318-1.js | 16 +- .../Object/defineProperty/15.2.3.6-4-318.js | 16 +- .../Object/defineProperty/15.2.3.6-4-319-1.js | 17 +- .../Object/defineProperty/15.2.3.6-4-319.js | 16 +- .../Object/defineProperty/15.2.3.6-4-320-1.js | 16 +- .../Object/defineProperty/15.2.3.6-4-320.js | 16 +- .../Object/defineProperty/15.2.3.6-4-321-1.js | 10 +- .../Object/defineProperty/15.2.3.6-4-321.js | 10 +- .../Object/defineProperty/15.2.3.6-4-322-1.js | 10 +- .../Object/defineProperty/15.2.3.6-4-322.js | 10 +- .../Object/defineProperty/15.2.3.6-4-323-1.js | 9 +- .../Object/defineProperty/15.2.3.6-4-323.js | 10 +- .../Object/defineProperty/15.2.3.6-4-324-1.js | 10 +- .../Object/defineProperty/15.2.3.6-4-324.js | 11 +- .../Object/defineProperty/15.2.3.6-4-333-1.js | 13 +- .../Object/defineProperty/15.2.3.6-4-333-2.js | 13 +- .../Object/defineProperty/15.2.3.6-4-333-3.js | 13 +- .../Object/defineProperty/15.2.3.6-4-333-6.js | 13 +- .../Object/defineProperty/15.2.3.6-4-333-7.js | 13 +- .../Object/defineProperty/15.2.3.6-4-333-8.js | 13 +- .../Object/defineProperty/15.2.3.6-4-335.js | 7 +- .../Object/defineProperty/15.2.3.6-4-349.js | 7 +- .../Object/defineProperty/15.2.3.6-4-354-1.js | 13 +- .../Object/defineProperty/15.2.3.6-4-354-10.js | 13 +- .../Object/defineProperty/15.2.3.6-4-354-11.js | 13 +- .../Object/defineProperty/15.2.3.6-4-354-12.js | 13 +- .../Object/defineProperty/15.2.3.6-4-354-15.js | 6 +- .../Object/defineProperty/15.2.3.6-4-354-16.js | 6 +- .../Object/defineProperty/15.2.3.6-4-354-2.js | 13 +- .../Object/defineProperty/15.2.3.6-4-354-3.js | 13 +- .../Object/defineProperty/15.2.3.6-4-354-6.js | 6 +- .../Object/defineProperty/15.2.3.6-4-354-7.js | 6 +- .../Object/defineProperty/15.2.3.6-4-354.js | 6 +- .../Object/defineProperty/15.2.3.6-4-361.js | 6 +- .../Object/defineProperty/15.2.3.6-4-363.js | 5 +- .../Object/defineProperty/15.2.3.6-4-368.js | 6 +- .../Object/defineProperty/15.2.3.6-4-375.js | 6 +- .../Object/defineProperty/15.2.3.6-4-377.js | 5 +- .../Object/defineProperty/15.2.3.6-4-38.js | 13 +- .../Object/defineProperty/15.2.3.6-4-41.js | 13 +- .../Object/defineProperty/15.2.3.6-4-429.js | 8 +- .../Object/defineProperty/15.2.3.6-4-434.js | 10 +- .../Object/defineProperty/15.2.3.6-4-438.js | 11 +- .../Object/defineProperty/15.2.3.6-4-447.js | 8 +- .../Object/defineProperty/15.2.3.6-4-45.js | 13 +- .../Object/defineProperty/15.2.3.6-4-452.js | 10 +- .../Object/defineProperty/15.2.3.6-4-456.js | 11 +- .../Object/defineProperty/15.2.3.6-4-465.js | 8 +- .../Object/defineProperty/15.2.3.6-4-47.js | 13 +- .../Object/defineProperty/15.2.3.6-4-470.js | 9 +- .../Object/defineProperty/15.2.3.6-4-474.js | 11 +- .../Object/defineProperty/15.2.3.6-4-48.js | 13 +- .../Object/defineProperty/15.2.3.6-4-483.js | 9 +- .../Object/defineProperty/15.2.3.6-4-488.js | 11 +- .../Object/defineProperty/15.2.3.6-4-49.js | 12 +- .../Object/defineProperty/15.2.3.6-4-492.js | 11 +- .../Object/defineProperty/15.2.3.6-4-50.js | 12 +- .../Object/defineProperty/15.2.3.6-4-501.js | 8 +- .../Object/defineProperty/15.2.3.6-4-506.js | 12 +- .../Object/defineProperty/15.2.3.6-4-51.js | 13 +- .../Object/defineProperty/15.2.3.6-4-510.js | 11 +- .../Object/defineProperty/15.2.3.6-4-519.js | 9 +- .../Object/defineProperty/15.2.3.6-4-52.js | 13 +- .../Object/defineProperty/15.2.3.6-4-524.js | 11 +- .../Object/defineProperty/15.2.3.6-4-528.js | 11 +- .../Object/defineProperty/15.2.3.6-4-53.js | 7 +- .../Object/defineProperty/15.2.3.6-4-531-1.js | 7 +- .../Object/defineProperty/15.2.3.6-4-531-10.js | 7 +- .../Object/defineProperty/15.2.3.6-4-531-11.js | 7 +- .../Object/defineProperty/15.2.3.6-4-531-12.js | 7 +- .../Object/defineProperty/15.2.3.6-4-531-2.js | 7 +- .../Object/defineProperty/15.2.3.6-4-531-3.js | 7 +- .../Object/defineProperty/15.2.3.6-4-537.js | 8 +- .../Object/defineProperty/15.2.3.6-4-538-1.js | 7 +- .../Object/defineProperty/15.2.3.6-4-538-2.js | 7 +- .../Object/defineProperty/15.2.3.6-4-538-5.js | 7 +- .../Object/defineProperty/15.2.3.6-4-538-6.js | 7 +- .../Object/defineProperty/15.2.3.6-4-538.js | 7 +- .../Object/defineProperty/15.2.3.6-4-54.js | 6 +- .../Object/defineProperty/15.2.3.6-4-540-1.js | 19 +- .../Object/defineProperty/15.2.3.6-4-540-2.js | 19 +- .../Object/defineProperty/15.2.3.6-4-540-3.js | 19 +- .../Object/defineProperty/15.2.3.6-4-540-6.js | 20 +- .../Object/defineProperty/15.2.3.6-4-540-7.js | 20 +- .../Object/defineProperty/15.2.3.6-4-540-8.js | 19 +- .../Object/defineProperty/15.2.3.6-4-542.js | 5 +- .../Object/defineProperty/15.2.3.6-4-546.js | 11 +- .../Object/defineProperty/15.2.3.6-4-547-1.js | 11 +- .../Object/defineProperty/15.2.3.6-4-547-2.js | 11 +- .../Object/defineProperty/15.2.3.6-4-547-3.js | 9 +- .../Object/defineProperty/15.2.3.6-4-547-4.js | 11 +- .../Object/defineProperty/15.2.3.6-4-55.js | 7 +- .../Object/defineProperty/15.2.3.6-4-555.js | 4 +- .../Object/defineProperty/15.2.3.6-4-56.js | 7 +- .../Object/defineProperty/15.2.3.6-4-560.js | 5 +- .../Object/defineProperty/15.2.3.6-4-564.js | 7 +- .../Object/defineProperty/15.2.3.6-4-57.js | 7 +- .../Object/defineProperty/15.2.3.6-4-58.js | 12 +- .../Object/defineProperty/15.2.3.6-4-59.js | 7 +- .../Object/defineProperty/15.2.3.6-4-60.js | 12 +- .../Object/defineProperty/15.2.3.6-4-61.js | 12 +- .../Object/defineProperty/15.2.3.6-4-611.js | 32 +- .../Object/defineProperty/15.2.3.6-4-612.js | 32 +- .../Object/defineProperty/15.2.3.6-4-613.js | 32 +- .../Object/defineProperty/15.2.3.6-4-614.js | 32 +- .../Object/defineProperty/15.2.3.6-4-615.js | 32 +- .../Object/defineProperty/15.2.3.6-4-616.js | 32 +- .../Object/defineProperty/15.2.3.6-4-617.js | 32 +- .../Object/defineProperty/15.2.3.6-4-618.js | 32 +- .../Object/defineProperty/15.2.3.6-4-619.js | 32 +- .../Object/defineProperty/15.2.3.6-4-62.js | 12 +- .../Object/defineProperty/15.2.3.6-4-620.js | 32 +- .../Object/defineProperty/15.2.3.6-4-621.js | 32 +- .../Object/defineProperty/15.2.3.6-4-622.js | 31 +- .../Object/defineProperty/15.2.3.6-4-623.js | 32 +- .../Object/defineProperty/15.2.3.6-4-624.js | 32 +- .../Object/defineProperty/15.2.3.6-4-63.js | 13 +- .../Object/defineProperty/15.2.3.6-4-64.js | 16 +- .../Object/defineProperty/15.2.3.6-4-65.js | 16 +- .../Object/defineProperty/15.2.3.6-4-66.js | 12 +- .../Object/defineProperty/15.2.3.6-4-67.js | 12 +- .../Object/defineProperty/15.2.3.6-4-68.js | 12 +- .../Object/defineProperty/15.2.3.6-4-69.js | 12 +- .../Object/defineProperty/15.2.3.6-4-70.js | 12 +- .../Object/defineProperty/15.2.3.6-4-71.js | 12 +- .../Object/defineProperty/15.2.3.6-4-72.js | 12 +- .../Object/defineProperty/15.2.3.6-4-73.js | 12 +- .../Object/defineProperty/15.2.3.6-4-74.js | 12 +- .../Object/defineProperty/15.2.3.6-4-75.js | 7 +- .../Object/defineProperty/15.2.3.6-4-76.js | 7 +- .../Object/defineProperty/15.2.3.6-4-77.js | 7 +- .../Object/defineProperty/15.2.3.6-4-78.js | 7 +- .../Object/defineProperty/15.2.3.6-4-79.js | 12 +- .../Object/defineProperty/15.2.3.6-4-80.js | 12 +- .../Object/defineProperty/15.2.3.6-4-81.js | 12 +- .../Object/defineProperty/15.2.3.6-4-82-1.js | 13 +- .../Object/defineProperty/15.2.3.6-4-82-10.js | 7 +- .../Object/defineProperty/15.2.3.6-4-82-11.js | 7 +- .../Object/defineProperty/15.2.3.6-4-82-12.js | 7 +- .../Object/defineProperty/15.2.3.6-4-82-13.js | 13 +- .../Object/defineProperty/15.2.3.6-4-82-14.js | 13 +- .../Object/defineProperty/15.2.3.6-4-82-15.js | 13 +- .../Object/defineProperty/15.2.3.6-4-82-16.js | 13 +- .../Object/defineProperty/15.2.3.6-4-82-17.js | 13 +- .../Object/defineProperty/15.2.3.6-4-82-18.js | 13 +- .../Object/defineProperty/15.2.3.6-4-82-19.js | 7 +- .../Object/defineProperty/15.2.3.6-4-82-2.js | 13 +- .../Object/defineProperty/15.2.3.6-4-82-20.js | 7 +- .../Object/defineProperty/15.2.3.6-4-82-21.js | 7 +- .../Object/defineProperty/15.2.3.6-4-82-22.js | 7 +- .../Object/defineProperty/15.2.3.6-4-82-23.js | 7 +- .../Object/defineProperty/15.2.3.6-4-82-24.js | 7 +- .../Object/defineProperty/15.2.3.6-4-82-3.js | 13 +- .../Object/defineProperty/15.2.3.6-4-82-4.js | 13 +- .../Object/defineProperty/15.2.3.6-4-82-5.js | 13 +- .../Object/defineProperty/15.2.3.6-4-82-6.js | 13 +- .../Object/defineProperty/15.2.3.6-4-82-7.js | 7 +- .../Object/defineProperty/15.2.3.6-4-82-8.js | 7 +- .../Object/defineProperty/15.2.3.6-4-82-9.js | 7 +- .../Object/defineProperty/15.2.3.6-4-82.js | 12 +- .../Object/defineProperty/15.2.3.6-4-83.js | 12 +- .../Object/defineProperty/15.2.3.6-4-84.js | 12 +- .../Object/defineProperty/15.2.3.6-4-85.js | 13 +- .../Object/defineProperty/15.2.3.6-4-86.js | 16 +- .../Object/defineProperty/15.2.3.6-4-87.js | 16 +- .../Object/defineProperty/15.2.3.6-4-88.js | 12 +- .../Object/defineProperty/15.2.3.6-4-89.js | 16 +- .../Object/defineProperty/15.2.3.6-4-90.js | 12 +- .../Object/defineProperty/15.2.3.6-4-91.js | 16 +- .../Object/defineProperty/15.2.3.6-4-92.js | 12 +- .../Object/defineProperty/15.2.3.6-4-93.js | 16 +- .../Object/defineProperty/15.2.3.6-4-94.js | 12 +- .../Object/defineProperty/15.2.3.6-4-95.js | 16 +- .../Object/defineProperty/15.2.3.6-4-96.js | 7 +- .../Object/defineProperty/15.2.3.6-4-97.js | 10 +- .../Object/defineProperty/15.2.3.6-4-98.js | 7 +- .../Object/defineProperty/15.2.3.6-4-99.js | 10 +- .../built-ins/Object/defineProperty/name.js | 11 +- .../Object/defineProperty/not-a-constructor.js | 2 +- .../built-ins/Object/entries/function-length.js | 11 +- .../built-ins/Object/entries/function-name.js | 15 +- .../Object/entries/function-property-descriptor.js | 8 +- .../built-ins/Object/entries/not-a-constructor.js | 2 +- .../built-ins/Object/freeze/15.2.3.9-2-4.js | 7 +- .../built-ins/Object/freeze/15.2.3.9-2-a-1.js | 9 +- .../built-ins/Object/freeze/15.2.3.9-2-a-10.js | 9 +- .../built-ins/Object/freeze/15.2.3.9-2-a-11.js | 10 +- .../built-ins/Object/freeze/15.2.3.9-2-a-12.js | 9 +- .../built-ins/Object/freeze/15.2.3.9-2-a-13.js | 9 +- .../built-ins/Object/freeze/15.2.3.9-2-a-14.js | 8 +- .../built-ins/Object/freeze/15.2.3.9-2-a-2.js | 9 +- .../built-ins/Object/freeze/15.2.3.9-2-a-3.js | 8 +- .../built-ins/Object/freeze/15.2.3.9-2-a-4.js | 5 +- .../built-ins/Object/freeze/15.2.3.9-2-a-5.js | 5 +- .../built-ins/Object/freeze/15.2.3.9-2-a-6.js | 5 +- .../built-ins/Object/freeze/15.2.3.9-2-a-7.js | 8 +- .../built-ins/Object/freeze/15.2.3.9-2-a-8.js | 8 +- .../built-ins/Object/freeze/15.2.3.9-2-a-9.js | 9 +- .../built-ins/Object/freeze/15.2.3.9-2-b-i-1.js | 22 +- .../built-ins/Object/freeze/15.2.3.9-2-b-i-2.js | 45 +- .../built-ins/Object/freeze/15.2.3.9-2-c-1.js | 22 +- .../built-ins/Object/freeze/15.2.3.9-2-c-2.js | 13 +- .../built-ins/Object/freeze/15.2.3.9-2-c-3.js | 32 +- .../built-ins/Object/freeze/15.2.3.9-2-c-4.js | 29 +- .../tests/test262/built-ins/Object/freeze/name.js | 11 +- .../built-ins/Object/freeze/not-a-constructor.js | 2 +- .../Object/fromEntries/not-a-constructor.js | 2 +- .../Object/getOwnPropertyDescriptor/name.js | 11 +- .../getOwnPropertyDescriptor/not-a-constructor.js | 2 +- .../getOwnPropertyDescriptors/function-length.js | 11 +- .../getOwnPropertyDescriptors/function-name.js | 15 +- .../function-property-descriptor.js | 8 +- .../getOwnPropertyDescriptors/not-a-constructor.js | 2 +- .../built-ins/Object/getOwnPropertyNames/name.js | 11 +- .../getOwnPropertyNames/not-a-constructor.js | 2 +- .../Object/getOwnPropertySymbols/length.js | 11 +- .../built-ins/Object/getOwnPropertySymbols/name.js | 11 +- .../getOwnPropertySymbols/not-a-constructor.js | 2 +- .../built-ins/Object/getPrototypeOf/name.js | 11 +- .../Object/getPrototypeOf/not-a-constructor.js | 2 +- .../test262/built-ins/Object/groupBy/string.js | 24 + .../test262/built-ins/Object/hasOwn/descriptor.js | 8 +- .../tests/test262/built-ins/Object/hasOwn/name.js | 11 +- .../built-ins/Object/hasOwn/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Object/is/length.js | 11 +- js/src/tests/test262/built-ins/Object/is/name.js | 11 +- .../built-ins/Object/is/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Object/is/object-is.js | 10 +- .../test262/built-ins/Object/isExtensible/name.js | 11 +- .../Object/isExtensible/not-a-constructor.js | 2 +- .../test262/built-ins/Object/isFrozen/name.js | 11 +- .../built-ins/Object/isFrozen/not-a-constructor.js | 2 +- .../test262/built-ins/Object/isSealed/name.js | 11 +- .../built-ins/Object/isSealed/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Object/keys/name.js | 11 +- .../built-ins/Object/keys/not-a-constructor.js | 2 +- .../built-ins/Object/preventExtensions/name.js | 11 +- .../Object/preventExtensions/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Object/prop-desc.js | 8 +- .../Object/prototype/hasOwnProperty/name.js | 11 +- .../prototype/hasOwnProperty/not-a-constructor.js | 2 +- .../prototype/isPrototypeOf/not-a-constructor.js | 2 +- .../Object/prototype/propertyIsEnumerable/name.js | 11 +- .../propertyIsEnumerable/not-a-constructor.js | 2 +- .../Object/prototype/toLocaleString/name.js | 11 +- .../prototype/toLocaleString/not-a-constructor.js | 2 +- .../Object/prototype/toString/not-a-constructor.js | 2 +- .../Object/prototype/toString/prop-desc.js | 8 +- .../built-ins/Object/prototype/valueOf/name.js | 11 +- .../Object/prototype/valueOf/not-a-constructor.js | 2 +- ...et-from-true-to-false-property-are-unaltered.js | 21 +- ...et-from-true-to-false-property-are-unaltered.js | 7 +- .../tests/test262/built-ins/Object/seal/length.js | 11 +- js/src/tests/test262/built-ins/Object/seal/name.js | 11 +- .../built-ins/Object/seal/not-a-constructor.js | 2 +- ...properties-of-o-are-already-non-configurable.js | 19 +- ...her-attributes-of-the-property-are-unaltered.js | 13 +- ...l-non-enumerable-own-property-of-o-is-sealed.js | 5 +- ...hat-overrides-an-inherited-accessor-property.js | 5 +- ...ty-that-overrides-an-inherited-data-property.js | 5 +- .../seal/object-seal-p-is-own-accessor-property.js | 5 +- ...hat-overrides-an-inherited-accessor-property.js | 6 +- ...ty-that-overrides-an-inherited-data-property.js | 6 +- .../seal/object-seal-p-is-own-data-property.js | 6 +- ...n-object-that-uses-object-s-get-own-property.js | 6 +- ...e-object-that-uses-object-s-get-own-property.js | 6 +- ...n-object-that-uses-object-s-get-own-property.js | 6 +- ...r-object-that-uses-object-s-get-own-property.js | 6 +- ...p-object-that-uses-object-s-get-own-property.js | 6 +- ...ct-which-implements-its-own-get-own-property.js | 6 +- ...ct-which-implements-its-own-get-own-property.js | 6 +- ...y-object-that-uses-object-s-get-own-property.js | 6 +- ...r-object-that-uses-object-s-get-own-property.js | 6 +- .../built-ins/Object/setPrototypeOf/length.js | 15 +- .../built-ins/Object/setPrototypeOf/name.js | 15 +- .../Object/setPrototypeOf/not-a-constructor.js | 2 +- .../Object/setPrototypeOf/property-descriptor.js | 8 +- .../built-ins/Object/values/function-length.js | 11 +- .../built-ins/Object/values/function-name.js | 15 +- .../Object/values/function-property-descriptor.js | 8 +- .../built-ins/Object/values/not-a-constructor.js | 2 +- .../built-ins/Promise/Symbol.species/length.js | 11 +- .../tests/test262/built-ins/Promise/all/length.js | 11 +- js/src/tests/test262/built-ins/Promise/all/name.js | 11 +- .../built-ins/Promise/all/not-a-constructor.js | 2 +- .../Promise/all/resolve-element-function-length.js | 11 +- .../Promise/allSettled/not-a-constructor.js | 2 +- .../built-ins/Promise/any/not-a-constructor.js | 2 +- .../Promise/create-resolving-functions-reject.js | 2 +- .../Promise/create-resolving-functions-resolve.js | 2 +- .../built-ins/Promise/executor-function-length.js | 11 +- .../Promise/executor-function-not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Promise/length.js | 11 +- js/src/tests/test262/built-ins/Promise/name.js | 11 +- .../built-ins/Promise/prototype/catch/length.js | 11 +- .../built-ins/Promise/prototype/catch/name.js | 11 +- .../Promise/prototype/catch/not-a-constructor.js | 2 +- .../finally/invokes-then-with-function.js | 4 +- .../built-ins/Promise/prototype/finally/name.js | 11 +- .../Promise/prototype/finally/not-a-constructor.js | 2 +- .../rejected-observable-then-calls-argument.js | 2 +- .../resolved-observable-then-calls-argument.js | 2 +- .../built-ins/Promise/prototype/then/length.js | 11 +- .../built-ins/Promise/prototype/then/name.js | 11 +- .../Promise/prototype/then/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Promise/race/length.js | 11 +- .../tests/test262/built-ins/Promise/race/name.js | 11 +- .../built-ins/Promise/race/not-a-constructor.js | 2 +- .../built-ins/Promise/reject-function-length.js | 11 +- .../test262/built-ins/Promise/reject/length.js | 11 +- .../tests/test262/built-ins/Promise/reject/name.js | 11 +- .../built-ins/Promise/reject/not-a-constructor.js | 2 +- .../built-ins/Promise/resolve-function-length.js | 11 +- .../test262/built-ins/Promise/resolve/length.js | 11 +- .../test262/built-ins/Promise/resolve/name.js | 11 +- .../built-ins/Promise/resolve/not-a-constructor.js | 2 +- .../Proxy/create-target-is-not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Proxy/length.js | 11 +- js/src/tests/test262/built-ins/Proxy/name.js | 11 +- .../test262/built-ins/Proxy/revocable/length.js | 11 +- .../test262/built-ins/Proxy/revocable/name.js | 11 +- .../built-ins/Proxy/revocable/not-a-constructor.js | 2 +- .../Proxy/revocable/revocation-function-length.js | 11 +- .../revocation-function-not-a-constructor.js | 2 +- .../test262/built-ins/Reflect/apply/length.js | 14 +- .../tests/test262/built-ins/Reflect/apply/name.js | 14 +- .../built-ins/Reflect/apply/not-a-constructor.js | 2 +- .../test262/built-ins/Reflect/construct/length.js | 14 +- .../test262/built-ins/Reflect/construct/name.js | 14 +- .../Reflect/construct/not-a-constructor.js | 2 +- .../built-ins/Reflect/defineProperty/length.js | 14 +- .../built-ins/Reflect/defineProperty/name.js | 14 +- .../Reflect/defineProperty/not-a-constructor.js | 2 +- .../built-ins/Reflect/deleteProperty/length.js | 14 +- .../built-ins/Reflect/deleteProperty/name.js | 14 +- .../Reflect/deleteProperty/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Reflect/get/length.js | 14 +- js/src/tests/test262/built-ins/Reflect/get/name.js | 14 +- .../built-ins/Reflect/get/not-a-constructor.js | 2 +- .../Reflect/getOwnPropertyDescriptor/length.js | 14 +- .../Reflect/getOwnPropertyDescriptor/name.js | 14 +- .../getOwnPropertyDescriptor/not-a-constructor.js | 2 +- .../built-ins/Reflect/getPrototypeOf/length.js | 14 +- .../built-ins/Reflect/getPrototypeOf/name.js | 14 +- .../Reflect/getPrototypeOf/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Reflect/has/length.js | 14 +- js/src/tests/test262/built-ins/Reflect/has/name.js | 14 +- .../built-ins/Reflect/has/not-a-constructor.js | 2 +- .../built-ins/Reflect/isExtensible/length.js | 14 +- .../test262/built-ins/Reflect/isExtensible/name.js | 14 +- .../Reflect/isExtensible/not-a-constructor.js | 2 +- .../test262/built-ins/Reflect/ownKeys/length.js | 14 +- .../test262/built-ins/Reflect/ownKeys/name.js | 14 +- .../built-ins/Reflect/ownKeys/not-a-constructor.js | 2 +- .../built-ins/Reflect/preventExtensions/length.js | 14 +- .../built-ins/Reflect/preventExtensions/name.js | 14 +- .../Reflect/preventExtensions/not-a-constructor.js | 2 +- .../tests/test262/built-ins/Reflect/set/length.js | 14 +- js/src/tests/test262/built-ins/Reflect/set/name.js | 14 +- .../built-ins/Reflect/set/not-a-constructor.js | 2 +- .../built-ins/Reflect/setPrototypeOf/length.js | 14 +- .../built-ins/Reflect/setPrototypeOf/name.js | 14 +- .../Reflect/setPrototypeOf/not-a-constructor.js | 2 +- .../built-ins/RegExp/Symbol.species/length.js | 11 +- .../RegExp/Symbol.species/symbol-species-name.js | 14 +- .../early-err-modifiers-code-point-repeat-i-1.js | 19 + .../early-err-modifiers-code-point-repeat-i-2.js | 19 + ...rly-err-modifiers-other-code-point-arbitrary.js | 19 + ...y-err-modifiers-other-code-point-combining-i.js | 19 + ...y-err-modifiers-other-code-point-combining-m.js | 19 + ...y-err-modifiers-other-code-point-combining-s.js | 19 + .../early-err-modifiers-other-code-point-d.js | 19 + .../early-err-modifiers-other-code-point-g.js | 19 + ...err-modifiers-other-code-point-non-display-1.js | Bin 0 -> 855 bytes ...err-modifiers-other-code-point-non-display-2.js | 19 + ...arly-err-modifiers-other-code-point-non-flag.js | 19 + .../early-err-modifiers-other-code-point-u.js | 19 + ...y-err-modifiers-other-code-point-uppercase-I.js | 19 + .../early-err-modifiers-other-code-point-y.js | 19 + .../early-err-modifiers-other-code-point-zwj.js | 19 + .../early-err-modifiers-other-code-point-zwnbsp.js | 19 + .../early-err-modifiers-other-code-point-zwnj.js | 19 + .../early-err-modifiers-should-not-case-fold-i.js | 19 + .../early-err-modifiers-should-not-case-fold-m.js | 19 + .../early-err-modifiers-should-not-case-fold-s.js | 19 + ...err-modifiers-should-not-unicode-case-fold-i.js | 19 + ...err-modifiers-should-not-unicode-case-fold-s.js | 19 + .../RegExp/prototype/Symbol.match/length.js | 11 +- .../RegExp/prototype/Symbol.match/name.js | 11 +- .../prototype/Symbol.match/not-a-constructor.js | 2 +- .../RegExp/prototype/Symbol.matchAll/length.js | 11 +- .../RegExp/prototype/Symbol.matchAll/name.js | 11 +- .../prototype/Symbol.matchAll/not-a-constructor.js | 2 +- .../RegExp/prototype/Symbol.replace/length.js | 11 +- .../RegExp/prototype/Symbol.replace/name.js | 11 +- .../prototype/Symbol.replace/not-a-constructor.js | 2 +- .../RegExp/prototype/Symbol.search/length.js | 11 +- .../RegExp/prototype/Symbol.search/name.js | 11 +- .../prototype/Symbol.search/not-a-constructor.js | 2 +- .../RegExp/prototype/Symbol.split/length.js | 11 +- .../RegExp/prototype/Symbol.split/name.js | 11 +- .../prototype/Symbol.split/not-a-constructor.js | 2 +- .../built-ins/RegExp/prototype/exec/name.js | 11 +- .../RegExp/prototype/exec/not-a-constructor.js | 2 +- .../built-ins/RegExp/prototype/global/length.js | 11 +- .../built-ins/RegExp/prototype/global/name.js | 14 +- .../RegExp/prototype/ignoreCase/length.js | 11 +- .../built-ins/RegExp/prototype/ignoreCase/name.js | 14 +- .../built-ins/RegExp/prototype/multiline/length.js | 11 +- .../built-ins/RegExp/prototype/multiline/name.js | 14 +- .../built-ins/RegExp/prototype/sticky/length.js | 11 +- .../built-ins/RegExp/prototype/sticky/name.js | 14 +- .../built-ins/RegExp/prototype/test/name.js | 11 +- .../RegExp/prototype/test/not-a-constructor.js | 2 +- .../built-ins/RegExp/prototype/toString/name.js | 11 +- .../RegExp/prototype/toString/not-a-constructor.js | 2 +- .../built-ins/RegExp/prototype/unicode/length.js | 11 +- .../built-ins/RegExp/prototype/unicode/name.js | 11 +- .../add-dotAll-does-not-affect-dotAll-property.js | 49 ++ .../add-dotAll-does-not-affect-ignoreCase-flag.js | 67 ++ .../add-dotAll-does-not-affect-multiline-flag.js | 59 ++ .../RegExp/regexp-modifiers/add-dotAll.js | 105 ++++ .../add-ignoreCase-affects-backreferences.js | 55 ++ .../add-ignoreCase-affects-characterClasses.js | 67 ++ .../add-ignoreCase-affects-characterEscapes.js | 67 ++ .../add-ignoreCase-affects-slash-lower-b.js | 77 +++ .../add-ignoreCase-affects-slash-lower-p.js | 61 ++ .../add-ignoreCase-affects-slash-lower-w.js | 77 +++ .../add-ignoreCase-affects-slash-upper-b.js | 57 ++ .../add-ignoreCase-affects-slash-upper-p.js | 63 ++ .../add-ignoreCase-affects-slash-upper-w.js | 57 ++ .../add-ignoreCase-does-not-affect-dotAll-flag.js | 67 ++ ...noreCase-does-not-affect-ignoreCase-property.js | 55 ++ ...dd-ignoreCase-does-not-affect-multiline-flag.js | 67 ++ .../RegExp/regexp-modifiers/add-ignoreCase.js | 47 ++ .../add-multiline-does-not-affect-dotAll-flag.js | 59 ++ ...dd-multiline-does-not-affect-ignoreCase-flag.js | 67 ++ ...multiline-does-not-affect-multiline-property.js | 49 ++ .../RegExp/regexp-modifiers/add-multiline.js | 49 ++ .../regexp-modifiers/add-remove-modifiers.js | 45 ++ .../built-ins/RegExp/regexp-modifiers/browser.js | 0 ...-dotAll-flag-does-not-affect-dotAll-modifier.js | 77 +++ ...ase-flag-does-not-affect-ignoreCase-modifier.js | 55 ++ ...line-flag-does-not-affect-multiline-modifier.js | 51 ++ .../nested-add-remove-modifiers.js | 45 ++ .../nesting-add-dotAll-within-remove-dotAll.js | 71 +++ ...ting-add-ignoreCase-within-remove-ignoreCase.js | 45 ++ ...esting-add-multiline-within-remove-multiline.js | 47 ++ .../nesting-remove-dotAll-within-add-dotAll.js | 71 +++ ...ting-remove-ignoreCase-within-add-ignoreCase.js | 45 ++ ...esting-remove-multiline-within-add-multiline.js | 47 ++ ...emove-dotAll-does-not-affect-dotAll-property.js | 43 ++ ...emove-dotAll-does-not-affect-ignoreCase-flag.js | 49 ++ ...remove-dotAll-does-not-affect-multiline-flag.js | 49 ++ .../RegExp/regexp-modifiers/remove-dotAll.js | 71 +++ .../remove-ignoreCase-affects-backreferences.js | 43 ++ .../remove-ignoreCase-affects-characterClasses.js | 55 ++ .../remove-ignoreCase-affects-characterEscapes.js | 52 ++ .../remove-ignoreCase-affects-slash-lower-b.js | 53 ++ .../remove-ignoreCase-affects-slash-lower-p.js | 55 ++ .../remove-ignoreCase-affects-slash-lower-w.js | 53 ++ .../remove-ignoreCase-affects-slash-upper-b.js | 53 ++ .../remove-ignoreCase-affects-slash-upper-p.js | 56 ++ .../remove-ignoreCase-affects-slash-upper-w.js | 53 ++ ...emove-ignoreCase-does-not-affect-dotAll-flag.js | 49 ++ ...noreCase-does-not-affect-ignoreCase-property.js | 49 ++ ...ve-ignoreCase-does-not-affect-multiline-flag.js | 49 ++ .../RegExp/regexp-modifiers/remove-ignoreCase.js | 49 ++ ...remove-multiline-does-not-affect-dotAll-flag.js | 49 ++ ...ve-multiline-does-not-affect-ignoreCase-flag.js | 49 ++ ...multiline-does-not-affect-multiline-property.js | 43 ++ .../RegExp/regexp-modifiers/remove-multiline.js | 45 ++ .../built-ins/RegExp/regexp-modifiers/shell.js | 0 .../RegExp/regexp-modifiers/syntax/browser.js | 0 .../RegExp/regexp-modifiers/syntax/shell.js | 0 ...ve-modifiers-can-have-empty-remove-modifiers.js | 68 +++ .../syntax/valid/add-and-remove-modifiers.js | 74 +++ .../syntax/valid/add-modifiers-when-nested.js | 44 ++ .../valid/add-modifiers-when-not-set-as-flags.js | 68 +++ .../valid/add-modifiers-when-set-as-flags.js | 46 ++ .../regexp-modifiers/syntax/valid/browser.js | 0 .../syntax/valid/remove-modifiers-when-nested.js | 44 ++ .../remove-modifiers-when-not-set-as-flags.js | 68 +++ .../valid/remove-modifiers-when-set-as-flags.js | 68 +++ .../RegExp/regexp-modifiers/syntax/valid/shell.js | 0 ...syntax-err-arithmetic-modifiers-add-remove-i.js | 19 + ...syntax-err-arithmetic-modifiers-add-remove-m.js | 19 + ...thmetic-modifiers-add-remove-multi-duplicate.js | 19 + ...err-arithmetic-modifiers-add-remove-s-escape.js | 19 + ...syntax-err-arithmetic-modifiers-add-remove-s.js | 19 + .../syntax-err-arithmetic-modifiers-both-empty.js | 19 + ...r-arithmetic-modifiers-code-point-repeat-i-1.js | 19 + ...r-arithmetic-modifiers-code-point-repeat-i-2.js | 19 + ...thmetic-modifiers-other-code-point-arbitrary.js | 19 + ...metic-modifiers-other-code-point-combining-i.js | 19 + ...metic-modifiers-other-code-point-combining-m.js | 19 + ...metic-modifiers-other-code-point-combining-s.js | 19 + ...-err-arithmetic-modifiers-other-code-point-d.js | 19 + ...-err-arithmetic-modifiers-other-code-point-g.js | 19 + ...tic-modifiers-other-code-point-non-display-1.js | Bin 0 -> 718 bytes ...tic-modifiers-other-code-point-non-display-2.js | 19 + ...ithmetic-modifiers-other-code-point-non-flag.js | 19 + ...-err-arithmetic-modifiers-other-code-point-u.js | 19 + ...metic-modifiers-other-code-point-uppercase-I.js | 19 + ...-err-arithmetic-modifiers-other-code-point-y.js | 19 + ...rr-arithmetic-modifiers-other-code-point-zwj.js | 19 + ...arithmetic-modifiers-other-code-point-zwnbsp.js | 19 + ...r-arithmetic-modifiers-other-code-point-zwnj.js | 19 + ...rr-arithmetic-modifiers-reverse-add-remove-i.js | 19 + ...rr-arithmetic-modifiers-reverse-add-remove-m.js | 19 + ...modifiers-reverse-add-remove-multi-duplicate.js | 19 + ...hmetic-modifiers-reverse-add-remove-s-escape.js | 19 + ...rr-arithmetic-modifiers-reverse-add-remove-s.js | 19 + ...etic-modifiers-reverse-code-point-repeat-i-1.js | 19 + ...etic-modifiers-reverse-code-point-repeat-i-2.js | 19 + ...modifiers-reverse-other-code-point-arbitrary.js | 19 + ...difiers-reverse-other-code-point-combining-i.js | 19 + ...difiers-reverse-other-code-point-combining-m.js | 19 + ...difiers-reverse-other-code-point-combining-s.js | 19 + ...thmetic-modifiers-reverse-other-code-point-d.js | 19 + ...thmetic-modifiers-reverse-other-code-point-g.js | 19 + ...fiers-reverse-other-code-point-non-display-1.js | Bin 0 -> 718 bytes ...fiers-reverse-other-code-point-non-display-2.js | 19 + ...-modifiers-reverse-other-code-point-non-flag.js | 19 + ...thmetic-modifiers-reverse-other-code-point-u.js | 19 + ...difiers-reverse-other-code-point-uppercase-I.js | 19 + ...thmetic-modifiers-reverse-other-code-point-y.js | 19 + ...metic-modifiers-reverse-other-code-point-zwj.js | 19 + ...ic-modifiers-reverse-other-code-point-zwnbsp.js | 19 + ...etic-modifiers-reverse-other-code-point-zwnj.js | 19 + ...tic-modifiers-reverse-should-not-case-fold-i.js | 19 + ...tic-modifiers-reverse-should-not-case-fold-m.js | 19 + ...tic-modifiers-reverse-should-not-case-fold-s.js | 19 + ...fiers-reverse-should-not-unicode-case-fold-i.js | 19 + ...fiers-reverse-should-not-unicode-case-fold-s.js | 19 + ...-arithmetic-modifiers-should-not-case-fold-i.js | 19 + ...-arithmetic-modifiers-should-not-case-fold-m.js | 19 + ...-arithmetic-modifiers-should-not-case-fold-s.js | 19 + ...tic-modifiers-should-not-unicode-case-fold-i.js | 19 + ...tic-modifiers-should-not-unicode-case-fold-s.js | 19 + .../RegExpStringIteratorPrototype/next/length.js | 11 +- .../RegExpStringIteratorPrototype/next/name.js | 11 +- .../test262/built-ins/Set/Symbol.species/length.js | 11 +- js/src/tests/test262/built-ins/Set/length.js | 11 +- js/src/tests/test262/built-ins/Set/name.js | 11 +- .../prototype/Symbol.iterator/not-a-constructor.js | 2 +- .../test262/built-ins/Set/prototype/add/length.js | 11 +- .../test262/built-ins/Set/prototype/add/name.js | 11 +- .../Set/prototype/add/not-a-constructor.js | 2 +- .../built-ins/Set/prototype/clear/length.js | 11 +- .../test262/built-ins/Set/prototype/clear/name.js | 11 +- .../Set/prototype/clear/not-a-constructor.js | 2 +- .../built-ins/Set/prototype/delete/length.js | 11 +- .../test262/built-ins/Set/prototype/delete/name.js | 11 +- .../Set/prototype/delete/not-a-constructor.js | 2 +- .../Set/prototype/difference/not-a-constructor.js | 4 +- .../built-ins/Set/prototype/entries/length.js | 11 +- .../built-ins/Set/prototype/entries/name.js | 11 +- .../Set/prototype/entries/not-a-constructor.js | 2 +- .../built-ins/Set/prototype/forEach/length.js | 11 +- .../built-ins/Set/prototype/forEach/name.js | 11 +- .../Set/prototype/forEach/not-a-constructor.js | 2 +- .../test262/built-ins/Set/prototype/has/length.js | 11 +- .../test262/built-ins/Set/prototype/has/name.js | 11 +- .../Set/prototype/has/not-a-constructor.js | 2 +- .../prototype/intersection/not-a-constructor.js | 4 +- .../prototype/isDisjointFrom/not-a-constructor.js | 4 +- .../Set/prototype/isSubsetOf/not-a-constructor.js | 4 +- .../prototype/isSupersetOf/not-a-constructor.js | 4 +- .../test262/built-ins/Set/prototype/size/length.js | 11 +- .../test262/built-ins/Set/prototype/size/name.js | 11 +- .../symmetricDifference/not-a-constructor.js | 4 +- .../Set/prototype/union/not-a-constructor.js | 4 +- .../built-ins/Set/prototype/values/length.js | 11 +- .../test262/built-ins/Set/prototype/values/name.js | 11 +- .../Set/prototype/values/not-a-constructor.js | 2 +- .../built-ins/SetIteratorPrototype/next/length.js | 11 +- .../built-ins/SetIteratorPrototype/next/name.js | 11 +- .../prototype/evaluate/not-constructor.js | 2 +- .../options-maxbytelength-allocation-limit.js | 41 ++ ...axbytelength-compared-before-object-creation.js | 43 ++ ...length-data-allocation-after-object-creation.js | 45 ++ .../prototype/byteLength/length.js | 11 +- .../SharedArrayBuffer/prototype/byteLength/name.js | 14 +- .../SharedArrayBuffer/prototype/slice/length.js | 11 +- .../SharedArrayBuffer/prototype/slice/name.js | 11 +- .../prototype/slice/not-a-constructor.js | 2 +- .../test262/built-ins/String/fromCharCode/name.js | 11 +- .../String/fromCharCode/not-a-constructor.js | 2 +- .../built-ins/String/fromCodePoint/length.js | 14 +- .../test262/built-ins/String/fromCodePoint/name.js | 14 +- .../String/fromCodePoint/not-a-constructor.js | 2 +- .../String/prototype/Symbol.iterator/length.js | 11 +- .../String/prototype/Symbol.iterator/name.js | 11 +- .../prototype/Symbol.iterator/not-a-constructor.js | 2 +- ...index-non-numeric-argument-tointeger-invalid.js | 2 +- .../built-ins/String/prototype/at/length.js | 14 +- .../String/prototype/at/return-abrupt-from-this.js | 4 +- .../built-ins/String/prototype/charAt/name.js | 11 +- .../String/prototype/charAt/not-a-constructor.js | 2 +- .../built-ins/String/prototype/charCodeAt/name.js | 11 +- .../prototype/charCodeAt/not-a-constructor.js | 2 +- .../String/prototype/codePointAt/length.js | 14 +- .../built-ins/String/prototype/codePointAt/name.js | 14 +- .../prototype/codePointAt/not-a-constructor.js | 2 +- .../built-ins/String/prototype/concat/name.js | 11 +- .../String/prototype/concat/not-a-constructor.js | 2 +- .../built-ins/String/prototype/endsWith/length.js | 14 +- .../built-ins/String/prototype/endsWith/name.js | 14 +- .../String/prototype/endsWith/not-a-constructor.js | 2 +- .../built-ins/String/prototype/includes/length.js | 14 +- .../built-ins/String/prototype/includes/name.js | 14 +- .../String/prototype/includes/not-a-constructor.js | 2 +- .../built-ins/String/prototype/indexOf/name.js | 11 +- .../String/prototype/indexOf/not-a-constructor.js | 2 +- .../prototype/isWellFormed/not-a-constructor.js | 2 +- .../isWellFormed/return-abrupt-from-this.js | 4 +- .../built-ins/String/prototype/lastIndexOf/name.js | 11 +- .../prototype/lastIndexOf/not-a-constructor.js | 2 +- .../String/prototype/localeCompare/name.js | 11 +- .../prototype/localeCompare/not-a-constructor.js | 2 +- .../built-ins/String/prototype/match/name.js | 11 +- .../String/prototype/match/not-a-constructor.js | 2 +- .../built-ins/String/prototype/matchAll/length.js | 11 +- .../built-ins/String/prototype/matchAll/name.js | 11 +- .../String/prototype/matchAll/not-a-constructor.js | 2 +- .../built-ins/String/prototype/normalize/length.js | 14 +- .../built-ins/String/prototype/normalize/name.js | 14 +- .../prototype/normalize/not-a-constructor.js | 2 +- .../String/prototype/padEnd/function-length.js | 11 +- .../String/prototype/padEnd/function-name.js | 15 +- .../String/prototype/padEnd/not-a-constructor.js | 2 +- .../String/prototype/padStart/function-length.js | 11 +- .../String/prototype/padStart/function-name.js | 15 +- .../String/prototype/padStart/not-a-constructor.js | 2 +- .../built-ins/String/prototype/repeat/length.js | 14 +- .../built-ins/String/prototype/repeat/name.js | 14 +- .../String/prototype/repeat/not-a-constructor.js | 2 +- .../built-ins/String/prototype/replace/name.js | 11 +- .../String/prototype/replace/not-a-constructor.js | 2 +- .../prototype/replaceAll/not-a-constructor.js | 2 +- .../built-ins/String/prototype/search/name.js | 11 +- .../String/prototype/search/not-a-constructor.js | 2 +- .../built-ins/String/prototype/slice/name.js | 11 +- .../String/prototype/slice/not-a-constructor.js | 2 +- .../built-ins/String/prototype/split/name.js | 11 +- .../String/prototype/split/not-a-constructor.js | 2 +- .../String/prototype/startsWith/length.js | 14 +- .../built-ins/String/prototype/startsWith/name.js | 14 +- .../prototype/startsWith/not-a-constructor.js | 2 +- .../built-ins/String/prototype/substring/name.js | 11 +- .../prototype/substring/not-a-constructor.js | 2 +- .../String/prototype/toLocaleLowerCase/name.js | 11 +- .../toLocaleLowerCase/not-a-constructor.js | 2 +- .../String/prototype/toLocaleUpperCase/name.js | 11 +- .../toLocaleUpperCase/not-a-constructor.js | 2 +- .../built-ins/String/prototype/toLowerCase/name.js | 11 +- .../prototype/toLowerCase/not-a-constructor.js | 2 +- .../String/prototype/toString/not-a-constructor.js | 2 +- .../built-ins/String/prototype/toUpperCase/name.js | 11 +- .../prototype/toUpperCase/not-a-constructor.js | 2 +- .../prototype/toWellFormed/not-a-constructor.js | 2 +- .../toWellFormed/return-abrupt-from-this.js | 4 +- .../built-ins/String/prototype/trim/name.js | 11 +- .../String/prototype/trim/not-a-constructor.js | 2 +- .../String/prototype/trimEnd/not-a-constructor.js | 2 +- .../prototype/trimStart/not-a-constructor.js | 2 +- .../String/prototype/valueOf/not-a-constructor.js | 2 +- .../tests/test262/built-ins/String/raw/length.js | 14 +- js/src/tests/test262/built-ins/String/raw/name.js | 14 +- .../built-ins/String/raw/not-a-constructor.js | 2 +- .../StringIteratorPrototype/next/length.js | 11 +- .../built-ins/StringIteratorPrototype/next/name.js | 11 +- .../tests/test262/built-ins/Symbol/for/length.js | 11 +- js/src/tests/test262/built-ins/Symbol/for/name.js | 11 +- .../built-ins/Symbol/for/not-a-constructor.js | 2 +- .../test262/built-ins/Symbol/keyFor/length.js | 11 +- .../tests/test262/built-ins/Symbol/keyFor/name.js | 11 +- .../built-ins/Symbol/keyFor/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/Symbol/length.js | 11 +- js/src/tests/test262/built-ins/Symbol/name.js | 11 +- .../Symbol/prototype/Symbol.toPrimitive/length.js | 11 +- .../Symbol/prototype/Symbol.toPrimitive/name.js | 13 +- .../built-ins/Symbol/prototype/toString/length.js | 11 +- .../built-ins/Symbol/prototype/toString/name.js | 11 +- .../Symbol/prototype/toString/not-a-constructor.js | 2 +- .../built-ins/Symbol/prototype/valueOf/length.js | 11 +- .../built-ins/Symbol/prototype/valueOf/name.js | 11 +- .../Symbol/prototype/valueOf/not-a-constructor.js | 2 +- .../Temporal/Calendar/from/calendar-iso-string.js | 25 + .../argument-propertybag-calendar-iso-string.js | 29 + .../argument-propertybag-calendar-number.js | 3 +- .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 31 + ...ument-string-calendar-annotation-invalid-key.js | 30 + .../argument-propertybag-calendar-iso-string.js | 28 + .../day/argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../weekOfYear/custom-calendar-weekofyear.js | 26 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../yearOfWeek/custom-calendar-weekofyear.js | 26 + .../duration-out-of-range-added-to-relativeto.js | 30 + ...opertybag-out-of-range-backward-offset-shift.js | 51 ++ ...ropertybag-out-of-range-forward-offset-shift.js | 46 ++ .../Duration/from/argument-duration-max.js | 2 +- ...lendar-dateadd-called-with-options-undefined.js | 2 +- ...cezoneddatetime-inconsistent-custom-calendar.js | 55 ++ ...lized-time-duration-to-days-loop-arbitrarily.js | 78 --- .../Duration/prototype/add/order-of-operations.js | 12 +- ...opertybag-out-of-range-backward-offset-shift.js | 50 ++ ...ropertybag-out-of-range-forward-offset-shift.js | 45 ++ ...ormalized-time-duration-to-days-range-errors.js | 146 ----- .../prototype/round/dst-rounding-result.js | 48 ++ .../duration-out-of-range-added-to-relativeto.js | 45 +- ...lized-time-duration-to-days-loop-arbitrarily.js | 88 +-- .../out-of-range-when-adjusting-rounded-days.js | 32 + ...nge-when-converting-from-normalized-duration.js | 2 +- ...opertybag-out-of-range-backward-offset-shift.js | 50 ++ ...ropertybag-out-of-range-forward-offset-shift.js | 45 ++ ...ormalized-time-duration-to-days-range-errors.js | 20 +- ...lendar-dateadd-called-with-options-undefined.js | 2 +- ...cezoneddatetime-inconsistent-custom-calendar.js | 55 ++ ...lized-time-duration-to-days-loop-arbitrarily.js | 78 --- .../prototype/subtract/order-of-operations.js | 12 +- ...opertybag-out-of-range-backward-offset-shift.js | 50 ++ ...ropertybag-out-of-range-forward-offset-shift.js | 45 ++ ...ormalized-time-duration-to-days-range-errors.js | 144 ----- .../prototype/total/dst-rounding-result.js | 40 ++ .../duration-out-of-range-added-to-relativeto.js | 45 +- ...lized-time-duration-to-days-loop-arbitrarily.js | 86 +-- .../total/precision-exact-mathematical-values-3.js | 2 +- ...opertybag-out-of-range-backward-offset-shift.js | 50 ++ ...ropertybag-out-of-range-forward-offset-shift.js | 45 ++ ...ormalized-time-duration-to-days-range-errors.js | 20 +- ...ument-string-calendar-annotation-invalid-key.js | 32 + ...ument-string-calendar-annotation-invalid-key.js | 25 + ...ument-string-calendar-annotation-invalid-key.js | 25 + ...ument-string-calendar-annotation-invalid-key.js | 25 + .../toZonedDateTime/calendar-iso-string.js | 27 + ...ument-string-calendar-annotation-invalid-key.js | 25 + .../Temporal/Now/plainDate/calendar-iso-string.js | 25 + .../Now/plainDateTime/calendar-iso-string.js | 25 + .../Now/zonedDateTime/calendar-iso-string.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + ...ument-string-calendar-annotation-invalid-key.js | 30 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 29 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../prototype/since/wrapping-at-end-of-month.js | 120 ++++ ...ument-string-calendar-annotation-invalid-key.js | 31 + ...ument-string-calendar-annotation-invalid-key.js | 31 + ...tnanosecondsfor-maximum-forward-offset-shift.js | 49 ++ ...secondsfor-out-of-range-forward-offset-shift.js | 44 ++ ...bleinstantsfor-maximum-backward-offset-shift.js | 53 ++ ...stantsfor-out-of-range-backward-offset-shift.js | 49 ++ .../argument-propertybag-calendar-iso-string.js | 29 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../prototype/until/largestunit-higher-units.js | 10 +- .../prototype/until/wrapping-at-end-of-month.js | 120 ++++ .../weekOfYear/custom-calendar-weekofyear.js | 26 + .../weekOfYear/validate-calendar-value.js | 1 - .../prototype/withCalendar/calendar-iso-string.js | 49 ++ .../yearOfWeek/custom-calendar-weekofyear.js | 26 + .../yearOfWeek/validate-calendar-value.js | 1 - .../argument-propertybag-calendar-iso-string.js | 28 + ...ument-string-calendar-annotation-invalid-key.js | 30 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 29 + .../since/argument-propertybag-calendar-number.js | 3 +- .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../prototype/since/result-mixed-sign.js | 29 + .../prototype/since/wrapping-at-end-of-month.js | 120 ++++ ...tnanosecondsfor-maximum-forward-offset-shift.js | 49 ++ ...secondsfor-out-of-range-forward-offset-shift.js | 44 ++ ...bleinstantsfor-maximum-backward-offset-shift.js | 53 ++ ...stantsfor-out-of-range-backward-offset-shift.js | 49 ++ .../argument-propertybag-calendar-iso-string.js | 29 + .../until/argument-propertybag-calendar-number.js | 3 +- .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../prototype/until/no-unnecessary-units.js | 8 +- .../prototype/until/result-mixed-sign.js | 29 + .../prototype/until/wrapping-at-end-of-month.js | 120 ++++ .../weekOfYear/custom-calendar-weekofyear.js | 26 + .../weekOfYear/validate-calendar-value.js | 1 - .../prototype/withCalendar/calendar-iso-string.js | 49 ++ .../argument-propertybag-calendar-iso-string.js | 29 + .../argument-propertybag-calendar-number.js | 3 +- .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + ...ument-string-calendar-annotation-invalid-key.js | 31 + .../yearOfWeek/custom-calendar-weekofyear.js | 26 + .../yearOfWeek/validate-calendar-value.js | 1 - .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + ...dar-fromfields-called-with-undefined-options.js | 25 + ...ument-string-calendar-annotation-invalid-key.js | 36 ++ ...ument-string-calendar-annotation-invalid-key.js | 31 + ...ument-string-calendar-annotation-invalid-key.js | 31 + ...ument-string-calendar-annotation-invalid-key.js | 31 + .../argument-propertybag-calendar-iso-string.js | 29 + .../argument-propertybag-calendar-number.js | 3 +- .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + ...tnanosecondsfor-maximum-forward-offset-shift.js | 49 ++ ...secondsfor-out-of-range-forward-offset-shift.js | 44 ++ ...bleinstantsfor-maximum-backward-offset-shift.js | 53 ++ ...stantsfor-out-of-range-backward-offset-shift.js | 49 ++ ...ument-string-calendar-annotation-invalid-key.js | 31 + .../argument-propertybag-calendar-iso-string.js | 28 + ...ument-string-calendar-annotation-invalid-key.js | 30 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 29 + .../since/argument-propertybag-calendar-number.js | 3 +- .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + ...dar-fromfields-called-with-undefined-options.js | 25 + .../argument-propertybag-calendar-iso-string.js | 29 + .../until/argument-propertybag-calendar-number.js | 3 +- .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + ...tnanosecondsfor-maximum-forward-offset-shift.js | 51 ++ ...secondsfor-out-of-range-forward-offset-shift.js | 46 ++ ...bleinstantsfor-maximum-backward-offset-shift.js | 55 ++ ...stantsfor-out-of-range-backward-offset-shift.js | 50 ++ ...ument-string-calendar-annotation-invalid-key.js | 25 + ...ument-string-calendar-annotation-invalid-key.js | 25 + ...ument-string-calendar-annotation-invalid-key.js | 25 + ...ument-string-calendar-annotation-invalid-key.js | 25 + .../getPlainDateTimeFor/calendar-iso-string.js | 27 + .../argument-propertybag-calendar-iso-string.js | 29 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + ...ument-string-calendar-annotation-invalid-key.js | 25 + .../argument-propertybag-calendar-iso-string.js | 30 + ...opertybag-out-of-range-backward-offset-shift.js | 51 ++ ...ropertybag-out-of-range-forward-offset-shift.js | 46 ++ ...ument-string-calendar-annotation-invalid-key.js | 32 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...opertybag-out-of-range-backward-offset-shift.js | 49 ++ ...ropertybag-out-of-range-forward-offset-shift.js | 44 ++ ...ument-string-calendar-annotation-invalid-key.js | 32 + .../argument-propertybag-calendar-iso-string.js | 29 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...opertybag-out-of-range-backward-offset-shift.js | 50 ++ ...ropertybag-out-of-range-forward-offset-shift.js | 45 ++ ...ument-string-calendar-annotation-invalid-key.js | 25 + ...tnanosecondsfor-maximum-forward-offset-shift.js | 49 ++ ...secondsfor-out-of-range-forward-offset-shift.js | 44 ++ ...bleinstantsfor-maximum-backward-offset-shift.js | 53 ++ ...stantsfor-out-of-range-backward-offset-shift.js | 49 ++ .../ZonedDateTime/prototype/round/div-zero.js | 8 +- ...tnanosecondsfor-maximum-forward-offset-shift.js | 49 ++ ...ibleinstantsfor-called-with-iso8601-calendar.js | 4 +- ...bleinstantsfor-maximum-backward-offset-shift.js | 53 ++ ...stantsfor-out-of-range-backward-offset-shift.js | 49 ++ .../prototype/round/order-of-operations.js | 42 +- .../round/smallest-unit-day-rounding-modes.js | 47 +- .../timezone-getpossibleinstantsfor-iterable.js | 2 - .../argument-propertybag-calendar-iso-string.js | 30 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...opertybag-out-of-range-backward-offset-shift.js | 50 ++ ...ropertybag-out-of-range-forward-offset-shift.js | 45 ++ ...ument-string-calendar-annotation-invalid-key.js | 26 + ...lendar-dateadd-called-with-options-undefined.js | 16 +- ...cezoneddatetime-inconsistent-custom-calendar.js | 56 ++ .../prototype/since/dst-month-day-boundary.js | 29 + .../prototype/since/dst-rounding-result.js | 48 ++ .../prototype/since/find-intermediate-instant.js | 84 +++ ...lized-time-duration-to-days-loop-arbitrarily.js | 86 +-- ...ormalized-time-duration-to-days-range-errors.js | 51 +- .../prototype/since/order-of-operations.js | 15 +- .../prototype/since/wrapping-at-end-of-month.js | 120 ++++ ...tnanosecondsfor-maximum-forward-offset-shift.js | 49 ++ ...secondsfor-out-of-range-forward-offset-shift.js | 44 ++ ...bleinstantsfor-maximum-backward-offset-shift.js | 53 ++ ...stantsfor-out-of-range-backward-offset-shift.js | 49 ++ .../argument-propertybag-calendar-iso-string.js | 30 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...opertybag-out-of-range-backward-offset-shift.js | 50 ++ ...ropertybag-out-of-range-forward-offset-shift.js | 45 ++ ...ument-string-calendar-annotation-invalid-key.js | 26 + ...lendar-dateadd-called-with-options-undefined.js | 16 +- ...cezoneddatetime-inconsistent-custom-calendar.js | 56 ++ .../prototype/until/dst-month-day-boundary.js | 29 + .../prototype/until/dst-rounding-result.js | 48 ++ .../prototype/until/find-intermediate-instant.js | 85 +++ ...lized-time-duration-to-days-loop-arbitrarily.js | 86 +-- ...ormalized-time-duration-to-days-range-errors.js | 51 +- .../prototype/until/order-of-operations.js | 15 +- .../prototype/until/wrapping-at-end-of-month.js | 120 ++++ .../weekOfYear/custom-calendar-weekofyear.js | 27 + .../weekOfYear/validate-calendar-value.js | 1 - ...tnanosecondsfor-maximum-forward-offset-shift.js | 52 ++ ...secondsfor-out-of-range-forward-offset-shift.js | 46 ++ ...bleinstantsfor-maximum-backward-offset-shift.js | 56 ++ ...stantsfor-out-of-range-backward-offset-shift.js | 51 ++ .../prototype/withCalendar/calendar-iso-string.js | 49 ++ .../argument-propertybag-calendar-iso-string.js | 29 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 26 + ...tnanosecondsfor-maximum-forward-offset-shift.js | 49 ++ ...secondsfor-out-of-range-forward-offset-shift.js | 44 ++ ...bleinstantsfor-maximum-backward-offset-shift.js | 53 ++ ...stantsfor-out-of-range-backward-offset-shift.js | 49 ++ ...ument-string-calendar-annotation-invalid-key.js | 32 + ...tnanosecondsfor-maximum-forward-offset-shift.js | 49 ++ ...secondsfor-out-of-range-forward-offset-shift.js | 44 ++ ...bleinstantsfor-maximum-backward-offset-shift.js | 53 ++ ...stantsfor-out-of-range-backward-offset-shift.js | 49 ++ .../yearOfWeek/custom-calendar-weekofyear.js | 27 + .../yearOfWeek/validate-calendar-value.js | 1 - js/src/tests/test262/built-ins/Temporal/shell.js | 8 + .../test262/built-ins/ThrowTypeError/length.js | 11 +- .../built-ins/TypedArray/Symbol.species/length.js | 12 +- .../built-ins/TypedArray/Symbol.species/name.js | 12 +- .../TypedArray/Symbol.species/prop-desc.js | 1 + .../built-ins/TypedArray/Symbol.species/result.js | 1 + .../TypedArray/from/arylk-get-length-error.js | 1 + .../TypedArray/from/arylk-to-length-error.js | 1 + .../from/from-array-mapper-detaches-result.js | 39 ++ ...from-array-mapper-makes-result-out-of-bounds.js | 40 ++ ...ypedarray-into-itself-mapper-detaches-result.js | 39 ++ ...nto-itself-mapper-makes-result-out-of-bounds.js | 40 ++ .../from/from-typedarray-mapper-detaches-result.js | 39 ++ ...typedarray-mapper-makes-result-out-of-bounds.js | 40 ++ .../built-ins/TypedArray/from/invoked-as-func.js | 1 + .../built-ins/TypedArray/from/invoked-as-method.js | 1 + .../built-ins/TypedArray/from/iter-access-error.js | 1 + .../built-ins/TypedArray/from/iter-invoke-error.js | 1 + .../built-ins/TypedArray/from/iter-next-error.js | 1 + .../TypedArray/from/iter-next-value-error.js | 1 + .../from/iterated-array-changed-by-tonumber.js | 39 ++ .../test262/built-ins/TypedArray/from/length.js | 12 +- .../TypedArray/from/mapfn-is-not-callable.js | 1 + .../test262/built-ins/TypedArray/from/name.js | 12 +- .../built-ins/TypedArray/from/not-a-constructor.js | 3 +- .../test262/built-ins/TypedArray/from/prop-desc.js | 1 + .../TypedArray/from/this-is-not-constructor.js | 1 + .../tests/test262/built-ins/TypedArray/invoked.js | 1 + .../tests/test262/built-ins/TypedArray/length.js | 1 + js/src/tests/test262/built-ins/TypedArray/name.js | 12 +- .../built-ins/TypedArray/of/invoked-as-func.js | 1 + .../built-ins/TypedArray/of/invoked-as-method.js | 1 + .../test262/built-ins/TypedArray/of/length.js | 12 +- .../tests/test262/built-ins/TypedArray/of/name.js | 12 +- .../built-ins/TypedArray/of/not-a-constructor.js | 3 +- .../test262/built-ins/TypedArray/of/prop-desc.js | 1 + ...zed-with-out-of-bounds-and-in-bounds-indices.js | 60 ++ .../TypedArray/of/this-is-not-constructor.js | 1 + .../test262/built-ins/TypedArray/prototype.js | 1 + .../TypedArray/prototype/Symbol.iterator.js | 1 + .../prototype/Symbol.iterator/not-a-constructor.js | 3 +- .../prototype/Symbol.toStringTag/BigInt/length.js | 11 +- .../prototype/Symbol.toStringTag/BigInt/name.js | 11 +- .../Symbol.toStringTag/detached-buffer.js | 1 + .../Symbol.toStringTag/invoked-as-accessor.js | 1 + .../Symbol.toStringTag/invoked-as-func.js | 1 + .../prototype/Symbol.toStringTag/length.js | 12 +- .../prototype/Symbol.toStringTag/name.js | 12 +- .../prototype/Symbol.toStringTag/prop-desc.js | 1 + .../Symbol.toStringTag/return-typedarrayname.js | 1 + .../this-has-no-typedarrayname-internal.js | 1 + .../Symbol.toStringTag/this-is-not-object.js | 1 + .../prototype/at/index-argument-tointeger.js | 1 + ...index-non-numeric-argument-tointeger-invalid.js | 3 +- .../at/index-non-numeric-argument-tointeger.js | 1 + .../built-ins/TypedArray/prototype/at/length.js | 15 +- .../built-ins/TypedArray/prototype/at/name.js | 1 + .../built-ins/TypedArray/prototype/at/prop-desc.js | 1 + .../at/return-abrupt-from-this-out-of-bounds.js | 2 +- .../prototype/at/return-abrupt-from-this.js | 9 +- .../prototype/at/returns-item-relative-index.js | 1 + .../TypedArray/prototype/at/returns-item.js | 1 + ...returns-undefined-for-holes-in-sparse-arrays.js | 1 + .../at/returns-undefined-for-out-of-range-index.js | 1 + .../TypedArray/prototype/buffer/detached-buffer.js | 1 + .../prototype/buffer/invoked-as-accessor.js | 1 + .../TypedArray/prototype/buffer/invoked-as-func.js | 1 + .../TypedArray/prototype/buffer/length.js | 12 +- .../built-ins/TypedArray/prototype/buffer/name.js | 12 +- .../TypedArray/prototype/buffer/prop-desc.js | 1 + .../TypedArray/prototype/buffer/return-buffer.js | 1 + .../buffer/this-has-no-typedarrayname-internal.js | 1 + .../prototype/buffer/this-inherits-typedarray.js | 1 + .../prototype/buffer/this-is-not-object.js | 1 + .../prototype/byteLength/detached-buffer.js | 1 + .../prototype/byteLength/invoked-as-accessor.js | 1 + .../prototype/byteLength/invoked-as-func.js | 1 + .../TypedArray/prototype/byteLength/length.js | 12 +- .../TypedArray/prototype/byteLength/name.js | 12 +- .../TypedArray/prototype/byteLength/prop-desc.js | 1 + .../byteLength/resizable-array-buffer-auto.js | 2 +- .../byteLength/resizable-array-buffer-fixed.js | 2 +- .../prototype/byteLength/return-bytelength.js | 1 + .../this-has-no-typedarrayname-internal.js | 1 + .../prototype/byteLength/this-is-not-object.js | 1 + .../prototype/byteOffset/detached-buffer.js | 1 + .../prototype/byteOffset/invoked-as-accessor.js | 1 + .../prototype/byteOffset/invoked-as-func.js | 1 + .../TypedArray/prototype/byteOffset/length.js | 12 +- .../TypedArray/prototype/byteOffset/name.js | 12 +- .../TypedArray/prototype/byteOffset/prop-desc.js | 1 + .../byteOffset/resizable-array-buffer-auto.js | 2 +- .../byteOffset/resizable-array-buffer-fixed.js | 2 +- .../prototype/byteOffset/return-byteoffset.js | 1 + .../this-has-no-typedarrayname-internal.js | 1 + .../prototype/byteOffset/this-is-not-object.js | 1 + .../built-ins/TypedArray/prototype/constructor.js | 1 + .../prototype/copyWithin/bit-precision.js | 1 + .../TypedArray/prototype/copyWithin/byteoffset.js | 1 + .../coerced-values-end-detached-prototype.js | 1 + .../copyWithin/coerced-values-end-detached.js | 1 + .../prototype/copyWithin/coerced-values-end.js | 1 + .../copyWithin/coerced-values-start-detached.js | 1 + .../prototype/copyWithin/coerced-values-start.js | 1 + .../prototype/copyWithin/coerced-values-target.js | 1 + .../prototype/copyWithin/detached-buffer.js | 1 + .../copyWithin/get-length-ignores-length-prop.js | 1 + .../prototype/copyWithin/invoked-as-func.js | 1 + .../prototype/copyWithin/invoked-as-method.js | 1 + .../TypedArray/prototype/copyWithin/length.js | 12 +- .../TypedArray/prototype/copyWithin/name.js | 12 +- .../prototype/copyWithin/negative-end.js | 1 + .../copyWithin/negative-out-of-bounds-end.js | 1 + .../copyWithin/negative-out-of-bounds-start.js | 1 + .../copyWithin/negative-out-of-bounds-target.js | 1 + .../prototype/copyWithin/negative-start.js | 1 + .../prototype/copyWithin/negative-target.js | 1 + .../copyWithin/non-negative-out-of-bounds-end.js | 1 + .../non-negative-out-of-bounds-target-and-start.js | 1 + .../copyWithin/non-negative-target-and-start.js | 1 + .../non-negative-target-start-and-end.js | 1 + .../prototype/copyWithin/not-a-constructor.js | 3 +- .../TypedArray/prototype/copyWithin/prop-desc.js | 1 + .../copyWithin/return-abrupt-from-end-is-symbol.js | 1 + .../prototype/copyWithin/return-abrupt-from-end.js | 1 + .../return-abrupt-from-start-is-symbol.js | 1 + .../copyWithin/return-abrupt-from-start.js | 1 + .../return-abrupt-from-target-is-symbol.js | 1 + .../copyWithin/return-abrupt-from-target.js | 1 + .../return-abrupt-from-this-out-of-bounds.js | 2 +- .../TypedArray/prototype/copyWithin/return-this.js | 1 + .../prototype/copyWithin/this-is-not-object.js | 1 + .../copyWithin/this-is-not-typedarray-instance.js | 1 + .../prototype/copyWithin/undefined-end.js | 1 + .../prototype/entries/detached-buffer.js | 1 + .../prototype/entries/invoked-as-func.js | 1 + .../prototype/entries/invoked-as-method.js | 1 + .../TypedArray/prototype/entries/iter-prototype.js | 1 + .../TypedArray/prototype/entries/length.js | 12 +- .../built-ins/TypedArray/prototype/entries/name.js | 12 +- .../prototype/entries/not-a-constructor.js | 3 +- .../TypedArray/prototype/entries/prop-desc.js | 1 + .../return-abrupt-from-this-out-of-bounds.js | 2 +- .../TypedArray/prototype/entries/return-itor.js | 1 + .../prototype/entries/this-is-not-object.js | 1 + .../entries/this-is-not-typedarray-instance.js | 1 + .../every/callbackfn-arguments-with-thisarg.js | 1 + .../every/callbackfn-arguments-without-thisarg.js | 1 + .../prototype/every/callbackfn-detachbuffer.js | 1 + .../callbackfn-no-interaction-over-non-integer.js | 1 + .../every/callbackfn-not-callable-throws.js | 1 + .../every/callbackfn-not-called-on-empty.js | 1 + .../prototype/every/callbackfn-resize.js | 2 +- .../callbackfn-return-does-not-change-instance.js | 1 + .../prototype/every/callbackfn-returns-abrupt.js | 1 + .../callbackfn-set-value-during-interaction.js | 1 + .../TypedArray/prototype/every/callbackfn-this.js | 1 + .../TypedArray/prototype/every/detached-buffer.js | 1 + .../every/get-length-uses-internal-arraylength.js | 1 + .../TypedArray/prototype/every/invoked-as-func.js | 1 + .../prototype/every/invoked-as-method.js | 1 + .../built-ins/TypedArray/prototype/every/length.js | 12 +- .../built-ins/TypedArray/prototype/every/name.js | 12 +- .../prototype/every/not-a-constructor.js | 3 +- .../TypedArray/prototype/every/prop-desc.js | 1 + .../every/return-abrupt-from-this-out-of-bounds.js | 2 +- .../every/returns-false-if-any-cb-returns-false.js | 1 + .../every/returns-true-if-every-cb-returns-true.js | 1 + .../prototype/every/this-is-not-object.js | 1 + .../every/this-is-not-typedarray-instance.js | 1 + .../prototype/every/values-are-not-cached.js | 1 + .../absent-indices-computed-from-initial-length.js | 54 ++ .../prototype/fill/coerced-end-detach.js | 1 + .../TypedArray/prototype/fill/coerced-indexes.js | 1 + .../prototype/fill/coerced-start-detach.js | 1 + .../prototype/fill/coerced-value-detach.js | 1 + .../TypedArray/prototype/fill/detached-buffer.js | 1 + .../prototype/fill/fill-values-conversion-once.js | 1 + ...-values-conversion-operations-consistent-nan.js | 1 + .../fill/fill-values-conversion-operations.js | 1 + .../fill/fill-values-custom-start-and-end.js | 1 + .../prototype/fill/fill-values-non-numeric.js | 1 + .../prototype/fill/fill-values-relative-end.js | 1 + .../prototype/fill/fill-values-relative-start.js | 1 + .../prototype/fill/fill-values-symbol-throws.js | 1 + .../TypedArray/prototype/fill/fill-values.js | 1 + .../fill/get-length-ignores-length-prop.js | 1 + .../TypedArray/prototype/fill/invoked-as-func.js | 1 + .../TypedArray/prototype/fill/invoked-as-method.js | 1 + .../built-ins/TypedArray/prototype/fill/length.js | 12 +- .../built-ins/TypedArray/prototype/fill/name.js | 12 +- .../TypedArray/prototype/fill/not-a-constructor.js | 3 +- .../TypedArray/prototype/fill/prop-desc.js | 1 + .../fill/return-abrupt-from-end-as-symbol.js | 1 + .../prototype/fill/return-abrupt-from-end.js | 1 + .../prototype/fill/return-abrupt-from-set-value.js | 1 + .../fill/return-abrupt-from-start-as-symbol.js | 1 + .../prototype/fill/return-abrupt-from-start.js | 1 + .../fill/return-abrupt-from-this-out-of-bounds.js | 2 +- .../TypedArray/prototype/fill/return-this.js | 1 + .../prototype/fill/this-is-not-object.js | 1 + .../fill/this-is-not-typedarray-instance.js | 1 + .../prototype/filter/arraylength-internal.js | 1 + .../filter/callbackfn-arguments-with-thisarg.js | 1 + .../filter/callbackfn-arguments-without-thisarg.js | 1 + .../filter/callbackfn-called-before-ctor.js | 1 + .../filter/callbackfn-called-before-species.js | 1 + .../prototype/filter/callbackfn-detachbuffer.js | 1 + .../callbackfn-no-iteration-over-non-integer.js | 1 + .../filter/callbackfn-not-callable-throws.js | 1 + .../filter/callbackfn-not-called-on-empty.js | 1 + .../prototype/filter/callbackfn-resize.js | 2 +- .../callbackfn-return-does-not-change-instance.js | 1 + .../prototype/filter/callbackfn-returns-abrupt.js | 1 + .../callbackfn-set-value-during-iteration.js | 1 + .../TypedArray/prototype/filter/callbackfn-this.js | 1 + .../TypedArray/prototype/filter/detached-buffer.js | 1 + .../TypedArray/prototype/filter/invoked-as-func.js | 1 + .../prototype/filter/invoked-as-method.js | 1 + .../TypedArray/prototype/filter/length.js | 12 +- .../built-ins/TypedArray/prototype/filter/name.js | 12 +- .../prototype/filter/not-a-constructor.js | 3 +- .../TypedArray/prototype/filter/prop-desc.js | 1 + .../filter/result-does-not-share-buffer.js | 1 + .../result-empty-callbackfn-returns-false.js | 1 + .../filter/result-full-callbackfn-returns-true.js | 1 + .../return-abrupt-from-this-out-of-bounds.js | 2 +- .../filter/speciesctor-destination-resizable.js | 2 +- .../filter/speciesctor-get-ctor-abrupt.js | 1 + .../filter/speciesctor-get-ctor-inherited.js | 1 + .../filter/speciesctor-get-ctor-returns-throws.js | 1 + .../prototype/filter/speciesctor-get-ctor.js | 1 + .../filter/speciesctor-get-species-abrupt.js | 1 + ...eciesctor-get-species-custom-ctor-invocation.js | 1 + ...tom-ctor-length-throws-resizable-arraybuffer.js | 2 +- ...esctor-get-species-custom-ctor-length-throws.js | 1 + .../speciesctor-get-species-custom-ctor-length.js | 1 + ...species-custom-ctor-returns-another-instance.js | 1 + .../speciesctor-get-species-custom-ctor-throws.js | 1 + .../filter/speciesctor-get-species-custom-ctor.js | 1 + .../speciesctor-get-species-returns-throws.js | 1 + .../speciesctor-get-species-use-default-ctor.js | 1 + .../prototype/filter/speciesctor-get-species.js | 1 + .../prototype/filter/this-is-not-object.js | 1 + .../filter/this-is-not-typedarray-instance.js | 1 + .../prototype/filter/values-are-not-cached.js | 1 + .../TypedArray/prototype/filter/values-are-set.js | 1 + .../TypedArray/prototype/find/callbackfn-resize.js | 2 +- .../TypedArray/prototype/find/detached-buffer.js | 1 + .../find/get-length-ignores-length-prop.js | 1 + .../TypedArray/prototype/find/invoked-as-func.js | 1 + .../TypedArray/prototype/find/invoked-as-method.js | 1 + .../built-ins/TypedArray/prototype/find/length.js | 12 +- .../built-ins/TypedArray/prototype/find/name.js | 12 +- .../TypedArray/prototype/find/not-a-constructor.js | 3 +- .../prototype/find/predicate-call-changes-value.js | 1 + .../prototype/find/predicate-call-parameters.js | 1 + .../find/predicate-call-this-non-strict.js | 1 + .../find/predicate-call-this-strict-strict.js | 1 + .../find/predicate-is-not-callable-throws.js | 1 + .../prototype/find/predicate-may-detach-buffer.js | 1 + .../find/predicate-not-called-on-empty-array.js | 1 + .../TypedArray/prototype/find/prop-desc.js | 1 + .../find/return-abrupt-from-predicate-call.js | 1 + .../find/return-abrupt-from-this-out-of-bounds.js | 2 +- .../return-found-value-predicate-result-is-true.js | 1 + ...n-undefined-if-predicate-returns-false-value.js | 1 + .../prototype/find/this-is-not-object.js | 1 + .../find/this-is-not-typedarray-instance.js | 1 + .../prototype/findIndex/callbackfn-resize.js | 2 +- .../prototype/findIndex/detached-buffer.js | 1 + .../findIndex/get-length-ignores-length-prop.js | 1 + .../prototype/findIndex/invoked-as-func.js | 1 + .../prototype/findIndex/invoked-as-method.js | 1 + .../TypedArray/prototype/findIndex/length.js | 12 +- .../TypedArray/prototype/findIndex/name.js | 12 +- .../prototype/findIndex/not-a-constructor.js | 3 +- .../findIndex/predicate-call-changes-value.js | 1 + .../findIndex/predicate-call-parameters.js | 1 + .../findIndex/predicate-call-this-non-strict.js | 1 + .../findIndex/predicate-call-this-strict-strict.js | 1 + .../findIndex/predicate-is-not-callable-throws.js | 1 + .../findIndex/predicate-may-detach-buffer.js | 1 + .../predicate-not-called-on-empty-array.js | 1 + .../TypedArray/prototype/findIndex/prop-desc.js | 1 + .../findIndex/return-abrupt-from-predicate-call.js | 1 + .../return-abrupt-from-this-out-of-bounds.js | 2 +- .../return-index-predicate-result-is-true.js | 1 + ...egative-one-if-predicate-returns-false-value.js | 1 + .../prototype/findIndex/this-is-not-object.js | 1 + .../findIndex/this-is-not-typedarray-instance.js | 1 + .../prototype/findLast/callbackfn-resize.js | 2 +- .../prototype/findLast/detached-buffer.js | 1 + .../findLast/get-length-ignores-length-prop.js | 1 + .../prototype/findLast/invoked-as-func.js | 1 + .../prototype/findLast/invoked-as-method.js | 1 + .../TypedArray/prototype/findLast/length.js | 1 + .../TypedArray/prototype/findLast/name.js | 1 + .../prototype/findLast/not-a-constructor.js | 3 +- .../findLast/predicate-call-changes-value.js | 1 + .../findLast/predicate-call-parameters.js | 1 + .../findLast/predicate-call-this-non-strict.js | 1 + .../findLast/predicate-call-this-strict-strict.js | 1 + .../findLast/predicate-is-not-callable-throws.js | 1 + .../findLast/predicate-may-detach-buffer.js | 1 + .../predicate-not-called-on-empty-array.js | 1 + .../TypedArray/prototype/findLast/prop-desc.js | 1 + .../findLast/return-abrupt-from-predicate-call.js | 1 + .../return-abrupt-from-this-out-of-bounds.js | 2 +- .../return-found-value-predicate-result-is-true.js | 1 + ...n-undefined-if-predicate-returns-false-value.js | 1 + .../prototype/findLast/this-is-not-object.js | 1 + .../findLast/this-is-not-typedarray-instance.js | 1 + .../prototype/findLastIndex/callbackfn-resize.js | 2 +- .../prototype/findLastIndex/detached-buffer.js | 1 + .../get-length-ignores-length-prop.js | 1 + .../prototype/findLastIndex/invoked-as-func.js | 1 + .../prototype/findLastIndex/invoked-as-method.js | 1 + .../TypedArray/prototype/findLastIndex/length.js | 1 + .../TypedArray/prototype/findLastIndex/name.js | 1 + .../prototype/findLastIndex/not-a-constructor.js | 3 +- .../findLastIndex/predicate-call-changes-value.js | 1 + .../findLastIndex/predicate-call-parameters.js | 1 + .../predicate-call-this-non-strict.js | 1 + .../predicate-call-this-strict-strict.js | 1 + .../predicate-is-not-callable-throws.js | 1 + .../findLastIndex/predicate-may-detach-buffer.js | 1 + .../predicate-not-called-on-empty-array.js | 1 + .../prototype/findLastIndex/prop-desc.js | 1 + .../return-abrupt-from-predicate-call.js | 1 + .../return-abrupt-from-this-out-of-bounds.js | 2 +- .../return-index-predicate-result-is-true.js | 1 + ...egative-one-if-predicate-returns-false-value.js | 1 + .../prototype/findLastIndex/this-is-not-object.js | 1 + .../this-is-not-typedarray-instance.js | 1 + .../prototype/forEach/arraylength-internal.js | 1 + .../forEach/callbackfn-arguments-with-thisarg.js | 1 + .../callbackfn-arguments-without-thisarg.js | 1 + .../prototype/forEach/callbackfn-detachbuffer.js | 1 + .../forEach/callbackfn-is-not-callable.js | 1 + .../callbackfn-no-interaction-over-non-integer.js | 1 + .../forEach/callbackfn-not-called-on-empty.js | 1 + .../prototype/forEach/callbackfn-resize.js | 2 +- .../callbackfn-return-does-not-change-instance.js | 1 + .../prototype/forEach/callbackfn-returns-abrupt.js | 1 + .../callbackfn-set-value-during-interaction.js | 1 + .../prototype/forEach/callbackfn-this.js | 1 + .../prototype/forEach/detached-buffer.js | 1 + .../prototype/forEach/invoked-as-func.js | 1 + .../prototype/forEach/invoked-as-method.js | 1 + .../TypedArray/prototype/forEach/length.js | 12 +- .../built-ins/TypedArray/prototype/forEach/name.js | 12 +- .../prototype/forEach/not-a-constructor.js | 3 +- .../TypedArray/prototype/forEach/prop-desc.js | 1 + .../return-abrupt-from-this-out-of-bounds.js | 2 +- .../prototype/forEach/returns-undefined.js | 1 + .../prototype/forEach/this-is-not-object.js | 1 + .../forEach/this-is-not-typedarray-instance.js | 1 + .../prototype/forEach/values-are-not-cached.js | 1 + ...ffer-during-fromIndex-returns-false-for-zero.js | 1 + ...-during-fromIndex-returns-true-for-undefined.js | 1 + .../prototype/includes/detached-buffer.js | 1 + ...mIndex-equal-or-greater-length-returns-false.js | 1 + .../prototype/includes/fromIndex-infinity.js | 1 + .../prototype/includes/fromIndex-minus-zero.js | 1 + .../get-length-uses-internal-arraylength.js | 1 + ...ompared-against-initial-length-out-of-bounds.js | 54 ++ .../index-compared-against-initial-length.js | 50 ++ .../prototype/includes/invoked-as-func.js | 1 + .../prototype/includes/invoked-as-method.js | 1 + .../includes/length-zero-returns-false.js | 1 + .../TypedArray/prototype/includes/length.js | 12 +- .../TypedArray/prototype/includes/name.js | 12 +- .../prototype/includes/not-a-constructor.js | 3 +- .../TypedArray/prototype/includes/prop-desc.js | 1 + .../return-abrupt-from-this-out-of-bounds.js | 2 +- .../return-abrupt-tointeger-fromindex-symbol.js | 1 + .../includes/return-abrupt-tointeger-fromindex.js | 1 + .../TypedArray/prototype/includes/samevaluezero.js | 1 + .../includes/search-found-returns-true.js | 1 + .../includes/search-not-found-returns-false.js | 1 + .../includes/searchelement-not-integer.js | 1 + .../prototype/includes/this-is-not-object.js | 1 + .../includes/this-is-not-typedarray-instance.js | 1 + .../prototype/includes/tointeger-fromindex.js | 1 + ...ng-fromIndex-returns-minus-one-for-undefined.js | 1 + ...-during-fromIndex-returns-minus-one-for-zero.js | 1 + .../prototype/indexOf/detached-buffer.js | 1 + ...ex-equal-or-greater-length-returns-minus-one.js | 1 + .../prototype/indexOf/fromIndex-infinity.js | 1 + .../prototype/indexOf/fromIndex-minus-zero.js | 1 + .../get-length-uses-internal-arraylength.js | 1 + .../prototype/indexOf/invoked-as-func.js | 1 + .../prototype/indexOf/invoked-as-method.js | 1 + .../indexOf/length-zero-returns-minus-one.js | 1 + .../TypedArray/prototype/indexOf/length.js | 12 +- .../built-ins/TypedArray/prototype/indexOf/name.js | 12 +- .../TypedArray/prototype/indexOf/no-arg.js | 1 + .../prototype/indexOf/not-a-constructor.js | 3 +- .../TypedArray/prototype/indexOf/prop-desc.js | 1 + .../return-abrupt-from-this-out-of-bounds.js | 2 +- .../return-abrupt-tointeger-fromindex-symbol.js | 1 + .../indexOf/return-abrupt-tointeger-fromindex.js | 1 + .../indexOf/search-found-returns-index.js | 1 + .../indexOf/search-not-found-returns-minus-one.js | 1 + .../prototype/indexOf/strict-comparison.js | 1 + .../prototype/indexOf/this-is-not-object.js | 1 + .../indexOf/this-is-not-typedarray-instance.js | 1 + .../prototype/indexOf/tointeger-fromindex.js | 1 + ...or-result-from-tostring-on-each-simple-value.js | 1 + ...separator-result-from-tostring-on-each-value.js | 1 + ...buffer-during-fromIndex-returns-single-comma.js | 1 + .../TypedArray/prototype/join/detached-buffer.js | 1 + .../prototype/join/empty-instance-empty-string.js | 1 + .../join/get-length-uses-internal-arraylength.js | 1 + .../TypedArray/prototype/join/invoked-as-func.js | 1 + .../TypedArray/prototype/join/invoked-as-method.js | 1 + .../built-ins/TypedArray/prototype/join/length.js | 12 +- .../built-ins/TypedArray/prototype/join/name.js | 12 +- .../TypedArray/prototype/join/not-a-constructor.js | 3 +- .../TypedArray/prototype/join/prop-desc.js | 1 + .../result-from-tostring-on-each-simple-value.js | 1 + .../join/result-from-tostring-on-each-value.js | 1 + .../join/return-abrupt-from-separator-symbol.js | 1 + .../prototype/join/return-abrupt-from-separator.js | 1 + .../join/return-abrupt-from-this-out-of-bounds.js | 2 +- .../join/separator-tostring-once-after-resized.js | 42 ++ .../prototype/join/this-is-not-object.js | 1 + .../join/this-is-not-typedarray-instance.js | 1 + .../TypedArray/prototype/keys/detached-buffer.js | 1 + .../TypedArray/prototype/keys/invoked-as-func.js | 1 + .../TypedArray/prototype/keys/invoked-as-method.js | 1 + .../TypedArray/prototype/keys/iter-prototype.js | 1 + .../built-ins/TypedArray/prototype/keys/length.js | 12 +- .../built-ins/TypedArray/prototype/keys/name.js | 12 +- .../TypedArray/prototype/keys/not-a-constructor.js | 3 +- .../TypedArray/prototype/keys/prop-desc.js | 1 + .../keys/return-abrupt-from-this-out-of-bounds.js | 2 +- .../TypedArray/prototype/keys/return-itor.js | 1 + .../prototype/keys/this-is-not-object.js | 1 + .../keys/this-is-not-typedarray-instance.js | 1 + ...ng-fromIndex-returns-minus-one-for-undefined.js | 1 + ...-during-fromIndex-returns-minus-one-for-zero.js | 1 + .../prototype/lastIndexOf/detached-buffer.js | 1 + .../prototype/lastIndexOf/fromIndex-infinity.js | 1 + .../prototype/lastIndexOf/fromIndex-minus-zero.js | 1 + .../get-length-uses-internal-arraylength.js | 1 + .../prototype/lastIndexOf/invoked-as-func.js | 1 + .../prototype/lastIndexOf/invoked-as-method.js | 1 + .../lastIndexOf/length-zero-returns-minus-one.js | 1 + .../TypedArray/prototype/lastIndexOf/length.js | 12 +- .../TypedArray/prototype/lastIndexOf/name.js | 12 +- .../TypedArray/prototype/lastIndexOf/no-arg.js | 1 + .../prototype/lastIndexOf/not-a-constructor.js | 3 +- .../TypedArray/prototype/lastIndexOf/prop-desc.js | 1 + .../return-abrupt-from-this-out-of-bounds.js | 2 +- .../return-abrupt-tointeger-fromindex-symbol.js | 1 + .../return-abrupt-tointeger-fromindex.js | 1 + .../lastIndexOf/search-found-returns-index.js | 1 + .../search-not-found-returns-minus-one.js | 1 + .../prototype/lastIndexOf/strict-comparison.js | 1 + .../prototype/lastIndexOf/this-is-not-object.js | 1 + .../lastIndexOf/this-is-not-typedarray-instance.js | 1 + .../prototype/lastIndexOf/tointeger-fromindex.js | 1 + .../TypedArray/prototype/length/detached-buffer.js | 1 + .../prototype/length/invoked-as-accessor.js | 1 + .../TypedArray/prototype/length/invoked-as-func.js | 1 + .../TypedArray/prototype/length/length.js | 12 +- .../built-ins/TypedArray/prototype/length/name.js | 12 +- .../TypedArray/prototype/length/prop-desc.js | 1 + .../length/resizable-array-buffer-auto.js | 2 +- .../length/resizable-array-buffer-fixed.js | 2 +- .../TypedArray/prototype/length/return-length.js | 1 + .../length/this-has-no-typedarrayname-internal.js | 1 + .../prototype/length/this-is-not-object.js | 1 + .../prototype/map/arraylength-internal.js | 1 + .../map/callbackfn-arguments-with-thisarg.js | 1 + .../map/callbackfn-arguments-without-thisarg.js | 1 + .../prototype/map/callbackfn-detachbuffer.js | 1 + .../prototype/map/callbackfn-is-not-callable.js | 1 + ...n-no-interaction-over-non-integer-properties.js | 1 + .../map/callbackfn-not-called-on-empty.js | 1 + .../TypedArray/prototype/map/callbackfn-resize.js | 2 +- .../callbackfn-return-affects-returned-object.js | 1 + .../callbackfn-return-does-not-change-instance.js | 1 + ...-return-does-not-copy-non-integer-properties.js | 1 + .../prototype/map/callbackfn-returns-abrupt.js | 1 + .../map/callbackfn-set-value-during-interaction.js | 1 + .../TypedArray/prototype/map/callbackfn-this.js | 1 + .../TypedArray/prototype/map/detached-buffer.js | 1 + .../TypedArray/prototype/map/invoked-as-func.js | 1 + .../TypedArray/prototype/map/invoked-as-method.js | 1 + .../built-ins/TypedArray/prototype/map/length.js | 12 +- .../built-ins/TypedArray/prototype/map/name.js | 12 +- .../TypedArray/prototype/map/not-a-constructor.js | 3 +- .../TypedArray/prototype/map/prop-desc.js | 1 + .../map/return-abrupt-from-this-out-of-bounds.js | 2 +- ...pedarray-conversion-operation-consistent-nan.js | 1 + .../return-new-typedarray-conversion-operation.js | 1 + .../map/return-new-typedarray-from-empty-length.js | 1 + .../return-new-typedarray-from-positive-length.js | 1 + .../map/speciesctor-destination-resizable.js | 2 +- .../prototype/map/speciesctor-get-ctor-abrupt.js | 1 + .../map/speciesctor-get-ctor-inherited.js | 1 + .../map/speciesctor-get-ctor-returns-throws.js | 1 + .../prototype/map/speciesctor-get-ctor.js | 1 + .../map/speciesctor-get-species-abrupt.js | 1 + ...eciesctor-get-species-custom-ctor-invocation.js | 1 + ...tom-ctor-length-throws-resizable-arraybuffer.js | 2 +- ...esctor-get-species-custom-ctor-length-throws.js | 1 + .../speciesctor-get-species-custom-ctor-length.js | 1 + ...species-custom-ctor-returns-another-instance.js | 1 + .../speciesctor-get-species-custom-ctor-throws.js | 1 + .../map/speciesctor-get-species-custom-ctor.js | 1 + .../map/speciesctor-get-species-returns-throws.js | 1 + .../speciesctor-get-species-use-default-ctor.js | 1 + .../prototype/map/speciesctor-get-species.js | 1 + .../TypedArray/prototype/map/this-is-not-object.js | 1 + .../map/this-is-not-typedarray-instance.js | 1 + .../prototype/map/values-are-not-cached.js | 1 + .../callbackfn-arguments-custom-accumulator.js | 1 + .../callbackfn-arguments-default-accumulator.js | 1 + .../prototype/reduce/callbackfn-detachbuffer.js | 1 + .../reduce/callbackfn-is-not-callable-throws.js | 1 + ...kfn-no-iteration-over-non-integer-properties.js | 1 + .../reduce/callbackfn-not-called-on-empty.js | 1 + .../prototype/reduce/callbackfn-resize.js | 2 +- .../callbackfn-return-does-not-change-instance.js | 1 + .../prototype/reduce/callbackfn-returns-abrupt.js | 1 + .../callbackfn-set-value-during-iteration.js | 1 + .../TypedArray/prototype/reduce/callbackfn-this.js | 1 + .../TypedArray/prototype/reduce/detached-buffer.js | 1 + .../reduce/empty-instance-return-initialvalue.js | 1 + .../empty-instance-with-no-initialvalue-throws.js | 1 + .../reduce/get-length-uses-internal-arraylength.js | 1 + .../TypedArray/prototype/reduce/invoked-as-func.js | 1 + .../prototype/reduce/invoked-as-method.js | 1 + .../TypedArray/prototype/reduce/length.js | 12 +- .../built-ins/TypedArray/prototype/reduce/name.js | 12 +- .../prototype/reduce/not-a-constructor.js | 3 +- .../TypedArray/prototype/reduce/prop-desc.js | 1 + .../reduce/result-is-last-callbackfn-return.js | 1 + .../prototype/reduce/result-of-any-type.js | 1 + .../return-abrupt-from-this-out-of-bounds.js | 2 +- .../return-first-value-without-callbackfn.js | 1 + .../prototype/reduce/this-is-not-object.js | 1 + .../reduce/this-is-not-typedarray-instance.js | 1 + .../prototype/reduce/values-are-not-cached.js | 1 + .../callbackfn-arguments-custom-accumulator.js | 1 + .../callbackfn-arguments-default-accumulator.js | 1 + .../reduceRight/callbackfn-detachbuffer.js | 1 + .../callbackfn-is-not-callable-throws.js | 1 + ...kfn-no-iteration-over-non-integer-properties.js | 1 + .../reduceRight/callbackfn-not-called-on-empty.js | 1 + .../prototype/reduceRight/callbackfn-resize.js | 2 +- .../callbackfn-return-does-not-change-instance.js | 1 + .../reduceRight/callbackfn-returns-abrupt.js | 1 + .../callbackfn-set-value-during-iteration.js | 1 + .../prototype/reduceRight/callbackfn-this.js | 1 + .../prototype/reduceRight/detached-buffer.js | 1 + .../empty-instance-return-initialvalue.js | 1 + .../empty-instance-with-no-initialvalue-throws.js | 1 + .../get-length-uses-internal-arraylength.js | 1 + .../prototype/reduceRight/invoked-as-func.js | 1 + .../prototype/reduceRight/invoked-as-method.js | 1 + .../TypedArray/prototype/reduceRight/length.js | 12 +- .../TypedArray/prototype/reduceRight/name.js | 12 +- .../prototype/reduceRight/not-a-constructor.js | 3 +- .../TypedArray/prototype/reduceRight/prop-desc.js | 1 + .../result-is-last-callbackfn-return.js | 1 + .../prototype/reduceRight/result-of-any-type.js | 1 + .../return-abrupt-from-this-out-of-bounds.js | 2 +- .../return-first-value-without-callbackfn.js | 1 + .../prototype/reduceRight/this-is-not-object.js | 1 + .../reduceRight/this-is-not-typedarray-instance.js | 1 + .../prototype/reduceRight/values-are-not-cached.js | 1 + .../prototype/reverse/detached-buffer.js | 1 + .../get-length-uses-internal-arraylength.js | 1 + .../prototype/reverse/invoked-as-func.js | 1 + .../prototype/reverse/invoked-as-method.js | 1 + .../TypedArray/prototype/reverse/length.js | 12 +- .../built-ins/TypedArray/prototype/reverse/name.js | 12 +- .../prototype/reverse/not-a-constructor.js | 3 +- .../reverse/preserves-non-numeric-properties.js | 1 + .../TypedArray/prototype/reverse/prop-desc.js | 1 + .../return-abrupt-from-this-out-of-bounds.js | 2 +- .../prototype/reverse/returns-original-object.js | 1 + .../TypedArray/prototype/reverse/reverts.js | 1 + .../prototype/reverse/this-is-not-object.js | 1 + .../reverse/this-is-not-typedarray-instance.js | 1 + .../set/BigInt/src-typedarray-not-big-throws.js | 1 + .../array-arg-negative-integer-offset-throws.js | 1 + .../prototype/set/array-arg-offset-tointeger.js | 1 + .../prototype/set/array-arg-primitive-toobject.js | 1 + .../array-arg-return-abrupt-from-src-get-length.js | 1 + .../array-arg-return-abrupt-from-src-get-value.js | 1 + ...ray-arg-return-abrupt-from-src-length-symbol.js | 1 + .../set/array-arg-return-abrupt-from-src-length.js | 1 + ...return-abrupt-from-src-tonumber-value-symbol.js | 1 + ...ay-arg-return-abrupt-from-src-tonumber-value.js | 1 + ...g-return-abrupt-from-tointeger-offset-symbol.js | 1 + ...rray-arg-return-abrupt-from-tointeger-offset.js | 1 + ...array-arg-return-abrupt-from-toobject-offset.js | 1 + .../prototype/set/array-arg-set-values-in-order.js | 1 + .../prototype/set/array-arg-set-values.js | 1 + .../array-arg-src-tonumber-value-conversions.js | 1 + ...rray-arg-src-tonumber-value-type-conversions.js | 1 + .../set/array-arg-src-values-are-not-cached.js | 1 + .../set/array-arg-target-arraylength-internal.js | 1 + ...getbuffer-detached-on-get-src-value-no-throw.js | 1 + ...etbuffer-detached-on-tointeger-offset-throws.js | 1 + .../set/array-arg-targetbuffer-detached-throws.js | 1 + .../TypedArray/prototype/set/bit-precision.js | 1 + .../TypedArray/prototype/set/invoked-as-func.js | 1 + .../TypedArray/prototype/set/invoked-as-method.js | 1 + .../built-ins/TypedArray/prototype/set/length.js | 12 +- .../built-ins/TypedArray/prototype/set/name.js | 12 +- .../TypedArray/prototype/set/not-a-constructor.js | 3 +- .../TypedArray/prototype/set/prop-desc.js | 1 + .../prototype/set/src-typedarray-big-throws.js | 1 + .../TypedArray/prototype/set/this-is-not-object.js | 1 + .../set/this-is-not-typedarray-instance.js | 1 + ...ypedarray-arg-negative-integer-offset-throws.js | 1 + .../set/typedarray-arg-offset-tointeger.js | 1 + ...g-return-abrupt-from-tointeger-offset-symbol.js | 1 + ...rray-arg-return-abrupt-from-tointeger-offset.js | 1 + ...alues-diff-buffer-other-type-conversions-sab.js | 2 +- ...et-values-diff-buffer-other-type-conversions.js | 1 + ...ay-arg-set-values-diff-buffer-other-type-sab.js | 2 +- ...darray-arg-set-values-diff-buffer-other-type.js | 1 + ...ray-arg-set-values-diff-buffer-same-type-sab.js | 2 +- ...edarray-arg-set-values-diff-buffer-same-type.js | 1 + ...darray-arg-set-values-same-buffer-other-type.js | 1 + ...arg-set-values-same-buffer-same-type-resized.js | 2 +- ...ray-arg-set-values-same-buffer-same-type-sab.js | 2 +- ...edarray-arg-set-values-same-buffer-same-type.js | 1 + .../set/typedarray-arg-src-arraylength-internal.js | 1 + .../set/typedarray-arg-src-byteoffset-internal.js | 1 + ...range-greather-than-target-throws-rangeerror.js | 1 + ...ffer-detached-during-tointeger-offset-throws.js | 1 + .../typedarray-arg-target-arraylength-internal.js | 1 + .../typedarray-arg-target-byteoffset-internal.js | 1 + .../set/typedarray-arg-target-out-of-bounds.js | 2 +- ...ffer-detached-during-tointeger-offset-throws.js | 1 + .../prototype/slice/arraylength-internal.js | 1 + .../TypedArray/prototype/slice/bit-precision.js | 1 + ...detached-buffer-custom-ctor-other-targettype.js | 1 + .../detached-buffer-custom-ctor-same-targettype.js | 1 + .../prototype/slice/detached-buffer-get-ctor.js | 1 + ...r-speciesctor-get-species-custom-ctor-throws.js | 1 + ...ffer-zero-count-custom-ctor-other-targettype.js | 1 + ...uffer-zero-count-custom-ctor-same-targettype.js | 1 + .../TypedArray/prototype/slice/detached-buffer.js | 1 + .../TypedArray/prototype/slice/infinity.js | 1 + .../TypedArray/prototype/slice/invoked-as-func.js | 1 + .../prototype/slice/invoked-as-method.js | 1 + .../built-ins/TypedArray/prototype/slice/length.js | 12 +- .../TypedArray/prototype/slice/minus-zero.js | 1 + .../built-ins/TypedArray/prototype/slice/name.js | 12 +- .../prototype/slice/not-a-constructor.js | 3 +- .../TypedArray/prototype/slice/prop-desc.js | 1 + .../result-does-not-copy-ordinary-properties.js | 1 + .../slice/results-with-different-length.js | 1 + .../prototype/slice/results-with-empty-length.js | 1 + .../prototype/slice/results-with-same-length.js | 1 + .../slice/return-abrupt-from-end-symbol.js | 1 + .../prototype/slice/return-abrupt-from-end.js | 1 + .../slice/return-abrupt-from-start-symbol.js | 1 + .../prototype/slice/return-abrupt-from-start.js | 1 + .../slice/return-abrupt-from-this-out-of-bounds.js | 2 +- .../slice/set-values-from-different-ctor-type.js | 1 + .../slice/speciesctor-destination-resizable.js | 2 +- .../prototype/slice/speciesctor-get-ctor-abrupt.js | 1 + .../slice/speciesctor-get-ctor-inherited.js | 1 + .../slice/speciesctor-get-ctor-returns-throws.js | 1 + .../prototype/slice/speciesctor-get-ctor.js | 1 + .../slice/speciesctor-get-species-abrupt.js | 1 + ...eciesctor-get-species-custom-ctor-invocation.js | 1 + ...tom-ctor-length-throws-resizable-arraybuffer.js | 2 +- ...esctor-get-species-custom-ctor-length-throws.js | 1 + .../speciesctor-get-species-custom-ctor-length.js | 1 + ...species-custom-ctor-returns-another-instance.js | 1 + .../speciesctor-get-species-custom-ctor-throws.js | 1 + .../slice/speciesctor-get-species-custom-ctor.js | 1 + .../speciesctor-get-species-returns-throws.js | 1 + .../speciesctor-get-species-use-default-ctor.js | 1 + .../prototype/slice/speciesctor-get-species.js | 1 + .../prototype/slice/this-is-not-object.js | 1 + .../slice/this-is-not-typedarray-instance.js | 1 + .../TypedArray/prototype/slice/tointeger-end.js | 1 + .../TypedArray/prototype/slice/tointeger-start.js | 1 + .../some/callbackfn-arguments-with-thisarg.js | 1 + .../some/callbackfn-arguments-without-thisarg.js | 1 + .../prototype/some/callbackfn-detachbuffer.js | 1 + .../callbackfn-no-interaction-over-non-integer.js | 1 + .../some/callbackfn-not-callable-throws.js | 1 + .../some/callbackfn-not-called-on-empty.js | 1 + .../TypedArray/prototype/some/callbackfn-resize.js | 2 +- .../callbackfn-return-does-not-change-instance.js | 1 + .../prototype/some/callbackfn-returns-abrupt.js | 1 + .../callbackfn-set-value-during-interaction.js | 1 + .../TypedArray/prototype/some/callbackfn-this.js | 1 + .../TypedArray/prototype/some/detached-buffer.js | 1 + .../some/get-length-uses-internal-arraylength.js | 1 + .../TypedArray/prototype/some/invoked-as-func.js | 1 + .../TypedArray/prototype/some/invoked-as-method.js | 1 + .../built-ins/TypedArray/prototype/some/length.js | 12 +- .../built-ins/TypedArray/prototype/some/name.js | 12 +- .../TypedArray/prototype/some/not-a-constructor.js | 3 +- .../TypedArray/prototype/some/prop-desc.js | 1 + .../some/return-abrupt-from-this-out-of-bounds.js | 2 +- .../returns-false-if-every-cb-returns-false.js | 1 + .../some/returns-true-if-any-cb-returns-true.js | 1 + .../prototype/some/this-is-not-object.js | 1 + .../some/this-is-not-typedarray-instance.js | 1 + .../prototype/some/values-are-not-cached.js | 1 + .../prototype/sort/arraylength-internal.js | 1 + .../prototype/sort/comparefn-call-throws.js | 1 + .../TypedArray/prototype/sort/comparefn-calls.js | 1 + .../prototype/sort/comparefn-is-undefined.js | 1 + .../sort/comparefn-nonfunction-call-throws.js | 1 + .../TypedArray/prototype/sort/detached-buffer.js | 1 + .../TypedArray/prototype/sort/invoked-as-func.js | 1 + .../TypedArray/prototype/sort/invoked-as-method.js | 1 + .../built-ins/TypedArray/prototype/sort/length.js | 12 +- .../built-ins/TypedArray/prototype/sort/name.js | 12 +- .../TypedArray/prototype/sort/not-a-constructor.js | 3 +- .../TypedArray/prototype/sort/prop-desc.js | 1 + .../sort/return-abrupt-from-this-out-of-bounds.js | 2 +- .../prototype/sort/return-same-instance.js | 1 + .../TypedArray/prototype/sort/sort-tonumber.js | 1 + .../prototype/sort/sortcompare-with-no-tostring.js | 1 + .../TypedArray/prototype/sort/sorted-values-nan.js | 1 + .../TypedArray/prototype/sort/sorted-values.js | 1 + .../TypedArray/prototype/sort/stability.js | 1 + .../prototype/sort/this-is-not-object.js | 1 + .../sort/this-is-not-typedarray-instance.js | 1 + .../prototype/subarray/detached-buffer.js | 1 + .../TypedArray/prototype/subarray/infinity.js | 1 + .../prototype/subarray/invoked-as-func.js | 1 + .../prototype/subarray/invoked-as-method.js | 1 + .../TypedArray/prototype/subarray/length.js | 12 +- .../TypedArray/prototype/subarray/minus-zero.js | 1 + .../TypedArray/prototype/subarray/name.js | 12 +- .../prototype/subarray/not-a-constructor.js | 3 +- .../TypedArray/prototype/subarray/prop-desc.js | 1 + .../result-byteOffset-from-out-of-bounds.js | 52 ++ .../result-does-not-copy-ordinary-properties.js | 1 + .../result-is-new-instance-from-same-ctor.js | 1 + .../result-is-new-instance-with-shared-buffer.js | 1 + .../subarray/results-with-different-length.js | 1 + .../subarray/results-with-empty-length.js | 1 + .../prototype/subarray/results-with-same-length.js | 1 + .../subarray/return-abrupt-from-begin-symbol.js | 1 + .../prototype/subarray/return-abrupt-from-begin.js | 1 + .../subarray/return-abrupt-from-end-symbol.js | 1 + .../prototype/subarray/return-abrupt-from-end.js | 1 + .../subarray/speciesctor-get-ctor-abrupt.js | 1 + .../subarray/speciesctor-get-ctor-inherited.js | 1 + .../speciesctor-get-ctor-returns-throws.js | 1 + .../prototype/subarray/speciesctor-get-ctor.js | 1 + .../subarray/speciesctor-get-species-abrupt.js | 1 + ...eciesctor-get-species-custom-ctor-invocation.js | 1 + ...species-custom-ctor-returns-another-instance.js | 1 + .../speciesctor-get-species-custom-ctor-throws.js | 1 + .../speciesctor-get-species-custom-ctor.js | 1 + .../speciesctor-get-species-returns-throws.js | 1 + .../speciesctor-get-species-use-default-ctor.js | 1 + .../prototype/subarray/speciesctor-get-species.js | 1 + .../prototype/subarray/this-is-not-object.js | 1 + .../subarray/this-is-not-typedarray-instance.js | 1 + .../prototype/subarray/tointeger-begin.js | 1 + .../TypedArray/prototype/subarray/tointeger-end.js | 1 + .../calls-tolocalestring-from-each-value.js | 1 + .../calls-tostring-from-each-value.js | 1 + .../calls-valueof-from-each-value.js | 1 + .../prototype/toLocaleString/detached-buffer.js | 1 + .../empty-instance-returns-empty-string.js | 1 + .../get-length-uses-internal-arraylength.js | 1 + .../prototype/toLocaleString/invoked-as-func.js | 1 + .../prototype/toLocaleString/invoked-as-method.js | 1 + .../TypedArray/prototype/toLocaleString/length.js | 12 +- .../TypedArray/prototype/toLocaleString/name.js | 12 +- .../prototype/toLocaleString/not-a-constructor.js | 3 +- .../prototype/toLocaleString/prop-desc.js | 1 + ...turn-abrupt-from-firstelement-tolocalestring.js | 1 + .../return-abrupt-from-firstelement-tostring.js | 1 + .../return-abrupt-from-firstelement-valueof.js | 1 + ...eturn-abrupt-from-nextelement-tolocalestring.js | 1 + .../return-abrupt-from-nextelement-tostring.js | 1 + .../return-abrupt-from-nextelement-valueof.js | 1 + .../return-abrupt-from-this-out-of-bounds.js | 2 +- .../prototype/toLocaleString/return-result.js | 1 + .../prototype/toLocaleString/this-is-not-object.js | 1 + .../this-is-not-typedarray-instance.js | 1 + .../prototype/toReversed/ignores-species.js | 1 + .../TypedArray/prototype/toReversed/immutable.js | 1 + .../toReversed/length-property-ignored.js | 1 + .../prototype/toReversed/metadata/length.js | 1 + .../prototype/toReversed/metadata/name.js | 1 + .../toReversed/metadata/property-descriptor.js | 1 + .../prototype/toReversed/not-a-constructor.js | 3 +- .../prototype/toReversed/this-value-invalid.js | 1 + .../prototype/toSorted/comparefn-not-a-function.js | 1 + .../toSorted/comparefn-stop-after-error.js | 1 + .../prototype/toSorted/ignores-species.js | 1 + .../TypedArray/prototype/toSorted/immutable.js | 1 + .../prototype/toSorted/length-property-ignored.js | 1 + .../prototype/toSorted/metadata/length.js | 1 + .../TypedArray/prototype/toSorted/metadata/name.js | 1 + .../toSorted/metadata/property-descriptor.js | 1 + .../prototype/toSorted/not-a-constructor.js | 3 +- .../prototype/toSorted/this-value-invalid.js | 1 + .../built-ins/TypedArray/prototype/toString.js | 1 + .../prototype/toString/detached-buffer.js | 1 + .../prototype/toString/not-a-constructor.js | 3 +- .../TypedArray/prototype/values/detached-buffer.js | 1 + .../TypedArray/prototype/values/invoked-as-func.js | 1 + .../prototype/values/invoked-as-method.js | 1 + .../TypedArray/prototype/values/iter-prototype.js | 1 + .../TypedArray/prototype/values/length.js | 12 +- .../values/make-in-bounds-after-exhausted.js | 58 ++ .../values/make-out-of-bounds-after-exhausted.js | 52 ++ .../built-ins/TypedArray/prototype/values/name.js | 12 +- .../prototype/values/not-a-constructor.js | 3 +- .../TypedArray/prototype/values/prop-desc.js | 1 + .../return-abrupt-from-this-out-of-bounds.js | 2 +- .../TypedArray/prototype/values/return-itor.js | 1 + .../prototype/values/this-is-not-object.js | 1 + .../values/this-is-not-typedarray-instance.js | 1 + .../prototype/with/early-type-coercion.js | 1 + .../TypedArray/prototype/with/ignores-species.js | 1 + .../TypedArray/prototype/with/immutable.js | 1 + .../with/index-bigger-or-eq-than-length.js | 1 + .../prototype/with/index-casted-to-number.js | 1 + .../TypedArray/prototype/with/index-negative.js | 1 + .../with/index-smaller-than-minus-length.js | 1 + .../with/index-validated-against-current-length.js | 61 ++ .../prototype/with/length-property-ignored.js | 1 + .../TypedArray/prototype/with/metadata/length.js | 1 + .../TypedArray/prototype/with/metadata/name.js | 1 + .../prototype/with/metadata/property-descriptor.js | 1 + .../TypedArray/prototype/with/not-a-constructor.js | 1 + .../prototype/with/this-value-invalid.js | 1 + js/src/tests/test262/built-ins/TypedArray/shell.js | 347 ++++++++--- .../TypedArrayConstructors/BigInt64Array/proto.js | 1 + .../BigInt64Array/prototype/proto.js | 1 + .../TypedArrayConstructors/BigUint64Array/proto.js | 1 + .../BigUint64Array/prototype/proto.js | 1 + .../TypedArrayConstructors/Float32Array/name.js | 11 +- .../TypedArrayConstructors/Float32Array/proto.js | 1 + .../Float32Array/prototype/proto.js | 1 + .../TypedArrayConstructors/Float64Array/name.js | 11 +- .../TypedArrayConstructors/Float64Array/proto.js | 1 + .../Float64Array/prototype/proto.js | 1 + .../TypedArrayConstructors/Int16Array/name.js | 11 +- .../TypedArrayConstructors/Int16Array/proto.js | 1 + .../Int16Array/prototype/proto.js | 1 + .../TypedArrayConstructors/Int32Array/name.js | 11 +- .../TypedArrayConstructors/Int32Array/proto.js | 1 + .../Int32Array/prototype/proto.js | 1 + .../TypedArrayConstructors/Int8Array/name.js | 11 +- .../TypedArrayConstructors/Int8Array/proto.js | 1 + .../Int8Array/prototype/proto.js | 1 + .../TypedArrayConstructors/Uint16Array/name.js | 11 +- .../TypedArrayConstructors/Uint16Array/proto.js | 1 + .../Uint16Array/prototype/proto.js | 1 + .../TypedArrayConstructors/Uint32Array/name.js | 11 +- .../TypedArrayConstructors/Uint32Array/proto.js | 1 + .../Uint32Array/prototype/proto.js | 1 + .../TypedArrayConstructors/Uint8Array/name.js | 11 +- .../TypedArrayConstructors/Uint8Array/proto.js | 1 + .../Uint8Array/prototype/proto.js | 1 + .../Uint8ClampedArray/name.js | 11 +- .../Uint8ClampedArray/proto.js | 1 + .../Uint8ClampedArray/prototype/proto.js | 1 + .../src-typedarray-not-big-throws.js | 1 + ...teoffset-throws-from-modulo-element-size-sab.js | 2 +- ...erbyteoffset-throws-from-modulo-element-size.js | 1 + .../byteoffset-is-negative-throws-sab.js | 2 +- .../buffer-arg/byteoffset-is-negative-throws.js | 1 + .../buffer-arg/byteoffset-is-negative-zero-sab.js | 2 +- .../buffer-arg/byteoffset-is-negative-zero.js | 1 + .../buffer-arg/byteoffset-is-symbol-throws-sab.js | 2 +- .../buffer-arg/byteoffset-is-symbol-throws.js | 1 + ...teoffset-throws-from-modulo-element-size-sab.js | 2 +- .../byteoffset-throws-from-modulo-element-size.js | 1 + .../byteoffset-to-number-detachbuffer.js | 1 + .../buffer-arg/byteoffset-to-number-throws-sab.js | 2 +- .../buffer-arg/byteoffset-to-number-throws.js | 1 + .../buffer-arg/custom-proto-access-throws-sab.js | 2 +- .../ctors/buffer-arg/custom-proto-access-throws.js | 1 + .../buffer-arg/defined-length-and-offset-sab.js | 2 +- .../ctors/buffer-arg/defined-length-and-offset.js | 1 + .../ctors/buffer-arg/defined-length-sab.js | 2 +- .../ctors/buffer-arg/defined-length.js | 1 + .../buffer-arg/defined-negative-length-sab.js | 2 +- .../ctors/buffer-arg/defined-negative-length.js | 1 + .../ctors/buffer-arg/defined-offset-sab.js | 2 +- .../ctors/buffer-arg/defined-offset.js | 1 + .../ctors/buffer-arg/detachedbuffer.js | 1 + .../buffer-arg/excessive-length-throws-sab.js | 2 +- .../ctors/buffer-arg/excessive-length-throws.js | 1 + .../excessive-offset-throws-resizable-ab.js | 2 +- .../buffer-arg/excessive-offset-throws-sab.js | 2 +- .../ctors/buffer-arg/excessive-offset-throws.js | 1 + .../invoked-with-undefined-newtarget-sab.js | 2 +- .../buffer-arg/invoked-with-undefined-newtarget.js | 1 + .../ctors/buffer-arg/is-referenced-sab.js | 2 +- .../ctors/buffer-arg/is-referenced.js | 1 + .../ctors/buffer-arg/length-access-throws-sab.js | 2 +- .../ctors/buffer-arg/length-access-throws.js | 1 + .../buffer-arg/length-is-symbol-throws-sab.js | 2 +- .../ctors/buffer-arg/length-is-symbol-throws.js | 1 + .../buffer-arg/length-to-number-detachbuffer.js | 1 + .../buffer-arg/new-instance-extensibility-sab.js | 2 +- .../ctors/buffer-arg/new-instance-extensibility.js | 1 + .../ctors/buffer-arg/proto-from-ctor-realm-sab.js | 2 +- .../ctors/buffer-arg/proto-from-ctor-realm.js | 1 + .../ctors/buffer-arg/returns-new-instance-sab.js | 2 +- .../ctors/buffer-arg/returns-new-instance.js | 1 + .../ctors/buffer-arg/toindex-bytelength-sab.js | 2 +- .../ctors/buffer-arg/toindex-bytelength.js | 1 + .../ctors/buffer-arg/toindex-byteoffset-sab.js | 2 +- .../ctors/buffer-arg/toindex-byteoffset.js | 1 + .../typedarray-backed-by-sharedarraybuffer.js | 2 +- .../buffer-arg/use-custom-proto-if-object-sab.js | 2 +- .../ctors/buffer-arg/use-custom-proto-if-object.js | 1 + ...ault-proto-if-custom-proto-is-not-object-sab.js | 2 +- ...-default-proto-if-custom-proto-is-not-object.js | 1 + .../ctors/length-arg/custom-proto-access-throws.js | 1 + .../ctors/length-arg/init-zeros.js | 1 + .../length-arg/is-infinity-throws-rangeerror.js | 1 + .../is-negative-integer-throws-rangeerror.js | 1 + .../ctors/length-arg/is-symbol-throws.js | 1 + .../ctors/length-arg/new-instance-extensibility.js | 1 + .../ctors/length-arg/proto-from-ctor-realm.js | 1 + .../ctors/length-arg/returns-object.js | 1 + .../ctors/length-arg/toindex-length.js | 1 + .../ctors/length-arg/undefined-newtarget-throws.js | 1 + .../ctors/length-arg/use-custom-proto-if-object.js | 1 + ...-default-proto-if-custom-proto-is-not-object.js | 1 + .../ctors/no-args/custom-proto-access-throws.js | 1 + .../ctors/no-args/new-instance-extensibility.js | 1 + .../ctors/no-args/proto-from-ctor-realm.js | 1 + .../ctors/no-args/returns-object.js | 1 + .../ctors/no-args/undefined-newtarget-throws.js | 1 + .../ctors/no-args/use-custom-proto-if-object.js | 1 + ...-default-proto-if-custom-proto-is-not-object.js | 1 + .../ctors/object-arg/as-array-returns.js | 1 + .../object-arg/as-generator-iterable-returns.js | 1 + .../conversion-operation-consistent-nan.js | 1 + .../ctors/object-arg/conversion-operation.js | 1 + .../ctors/object-arg/custom-proto-access-throws.js | 1 + .../iterated-array-changed-by-tonumber.js | 46 ++ .../iterated-array-with-modified-array-iterator.js | 52 ++ .../ctors/object-arg/iterating-throws.js | 1 + .../object-arg/iterator-is-null-as-array-like.js | 1 + .../object-arg/iterator-not-callable-throws.js | 1 + .../ctors/object-arg/iterator-throws.js | 1 + .../ctors/object-arg/length-excessive-throws.js | 1 + .../ctors/object-arg/length-is-symbol-throws.js | 1 + .../ctors/object-arg/length-throws.js | 1 + .../ctors/object-arg/new-instance-extensibility.js | 1 + .../ctors/object-arg/proto-from-ctor-realm.js | 1 + .../ctors/object-arg/returns.js | 1 + .../ctors/object-arg/shell.js | 347 ++++++++--- .../ctors/object-arg/throws-from-property.js | 1 + .../throws-setting-obj-to-primitive-typeerror.js | 1 + .../object-arg/throws-setting-obj-to-primitive.js | 1 + .../object-arg/throws-setting-obj-tostring.js | 1 + .../throws-setting-obj-valueof-typeerror.js | 1 + .../ctors/object-arg/throws-setting-obj-valueof.js | 1 + .../ctors/object-arg/throws-setting-property.js | 1 + .../object-arg/throws-setting-symbol-property.js | 1 + .../ctors/object-arg/undefined-newtarget-throws.js | 1 + .../ctors/object-arg/use-custom-proto-if-object.js | 1 + ...-default-proto-if-custom-proto-is-not-object.js | 1 + .../typedarray-arg/custom-proto-access-throws.js | 1 + .../typedarray-arg/new-instance-extensibility.js | 1 + .../other-ctor-returns-new-typedarray.js | 1 + .../ctors/typedarray-arg/proto-from-ctor-realm.js | 1 + .../ctors/typedarray-arg/returns-new-instance.js | 1 + .../same-ctor-buffer-ctor-species-null.js | 1 + .../same-ctor-buffer-ctor-species-undefined.js | 1 + .../same-ctor-returns-new-cloned-typedarray.js | 1 + .../typedarray-arg/src-typedarray-big-throws.js | 1 + .../typedarray-arg/undefined-newtarget-throws.js | 1 + .../typedarray-arg/use-custom-proto-if-object.js | 1 + ...-default-proto-if-custom-proto-is-not-object.js | 1 + .../from/arylk-get-length-error.js | 1 + .../from/arylk-to-length-error.js | 1 + .../custom-ctor-does-not-instantiate-ta-throws.js | 1 + .../from/custom-ctor-returns-other-instance.js | 1 + .../custom-ctor-returns-smaller-instance-throws.js | 1 + .../TypedArrayConstructors/from/custom-ctor.js | 1 + .../TypedArrayConstructors/from/inherited.js | 1 + .../TypedArrayConstructors/from/invoked-as-func.js | 1 + .../from/iter-access-error.js | 1 + .../from/iter-invoke-error.js | 1 + .../TypedArrayConstructors/from/iter-next-error.js | 1 + .../from/iter-next-value-error.js | 1 + .../from/mapfn-abrupt-completion.js | 1 + .../TypedArrayConstructors/from/mapfn-arguments.js | 1 + .../from/mapfn-is-not-callable.js | 1 + .../from/mapfn-this-with-thisarg.js | 1 + .../from/mapfn-this-without-thisarg-non-strict.js | 1 + .../mapfn-this-without-thisarg-strict-strict.js | 1 + .../TypedArrayConstructors/from/nan-conversion.js | 1 + .../from/new-instance-empty.js | 1 + .../from/new-instance-from-ordinary-object.js | 1 + .../from/new-instance-from-sparse-array.js | 1 + .../from/new-instance-from-zero.js | 1 + .../from/new-instance-using-custom-ctor.js | 1 + .../from/new-instance-with-mapfn.js | 1 + .../from/new-instance-without-mapfn.js | 1 + .../from/property-abrupt-completion.js | 1 + .../from/set-value-abrupt-completion.js | 1 + .../from/source-value-is-symbol-throws.js | 1 + .../from/this-is-not-constructor.js | 1 + .../conversion-operation-consistent-nan.js | 1 + .../DefineOwnProperty/conversion-operation.js | 1 + .../DefineOwnProperty/desc-value-throws.js | 1 + .../detached-buffer-throws-realm.js | 1 + .../DefineOwnProperty/detached-buffer-throws.js | 1 + .../internals/DefineOwnProperty/detached-buffer.js | 1 + .../key-is-greater-than-last-index.js | 1 + .../DefineOwnProperty/key-is-lower-than-zero.js | 1 + .../DefineOwnProperty/key-is-minus-zero.js | 1 + .../key-is-not-canonical-index.js | 1 + .../DefineOwnProperty/key-is-not-integer.js | 1 + .../key-is-not-numeric-index-throws.js | 1 + .../DefineOwnProperty/key-is-not-numeric-index.js | 1 + .../key-is-numericindex-accessor-desc-throws.js | 1 + .../key-is-numericindex-accessor-desc.js | 1 + .../key-is-numericindex-desc-configurable.js | 1 + ...is-numericindex-desc-not-configurable-throws.js | 1 + ...y-is-numericindex-desc-not-enumerable-throws.js | 1 + .../key-is-numericindex-desc-not-enumerable.js | 1 + ...key-is-numericindex-desc-not-writable-throws.js | 1 + .../key-is-numericindex-desc-not-writable.js | 1 + .../DefineOwnProperty/key-is-numericindex.js | 1 + .../internals/DefineOwnProperty/key-is-symbol.js | 1 + .../DefineOwnProperty/non-extensible-new-key.js | 1 + .../non-extensible-redefine-key.js | 1 + .../internals/DefineOwnProperty/set-value.js | 1 + .../internals/DefineOwnProperty/shell.js | 347 ++++++++--- .../DefineOwnProperty/this-is-not-extensible.js | 1 + .../tonumber-value-detached-buffer.js | 1 + .../Delete/BigInt/detached-buffer-key-is-symbol.js | 1 + .../Delete/BigInt/detached-buffer-realm.js | 1 + .../BigInt/indexed-value-ab-strict-strict.js | 8 +- .../Delete/BigInt/indexed-value-sab-non-strict.js | 2 +- .../BigInt/indexed-value-sab-strict-strict.js | 2 +- .../key-is-not-canonical-index-strict-strict.js | 2 +- .../BigInt/key-is-not-minus-zero-strict-strict.js | 2 +- .../BigInt/key-is-not-numeric-index-get-throws.js | 2 +- .../key-is-not-numeric-index-strict-strict.js | 2 +- .../BigInt/key-is-out-of-bounds-strict-strict.js | 4 +- .../detached-buffer-key-is-not-numeric-index.js | 1 + .../Delete/detached-buffer-key-is-symbol.js | 1 + .../internals/Delete/detached-buffer-realm.js | 1 + .../internals/Delete/detached-buffer.js | 1 + .../Delete/indexed-value-ab-non-strict.js | 1 + .../Delete/indexed-value-ab-strict-strict.js | 9 +- .../Delete/indexed-value-sab-non-strict.js | 2 +- .../Delete/indexed-value-sab-strict-strict.js | 2 +- .../internals/Delete/infinity-detached-buffer.js | 1 + .../key-is-not-canonical-index-non-strict.js | 1 + .../key-is-not-canonical-index-strict-strict.js | 3 +- .../internals/Delete/key-is-not-integer.js | 1 + .../Delete/key-is-not-minus-zero-non-strict.js | 1 + .../Delete/key-is-not-minus-zero-strict-strict.js | 3 +- .../Delete/key-is-not-numeric-index-get-throws.js | 3 +- .../Delete/key-is-not-numeric-index-non-strict.js | 1 + .../key-is-not-numeric-index-strict-strict.js | 3 +- .../Delete/key-is-out-of-bounds-non-strict.js | 1 + .../Delete/key-is-out-of-bounds-strict-strict.js | 5 +- .../internals/Delete/key-is-symbol.js | 1 + .../detached-buffer-key-is-not-numeric-index.js | 1 + .../internals/Get/detached-buffer-key-is-symbol.js | 1 + .../internals/Get/detached-buffer-realm.js | 1 + .../internals/Get/detached-buffer.js | 1 + .../internals/Get/indexed-value-sab.js | 2 +- .../internals/Get/indexed-value.js | 1 + .../internals/Get/infinity-detached-buffer.js | 1 + .../internals/Get/key-is-not-canonical-index.js | 1 + .../internals/Get/key-is-not-integer.js | 1 + .../internals/Get/key-is-not-minus-zero.js | 1 + .../Get/key-is-not-numeric-index-get-throws.js | 1 + .../internals/Get/key-is-not-numeric-index.js | 1 + .../internals/Get/key-is-out-of-bounds.js | 1 + .../internals/Get/key-is-symbol.js | 1 + .../detached-buffer-key-is-not-number.js | 1 + .../detached-buffer-key-is-symbol.js | 1 + .../GetOwnProperty/detached-buffer-realm.js | 1 + .../internals/GetOwnProperty/detached-buffer.js | 1 + .../GetOwnProperty/enumerate-detached-buffer.js | 1 + .../internals/GetOwnProperty/index-prop-desc.js | 1 + .../internals/GetOwnProperty/key-is-minus-zero.js | 1 + .../GetOwnProperty/key-is-not-canonical-index.js | 1 + .../internals/GetOwnProperty/key-is-not-integer.js | 1 + .../GetOwnProperty/key-is-not-numeric-index.js | 1 + .../GetOwnProperty/key-is-out-of-bounds.js | 1 + .../internals/GetOwnProperty/key-is-symbol.js | 1 + .../abrupt-from-ordinary-has-parent-hasproperty.js | 2 +- .../abrupt-from-ordinary-has-parent-hasproperty.js | 3 +- .../detached-buffer-key-is-not-number.js | 1 + .../HasProperty/detached-buffer-key-is-symbol.js | 1 + .../internals/HasProperty/detached-buffer-realm.js | 1 + .../internals/HasProperty/detached-buffer.js | 1 + .../internals/HasProperty/indexed-value.js | 1 + .../HasProperty/infinity-with-detached-buffer.js | 1 + .../internals/HasProperty/inherited-property.js | 1 + .../HasProperty/key-is-greater-than-last-index.js | 1 + .../HasProperty/key-is-lower-than-zero.js | 1 + .../internals/HasProperty/key-is-minus-zero.js | 1 + .../HasProperty/key-is-not-canonical-index.js | 1 + .../internals/HasProperty/key-is-not-integer.js | 1 + .../HasProperty/key-is-not-numeric-index.js | 1 + .../internals/HasProperty/key-is-symbol.js | 1 + .../HasProperty/resizable-array-buffer-auto.js | 2 +- .../HasProperty/resizable-array-buffer-fixed.js | 2 +- .../integer-indexes-and-string-and-symbol-keys-.js | 1 + .../integer-indexes-and-string-keys.js | 1 + .../integer-indexes-resizable-array-buffer-auto.js | 2 +- ...integer-indexes-resizable-array-buffer-fixed.js | 2 +- .../internals/OwnPropertyKeys/integer-indexes.js | 1 + .../OwnPropertyKeys/not-enumerable-keys.js | 1 + .../BigInt/key-is-not-numeric-index-set-throws.js | 2 +- .../internals/Set/BigInt/null-tobigint.js | 2 +- .../internals/Set/BigInt/number-tobigint.js | 14 +- .../internals/Set/BigInt/string-nan-tobigint.js | 2 +- .../internals/Set/BigInt/symbol-tobigint.js | 2 +- .../internals/Set/BigInt/undefined-tobigint.js | 2 +- .../internals/Set/bigint-tonumber.js | 3 +- .../Set/conversion-operation-consistent-nan.js | 1 + .../internals/Set/conversion-operation.js | 1 + .../detached-buffer-key-is-not-numeric-index.js | 1 + .../internals/Set/detached-buffer-key-is-symbol.js | 1 + .../internals/Set/detached-buffer-realm.js | 1 + .../internals/Set/detached-buffer.js | 3 +- .../internals/Set/indexed-value.js | 1 + .../internals/Set/key-is-minus-zero.js | 1 + .../internals/Set/key-is-not-canonical-index.js | 1 + .../internals/Set/key-is-not-integer.js | 1 + .../Set/key-is-not-numeric-index-set-throws.js | 3 +- .../internals/Set/key-is-not-numeric-index.js | 1 + .../internals/Set/key-is-out-of-bounds.js | 1 + .../internals/Set/key-is-symbol.js | 1 + .../resized-out-of-bounds-to-in-bounds-index.js | 40 ++ .../TypedArrayConstructors/internals/Set/shell.js | 347 ++++++++--- .../Set/tonumber-value-detached-buffer.js | 1 + .../internals/Set/tonumber-value-throws.js | 13 +- .../of/argument-is-symbol-throws.js | 1 + .../of/argument-number-value-throws.js | 1 + .../custom-ctor-does-not-instantiate-ta-throws.js | 1 + .../of/custom-ctor-returns-other-instance.js | 1 + .../custom-ctor-returns-smaller-instance-throws.js | 1 + .../TypedArrayConstructors/of/custom-ctor.js | 1 + .../TypedArrayConstructors/of/inherited.js | 1 + .../TypedArrayConstructors/of/invoked-as-func.js | 1 + .../TypedArrayConstructors/of/nan-conversion.js | 1 + .../of/new-instance-empty.js | 1 + .../of/new-instance-from-zero.js | 1 + .../of/new-instance-using-custom-ctor.js | 1 + .../TypedArrayConstructors/of/new-instance.js | 1 + .../of/this-is-not-constructor.js | 1 + .../prototype/Symbol.iterator.js | 1 + .../prototype/Symbol.toStringTag/inherited.js | 1 + .../prototype/buffer/inherited.js | 1 + .../prototype/byteLength/inherited.js | 1 + .../prototype/byteOffset/inherited.js | 1 + .../prototype/copyWithin/inherited.js | 1 + .../prototype/entries/inherited.js | 1 + .../prototype/every/inherited.js | 1 + .../prototype/fill/inherited.js | 1 + .../prototype/filter/inherited.js | 1 + .../prototype/find/inherited.js | 1 + .../prototype/findIndex/inherited.js | 1 + .../prototype/forEach/inherited.js | 1 + .../prototype/indexOf/inherited.js | 1 + .../prototype/join/inherited.js | 1 + .../prototype/keys/inherited.js | 1 + .../prototype/lastIndexOf/inherited.js | 1 + .../prototype/length/inherited.js | 1 + .../prototype/map/inherited.js | 1 + .../prototype/reduce/inherited.js | 1 + .../prototype/reduceRight/inherited.js | 1 + .../prototype/reverse/inherited.js | 1 + .../prototype/set/inherited.js | 1 + .../prototype/slice/inherited.js | 1 + .../prototype/some/inherited.js | 1 + .../prototype/sort/inherited.js | 1 + .../prototype/subarray/inherited.js | 1 + .../prototype/toLocaleString/inherited.js | 1 + .../prototype/toString/inherited.js | 1 + .../prototype/values/inherited.js | 1 + js/src/tests/test262/built-ins/WeakMap/length.js | 11 +- js/src/tests/test262/built-ins/WeakMap/name.js | 14 +- .../built-ins/WeakMap/prototype/delete/length.js | 14 +- .../built-ins/WeakMap/prototype/delete/name.js | 14 +- .../WeakMap/prototype/delete/not-a-constructor.js | 2 +- .../built-ins/WeakMap/prototype/get/length.js | 14 +- .../built-ins/WeakMap/prototype/get/name.js | 14 +- .../WeakMap/prototype/get/not-a-constructor.js | 2 +- .../built-ins/WeakMap/prototype/has/length.js | 14 +- .../built-ins/WeakMap/prototype/has/name.js | 14 +- .../WeakMap/prototype/has/not-a-constructor.js | 2 +- .../built-ins/WeakMap/prototype/set/length.js | 14 +- .../built-ins/WeakMap/prototype/set/name.js | 14 +- .../WeakMap/prototype/set/not-a-constructor.js | 2 +- .../WeakRef/prototype/deref/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/WeakSet/length.js | 11 +- js/src/tests/test262/built-ins/WeakSet/name.js | 14 +- .../built-ins/WeakSet/prototype/add/length.js | 14 +- .../built-ins/WeakSet/prototype/add/name.js | 14 +- .../WeakSet/prototype/add/not-a-constructor.js | 2 +- .../built-ins/WeakSet/prototype/delete/length.js | 14 +- .../built-ins/WeakSet/prototype/delete/name.js | 14 +- .../WeakSet/prototype/delete/not-a-constructor.js | 2 +- .../built-ins/WeakSet/prototype/has/length.js | 14 +- .../built-ins/WeakSet/prototype/has/name.js | 14 +- .../WeakSet/prototype/has/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/decodeURI/name.js | 11 +- .../built-ins/decodeURI/not-a-constructor.js | 2 +- .../test262/built-ins/decodeURIComponent/name.js | 11 +- .../decodeURIComponent/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/encodeURI/name.js | 11 +- .../built-ins/encodeURI/not-a-constructor.js | 2 +- .../test262/built-ins/encodeURIComponent/name.js | 11 +- .../encodeURIComponent/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/eval/name.js | 11 +- .../test262/built-ins/eval/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/isFinite/length.js | 11 +- js/src/tests/test262/built-ins/isFinite/name.js | 11 +- .../built-ins/isFinite/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/isNaN/length.js | 11 +- js/src/tests/test262/built-ins/isNaN/name.js | 11 +- .../test262/built-ins/isNaN/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/parseFloat/name.js | 11 +- .../built-ins/parseFloat/not-a-constructor.js | 2 +- js/src/tests/test262/built-ins/parseInt/name.js | 11 +- .../built-ins/parseInt/not-a-constructor.js | 2 +- js/src/tests/test262/harness/shell.js | 355 ++++++++--- .../testTypedArray-conversions-call-error.js | 1 + .../test262/harness/testTypedArray-conversions.js | 1 + js/src/tests/test262/harness/testTypedArray.js | 1 + .../prototype/format/dayPeriod-long-en.js | 2 +- .../prototype/format/dayPeriod-narrow-en.js | 2 +- .../prototype/format/dayPeriod-short-en.js | 2 +- .../prototype/format/fractionalSecondDigits.js | 2 +- .../formatToParts/fractionalSecondDigits.js | 2 +- .../prototype/resolvedOptions/hourCycle-default.js | 38 +- .../DateTimeFormat/timezone-legacy-non-iana.js | 45 ++ .../prototype/of/type-region-invalid.js | 2 +- .../constructor-unit-style-defaults.js | 34 ++ .../format/fractions-of-subsecond-units-en.js | 65 ++ .../format/mixed-non-numeric-styles-es.js | 88 +++ .../prototype/format/mixed-short-and-numeric.js | 37 ++ .../format/negative-duration-style-default-en.js | 2 +- .../format/negative-duration-style-short-en.js | 2 +- .../format/negative-durationstyle-digital-en.js | 2 +- .../format/negative-durationstyle-long-en.js | 2 +- .../format/negative-durationstyle-narrow-en.js | 2 +- ...-hour-with-zero-minutes-and-non-zero-seconds.js | 20 +- .../format/precision-exact-mathematical-values.js | 2 +- .../prototype/format/style-default-en.js | 2 +- .../prototype/format/style-digital-en.js | 2 +- .../format/style-digital-fractionalDigits-en.js | 51 ++ .../style-digital-fractionalDigits-undefined-en.js | 80 +++ .../style-digital-fractionalDigits-undefined.js | 71 --- .../format/style-digital-fractionalDigits.js | 50 -- .../prototype/format/style-long-en.js | 2 +- .../prototype/format/style-narrow-en.js | 2 +- .../prototype/format/style-short-en.js | 2 +- ...tive-duration-formatToParts-style-default-en.js | 2 +- ...tive-duration-formatToParts-style-digital-en.js | 2 +- ...egative-duration-formatToParts-style-long-en.js | 2 +- ...ative-duration-formatToParts-style-narrow-en.js | 2 +- ...gative-duration-formatToParts-style-short-en.js | 2 +- .../constructor-options-collation-invalid.js | 2 +- .../Locale/prototype/calendar/canonicalize.js | 22 + .../Temporal/Calendar/prototype/dateAdd/shell.js | 8 + .../Calendar/prototype/dateFromFields/shell.js | 8 + .../Temporal/Calendar/prototype/dateUntil/shell.js | 8 + .../Temporal/Calendar/prototype/day/shell.js | 8 + .../Temporal/Calendar/prototype/dayOfWeek/shell.js | 8 + .../Temporal/Calendar/prototype/dayOfYear/shell.js | 8 + .../Calendar/prototype/daysInMonth/shell.js | 8 + .../Calendar/prototype/daysInWeek/shell.js | 8 + .../Calendar/prototype/daysInYear/shell.js | 8 + .../argument-propertybag-calendar-iso-string.js | 28 + .../era/argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../Temporal/Calendar/prototype/era/shell.js | 8 + .../argument-propertybag-calendar-iso-string.js | 28 + .../argument-propertybag-calendar-year-zero.js | 3 +- ...ument-string-calendar-annotation-invalid-key.js | 25 + .../Temporal/Calendar/prototype/eraYear/shell.js | 8 + .../Calendar/prototype/inLeapYear/shell.js | 8 + .../Temporal/Calendar/prototype/month/shell.js | 8 + .../Temporal/Calendar/prototype/monthCode/shell.js | 8 + .../Calendar/prototype/monthDayFromFields/shell.js | 8 + .../Calendar/prototype/monthsInYear/shell.js | 8 + .../prototype/weekOfYear/gregory-iso-weekofyear.js | 30 + .../prototype/weekOfYear/non-iso-week-of-year.js | 25 + .../Calendar/prototype/weekOfYear/shell.js | 8 + .../Temporal/Calendar/prototype/year/shell.js | 8 + .../prototype/yearMonthFromFields/shell.js | 8 + .../prototype/yearOfWeek/gregory-iso-weekofyear.js | 30 + .../prototype/yearOfWeek/non-iso-week-of-year.js | 25 + .../Calendar/prototype/yearOfWeek/shell.js | 8 + .../Temporal/Duration/prototype/add/shell.js | 8 + .../Temporal/Duration/prototype/round/shell.js | 8 + .../Temporal/Duration/prototype/subtract/shell.js | 8 + .../Temporal/Duration/prototype/total/shell.js | 8 + .../Instant/prototype/toLocaleString/dateStyle.js | 31 + .../intl402/Temporal/PlainDate/compare/shell.js | 8 + .../intl402/Temporal/PlainDate/from/shell.js | 8 + .../Temporal/PlainDate/prototype/equals/shell.js | 8 + .../Temporal/PlainDate/prototype/since/shell.js | 8 + .../prototype/toLocaleString/dateStyle.js | 34 ++ .../Temporal/PlainDate/prototype/until/shell.js | 8 + .../PlainDate/prototype/weekOfYear/browser.js | 0 .../prototype/weekOfYear/gregory-iso-weekofyear.js | 30 + .../prototype/weekOfYear/non-iso-week-of-year.js | 25 + .../PlainDate/prototype/weekOfYear/shell.js | 0 .../PlainDate/prototype/yearOfWeek/browser.js | 0 .../prototype/yearOfWeek/gregory-iso-weekofyear.js | 30 + .../prototype/yearOfWeek/non-iso-week-of-year.js | 25 + .../PlainDate/prototype/yearOfWeek/shell.js | 0 .../Temporal/PlainDateTime/compare/shell.js | 8 + .../intl402/Temporal/PlainDateTime/from/shell.js | 8 + .../PlainDateTime/prototype/equals/shell.js | 8 + .../PlainDateTime/prototype/since/shell.js | 8 + .../prototype/toLocaleString/dateStyle.js | 34 ++ .../PlainDateTime/prototype/until/shell.js | 8 + .../PlainDateTime/prototype/weekOfYear/browser.js | 0 .../prototype/weekOfYear/gregory-iso-weekofyear.js | 30 + .../prototype/weekOfYear/non-iso-week-of-year.js | 25 + .../PlainDateTime/prototype/weekOfYear/shell.js | 0 .../PlainDateTime/prototype/withPlainDate/shell.js | 8 + .../PlainDateTime/prototype/yearOfWeek/browser.js | 0 .../prototype/yearOfWeek/gregory-iso-weekofyear.js | 30 + .../prototype/yearOfWeek/non-iso-week-of-year.js | 25 + .../PlainDateTime/prototype/yearOfWeek/shell.js | 0 .../intl402/Temporal/PlainMonthDay/from/shell.js | 8 + .../PlainMonthDay/prototype/equals/shell.js | 8 + .../prototype/toLocaleString/dateStyle.js | 34 ++ .../PlainMonthDay/prototype/toPlainDate/shell.js | 8 + .../PlainTime/prototype/toPlainDateTime/shell.js | 8 + .../PlainTime/prototype/toZonedDateTime/shell.js | 8 + .../Temporal/PlainYearMonth/compare/shell.js | 8 + .../intl402/Temporal/PlainYearMonth/from/shell.js | 8 + .../PlainYearMonth/prototype/equals/shell.js | 8 + .../PlainYearMonth/prototype/since/shell.js | 8 + .../prototype/toLocaleString/dateStyle.js | 34 ++ .../PlainYearMonth/prototype/until/shell.js | 8 + .../from/timezone-string-legacy-non-iana.js | 47 ++ .../intl402/Temporal/TimeZone/legacy-non-iana.js | 47 ++ .../TimeZone/prototype/getInstantFor/shell.js | 8 + .../prototype/getPlainDateTimeFor/shell.js | 8 + .../prototype/getPossibleInstantsFor/shell.js | 8 + .../Temporal/ZonedDateTime/compare/shell.js | 8 + .../intl402/Temporal/ZonedDateTime/from/shell.js | 8 + .../ZonedDateTime/prototype/equals/shell.js | 8 + .../Temporal/ZonedDateTime/prototype/era/shell.js | 8 + .../ZonedDateTime/prototype/eraYear/shell.js | 8 + .../ZonedDateTime/prototype/since/shell.js | 8 + .../prototype/toLocaleString/dateStyle.js | 34 ++ .../ZonedDateTime/prototype/until/shell.js | 8 + .../ZonedDateTime/prototype/weekOfYear/browser.js | 0 .../prototype/weekOfYear/gregory-iso-weekofyear.js | 30 + .../prototype/weekOfYear/non-iso-week-of-year.js | 27 + .../ZonedDateTime/prototype/weekOfYear/shell.js | 0 .../Temporal/ZonedDateTime/prototype/with/shell.js | 8 + .../ZonedDateTime/prototype/withPlainDate/shell.js | 8 + .../ZonedDateTime/prototype/yearOfWeek/browser.js | 0 .../prototype/yearOfWeek/gregory-iso-weekofyear.js | 30 + .../prototype/yearOfWeek/non-iso-week-of-year.js | 27 + .../ZonedDateTime/prototype/yearOfWeek/shell.js | 0 .../calls-toLocaleString-number-elements.js | 1 + js/src/tests/test262/jstests.list | 3 + .../expressions/assignment/S11.13.1_A7_T3.js | 28 - .../assignment/target-member-computed-reference.js | 42 ++ .../assignment/target-super-computed-reference.js | 51 ++ ...script-decl-lex-var-declared-via-eval-sloppy.js | 32 - ...decl-lex-var-declared-via-eval-strict-strict.js | 27 - .../script-decl-lex-var-declared-via-eval.js | 38 ++ .../early-err-arithmetic-modifiers-add-remove-i.js | 20 + .../early-err-arithmetic-modifiers-add-remove-m.js | 20 + ...thmetic-modifiers-add-remove-multi-duplicate.js | 20 + ...err-arithmetic-modifiers-add-remove-s-escape.js | 20 + .../early-err-arithmetic-modifiers-add-remove-s.js | 20 + .../early-err-arithmetic-modifiers-both-empty.js | 20 + ...r-arithmetic-modifiers-code-point-repeat-i-1.js | 20 + ...r-arithmetic-modifiers-code-point-repeat-i-2.js | 20 + .../early-err-arithmetic-modifiers-no-colon-1.js | 19 + .../early-err-arithmetic-modifiers-no-colon-2.js | 19 + .../early-err-arithmetic-modifiers-no-colon-3.js | 19 + ...thmetic-modifiers-other-code-point-arbitrary.js | 20 + ...metic-modifiers-other-code-point-combining-i.js | 20 + ...metic-modifiers-other-code-point-combining-m.js | 20 + ...metic-modifiers-other-code-point-combining-s.js | 20 + ...-err-arithmetic-modifiers-other-code-point-d.js | 20 + ...-err-arithmetic-modifiers-other-code-point-g.js | 20 + ...tic-modifiers-other-code-point-non-display-1.js | Bin 0 -> 715 bytes ...tic-modifiers-other-code-point-non-display-2.js | 20 + ...ithmetic-modifiers-other-code-point-non-flag.js | 20 + ...-err-arithmetic-modifiers-other-code-point-u.js | 20 + ...metic-modifiers-other-code-point-uppercase-I.js | 20 + ...-err-arithmetic-modifiers-other-code-point-y.js | 20 + ...rr-arithmetic-modifiers-other-code-point-zwj.js | 20 + ...arithmetic-modifiers-other-code-point-zwnbsp.js | 20 + ...r-arithmetic-modifiers-other-code-point-zwnj.js | 20 + ...rr-arithmetic-modifiers-reverse-add-remove-i.js | 20 + ...rr-arithmetic-modifiers-reverse-add-remove-m.js | 20 + ...modifiers-reverse-add-remove-multi-duplicate.js | 20 + ...hmetic-modifiers-reverse-add-remove-s-escape.js | 20 + ...rr-arithmetic-modifiers-reverse-add-remove-s.js | 20 + ...etic-modifiers-reverse-code-point-repeat-i-1.js | 20 + ...etic-modifiers-reverse-code-point-repeat-i-2.js | 20 + ...modifiers-reverse-other-code-point-arbitrary.js | 20 + ...difiers-reverse-other-code-point-combining-i.js | 20 + ...difiers-reverse-other-code-point-combining-m.js | 20 + ...difiers-reverse-other-code-point-combining-s.js | 20 + ...thmetic-modifiers-reverse-other-code-point-d.js | 20 + ...thmetic-modifiers-reverse-other-code-point-g.js | 20 + ...fiers-reverse-other-code-point-non-display-1.js | Bin 0 -> 715 bytes ...fiers-reverse-other-code-point-non-display-2.js | 20 + ...-modifiers-reverse-other-code-point-non-flag.js | 20 + ...thmetic-modifiers-reverse-other-code-point-u.js | 20 + ...difiers-reverse-other-code-point-uppercase-I.js | 20 + ...thmetic-modifiers-reverse-other-code-point-y.js | 20 + ...metic-modifiers-reverse-other-code-point-zwj.js | 20 + ...ic-modifiers-reverse-other-code-point-zwnbsp.js | 20 + ...etic-modifiers-reverse-other-code-point-zwnj.js | 20 + ...tic-modifiers-reverse-should-not-case-fold-i.js | 20 + ...tic-modifiers-reverse-should-not-case-fold-m.js | 20 + ...tic-modifiers-reverse-should-not-case-fold-s.js | 20 + ...fiers-reverse-should-not-unicode-case-fold-i.js | 20 + ...fiers-reverse-should-not-unicode-case-fold-s.js | 20 + ...-arithmetic-modifiers-should-not-case-fold-i.js | 20 + ...-arithmetic-modifiers-should-not-case-fold-m.js | 20 + ...-arithmetic-modifiers-should-not-case-fold-s.js | 20 + ...tic-modifiers-should-not-unicode-case-fold-i.js | 20 + ...tic-modifiers-should-not-unicode-case-fold-s.js | 20 + .../early-err-modifiers-code-point-repeat-i-1.js | 20 + .../early-err-modifiers-code-point-repeat-i-2.js | 20 + ...rly-err-modifiers-other-code-point-arbitrary.js | 20 + ...y-err-modifiers-other-code-point-combining-i.js | 20 + ...y-err-modifiers-other-code-point-combining-m.js | 20 + ...y-err-modifiers-other-code-point-combining-s.js | 20 + .../early-err-modifiers-other-code-point-d.js | 20 + .../early-err-modifiers-other-code-point-g.js | 20 + ...err-modifiers-other-code-point-non-display-1.js | Bin 0 -> 853 bytes ...err-modifiers-other-code-point-non-display-2.js | 20 + ...arly-err-modifiers-other-code-point-non-flag.js | 20 + .../early-err-modifiers-other-code-point-u.js | 20 + ...y-err-modifiers-other-code-point-uppercase-I.js | 20 + .../early-err-modifiers-other-code-point-y.js | 20 + .../early-err-modifiers-other-code-point-zwj.js | 20 + .../early-err-modifiers-other-code-point-zwnbsp.js | 20 + .../early-err-modifiers-other-code-point-zwnj.js | 20 + .../early-err-modifiers-should-not-case-fold-i.js | 20 + .../early-err-modifiers-should-not-case-fold-m.js | 20 + .../early-err-modifiers-should-not-case-fold-s.js | 20 + ...err-modifiers-should-not-unicode-case-fold-i.js | 20 + ...err-modifiers-should-not-unicode-case-fold-s.js | 20 + ...ly-err-modifiers-should-not-unicode-escape-i.js | 20 + ...ly-err-modifiers-should-not-unicode-escape-m.js | 20 + ...ly-err-modifiers-should-not-unicode-escape-s.js | 20 + .../import-attributes/allow-nlt-before-with.js | 2 +- .../async-module-does-not-block-sibling-modules.js | 17 + .../top-level-await/async-module-sync_FIXTURE.js | 5 + .../top-level-await/async-module-tla_FIXTURE.js | 7 + .../TypedArray/regular-subclassing.js | 1 + .../TypedArray/super-must-be-called.js | 1 + .../Intl402/Temporal/old/non-iso-calendars.js | 338 +++++++--- .../test262/staging/Temporal/Duration/old/shell.js | 8 + .../test262/staging/Temporal/TimeZone/old/shell.js | 8 + .../staging/Temporal/ZonedDateTime/old/round.js | 10 +- .../staging/Temporal/ZonedDateTime/old/shell.js | 8 + .../test262/staging/built-ins/Array/browser.js | 0 .../staging/built-ins/Array/prototype/browser.js | 0 .../built-ins/Array/prototype/flatMap/browser.js | 0 .../flatMap/callback-with-side-effects.js | 30 + .../built-ins/Array/prototype/flatMap/shell.js | 0 .../staging/built-ins/Array/prototype/shell.js | 0 .../tests/test262/staging/built-ins/Array/shell.js | 0 .../test262/staging/built-ins/RegExp/browser.js | 0 .../built-ins/RegExp/named-groups/browser.js | 0 .../named-groups/duplicate-named-groups-replace.js | 31 + .../named-groups/duplicate-named-groups-search.js | 16 + .../RegExp/named-groups/duplicate-named-groups.js | 19 + .../staging/built-ins/RegExp/named-groups/shell.js | 0 .../test262/staging/built-ins/RegExp/shell.js | 0 js/src/tests/test262/staging/built-ins/browser.js | 0 js/src/tests/test262/staging/built-ins/shell.js | 0 .../explicit-resource-management/Symbol/browser.js | 0 .../Symbol/dispose/browser.js | 0 .../Symbol/dispose/cross-realm.js | 17 + .../Symbol/dispose/prop-desc.js | 20 + .../Symbol/dispose/shell.js | 0 .../explicit-resource-management/Symbol/shell.js | 0 .../explicit-resource-management/browser.js | 0 .../call-dispose-methods.js | 194 ++++++ .../staging/explicit-resource-management/shell.js | 0 3732 files changed, 31645 insertions(+), 10227 deletions(-) create mode 100644 js/src/tests/test262/annexB/language/comments/single-line-html-close-first-line-1.js create mode 100644 js/src/tests/test262/annexB/language/comments/single-line-html-close-first-line-2.js create mode 100644 js/src/tests/test262/annexB/language/comments/single-line-html-close-first-line-3.js delete mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/script-decl-lex-collision-in-sloppy-mode.js delete mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/script-decl-lex-no-collision-in-strict-mode-strict.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/script-decl-lex-no-collision.js create mode 100644 js/src/tests/test262/built-ins/ArrayBuffer/options-maxbytelength-allocation-limit.js create mode 100644 js/src/tests/test262/built-ins/ArrayBuffer/options-maxbytelength-compared-before-object-creation.js create mode 100644 js/src/tests/test262/built-ins/ArrayBuffer/options-maxbytelength-data-allocation-after-object-creation.js create mode 100644 js/src/tests/test262/built-ins/DataView/byteOffset-validated-against-initial-buffer-length.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/browser.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/detached-buffer-after-toindex-byteoffset.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/detached-buffer-before-outofrange-byteoffset.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/detached-buffer.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/index-is-out-of-range.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/length.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/minus-zero.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/name.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/negative-byteoffset-throws.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/not-a-constructor.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/resizable-buffer.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-abrupt-from-tonumber-byteoffset-symbol.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-abrupt-from-tonumber-byteoffset.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-infinity.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-nan.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-value-clean-arraybuffer.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-values-custom-offset.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-values.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/shell.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/this-has-no-dataview-internal.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/this-is-not-object.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/to-boolean-littleendian.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/getFloat16/toindex-byteoffset.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/browser.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/detached-buffer-after-number-value.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/detached-buffer-after-toindex-byteoffset.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/detached-buffer-before-outofrange-byteoffset.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/detached-buffer.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/index-check-before-value-conversion.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/index-is-out-of-range.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/length.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/name.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/negative-byteoffset-throws.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/no-value-arg.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/not-a-constructor.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/range-check-after-value-conversion.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/resizable-buffer.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/return-abrupt-from-tonumber-byteoffset-symbol.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/return-abrupt-from-tonumber-byteoffset.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/return-abrupt-from-tonumber-value-symbol.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/return-abrupt-from-tonumber-value.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/set-values-little-endian-order.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/set-values-return-undefined.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/shell.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/this-has-no-dataview-internal.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/this-is-not-object.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/to-boolean-littleendian.js create mode 100644 js/src/tests/test262/built-ins/DataView/prototype/setFloat16/toindex-byteoffset.js create mode 100644 js/src/tests/test262/built-ins/Map/groupBy/string.js create mode 100644 js/src/tests/test262/built-ins/Math/f16round/browser.js create mode 100644 js/src/tests/test262/built-ins/Math/f16round/length.js create mode 100644 js/src/tests/test262/built-ins/Math/f16round/name.js create mode 100644 js/src/tests/test262/built-ins/Math/f16round/not-a-constructor.js create mode 100644 js/src/tests/test262/built-ins/Math/f16round/prop-desc.js create mode 100644 js/src/tests/test262/built-ins/Math/f16round/shell.js create mode 100644 js/src/tests/test262/built-ins/Math/f16round/value-conversion.js create mode 100644 js/src/tests/test262/built-ins/Object/groupBy/string.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-code-point-repeat-i-1.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-code-point-repeat-i-2.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-arbitrary.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-combining-i.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-combining-m.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-combining-s.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-d.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-g.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-non-display-1.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-non-display-2.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-non-flag.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-u.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-uppercase-I.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-y.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-zwj.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-zwnbsp.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-zwnj.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-case-fold-i.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-case-fold-m.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-case-fold-s.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-unicode-case-fold-i.js create mode 100644 js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-unicode-case-fold-s.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-dotAll-does-not-affect-dotAll-property.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-dotAll-does-not-affect-ignoreCase-flag.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-dotAll-does-not-affect-multiline-flag.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-dotAll.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-backreferences.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-characterClasses.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-characterEscapes.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-lower-b.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-lower-p.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-lower-w.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-upper-b.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-upper-p.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-upper-w.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-does-not-affect-dotAll-flag.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-does-not-affect-ignoreCase-property.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-does-not-affect-multiline-flag.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-multiline-does-not-affect-dotAll-flag.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-multiline-does-not-affect-ignoreCase-flag.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-multiline-does-not-affect-multiline-property.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-multiline.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-remove-modifiers.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/browser.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/changing-dotAll-flag-does-not-affect-dotAll-modifier.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/changing-ignoreCase-flag-does-not-affect-ignoreCase-modifier.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/changing-multiline-flag-does-not-affect-multiline-modifier.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nested-add-remove-modifiers.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-add-dotAll-within-remove-dotAll.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-add-ignoreCase-within-remove-ignoreCase.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-add-multiline-within-remove-multiline.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-remove-dotAll-within-add-dotAll.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-remove-ignoreCase-within-add-ignoreCase.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-remove-multiline-within-add-multiline.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-dotAll-does-not-affect-dotAll-property.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-dotAll-does-not-affect-ignoreCase-flag.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-dotAll-does-not-affect-multiline-flag.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-dotAll.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-backreferences.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-characterClasses.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-characterEscapes.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-lower-b.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-lower-p.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-lower-w.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-upper-b.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-upper-p.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-upper-w.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-does-not-affect-dotAll-flag.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-does-not-affect-ignoreCase-property.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-does-not-affect-multiline-flag.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-multiline-does-not-affect-dotAll-flag.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-multiline-does-not-affect-ignoreCase-flag.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-multiline-does-not-affect-multiline-property.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-multiline.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/shell.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/browser.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/shell.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-and-remove-modifiers-can-have-empty-remove-modifiers.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-and-remove-modifiers.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-modifiers-when-nested.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-modifiers-when-not-set-as-flags.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-modifiers-when-set-as-flags.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/browser.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/remove-modifiers-when-nested.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/remove-modifiers-when-not-set-as-flags.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/remove-modifiers-when-set-as-flags.js create mode 100644 js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/shell.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-i.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-m.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-multi-duplicate.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-s-escape.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-s.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-both-empty.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-code-point-repeat-i-1.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-code-point-repeat-i-2.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-arbitrary.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-combining-i.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-combining-m.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-combining-s.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-d.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-g.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-non-display-1.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-non-display-2.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-non-flag.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-u.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-uppercase-I.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-y.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-zwj.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-zwnbsp.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-zwnj.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-i.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-m.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-multi-duplicate.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-s-escape.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-s.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-code-point-repeat-i-1.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-code-point-repeat-i-2.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-arbitrary.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-combining-i.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-combining-m.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-combining-s.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-d.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-g.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-non-display-1.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-non-display-2.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-non-flag.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-u.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-uppercase-I.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-y.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-zwj.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-zwnbsp.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-zwnj.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-case-fold-i.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-case-fold-m.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-case-fold-s.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-unicode-case-fold-i.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-unicode-case-fold-s.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-case-fold-i.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-case-fold-m.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-case-fold-s.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-unicode-case-fold-i.js create mode 100644 js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-unicode-case-fold-s.js create mode 100644 js/src/tests/test262/built-ins/SharedArrayBuffer/options-maxbytelength-allocation-limit.js create mode 100644 js/src/tests/test262/built-ins/SharedArrayBuffer/options-maxbytelength-compared-before-object-creation.js create mode 100644 js/src/tests/test262/built-ins/SharedArrayBuffer/options-maxbytelength-data-allocation-after-object-creation.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/from/calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateAdd/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateUntil/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateUntil/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/day/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/day/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInYear/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInYear/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthCode/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthCode/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/weekOfYear/custom-calendar-weekofyear.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/year/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/year/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Calendar/prototype/yearOfWeek/custom-calendar-weekofyear.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/compare/duration-out-of-range-added-to-relativeto.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/compare/relativeto-propertybag-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/compare/relativeto-propertybag-out-of-range-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/differencezoneddatetime-inconsistent-custom-calendar.js delete mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/normalized-time-duration-to-days-loop-arbitrarily.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-out-of-range-forward-offset-shift.js delete mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/relativeto-zoneddatetime-normalized-time-duration-to-days-range-errors.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/dst-rounding-result.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/out-of-range-when-adjusting-rounded-days.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-out-of-range-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/differencezoneddatetime-inconsistent-custom-calendar.js delete mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/normalized-time-duration-to-days-loop-arbitrarily.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-out-of-range-forward-offset-shift.js delete mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/relativeto-zoneddatetime-normalized-time-duration-to-days-range-errors.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/dst-rounding-result.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-out-of-range-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Instant/compare/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Instant/from/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Instant/prototype/equals/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Instant/prototype/since/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Instant/prototype/toZonedDateTime/calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Instant/prototype/until/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Now/plainDate/calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Now/plainDateTime/calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/Now/zonedDateTime/calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/compare/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/compare/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/from/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/equals/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/since/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/since/wrapping-at-end-of-month.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toPlainDateTime/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/getoffsetnanosecondsfor-maximum-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/getpossibleinstantsfor-maximum-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/getpossibleinstantsfor-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/wrapping-at-end-of-month.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/weekOfYear/custom-calendar-weekofyear.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/withCalendar/calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/yearOfWeek/custom-calendar-weekofyear.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/compare/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/compare/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/from/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/equals/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/result-mixed-sign.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/wrapping-at-end-of-month.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/getoffsetnanosecondsfor-maximum-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/getpossibleinstantsfor-maximum-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/getpossibleinstantsfor-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/result-mixed-sign.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/wrapping-at-end-of-month.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/weekOfYear/custom-calendar-weekofyear.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withCalendar/calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainTime/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/yearOfWeek/custom-calendar-weekofyear.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/calendar-fromfields-called-with-undefined-options.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainTime/compare/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainTime/from/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/equals/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/since/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/getoffsetnanosecondsfor-maximum-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/getpossibleinstantsfor-maximum-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/getpossibleinstantsfor-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/until/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainYearMonth/compare/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainYearMonth/compare/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainYearMonth/from/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainYearMonth/from/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/since/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/calendar-fromfields-called-with-undefined-options.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/getoffsetnanosecondsfor-maximum-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/getpossibleinstantsfor-maximum-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/getpossibleinstantsfor-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getNextTransition/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getOffsetNanosecondsFor/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getOffsetStringFor/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPreviousTransition/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-out-of-range-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/compare/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-out-of-range-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-out-of-range-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/getoffsetnanosecondsfor-maximum-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/getpossibleinstantsfor-maximum-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/getpossibleinstantsfor-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/getoffsetnanosecondsfor-maximum-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/getpossibleinstantsfor-maximum-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/getpossibleinstantsfor-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-out-of-range-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/differencezoneddatetime-inconsistent-custom-calendar.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/dst-month-day-boundary.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/dst-rounding-result.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/find-intermediate-instant.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/wrapping-at-end-of-month.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/getoffsetnanosecondsfor-maximum-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/getpossibleinstantsfor-maximum-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/getpossibleinstantsfor-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-out-of-range-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/differencezoneddatetime-inconsistent-custom-calendar.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/dst-month-day-boundary.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/dst-rounding-result.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/find-intermediate-instant.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/wrapping-at-end-of-month.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/weekOfYear/custom-calendar-weekofyear.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/with/getoffsetnanosecondsfor-maximum-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/with/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/with/getpossibleinstantsfor-maximum-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/with/getpossibleinstantsfor-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/getoffsetnanosecondsfor-maximum-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/getpossibleinstantsfor-maximum-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/getpossibleinstantsfor-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/getoffsetnanosecondsfor-maximum-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/getpossibleinstantsfor-maximum-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/getpossibleinstantsfor-out-of-range-backward-offset-shift.js create mode 100644 js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/yearOfWeek/custom-calendar-weekofyear.js create mode 100644 js/src/tests/test262/built-ins/TypedArray/from/from-array-mapper-detaches-result.js create mode 100644 js/src/tests/test262/built-ins/TypedArray/from/from-array-mapper-makes-result-out-of-bounds.js create mode 100644 js/src/tests/test262/built-ins/TypedArray/from/from-typedarray-into-itself-mapper-detaches-result.js create mode 100644 js/src/tests/test262/built-ins/TypedArray/from/from-typedarray-into-itself-mapper-makes-result-out-of-bounds.js create mode 100644 js/src/tests/test262/built-ins/TypedArray/from/from-typedarray-mapper-detaches-result.js create mode 100644 js/src/tests/test262/built-ins/TypedArray/from/from-typedarray-mapper-makes-result-out-of-bounds.js create mode 100644 js/src/tests/test262/built-ins/TypedArray/from/iterated-array-changed-by-tonumber.js create mode 100644 js/src/tests/test262/built-ins/TypedArray/of/resized-with-out-of-bounds-and-in-bounds-indices.js create mode 100644 js/src/tests/test262/built-ins/TypedArray/prototype/fill/absent-indices-computed-from-initial-length.js create mode 100644 js/src/tests/test262/built-ins/TypedArray/prototype/includes/index-compared-against-initial-length-out-of-bounds.js create mode 100644 js/src/tests/test262/built-ins/TypedArray/prototype/includes/index-compared-against-initial-length.js create mode 100644 js/src/tests/test262/built-ins/TypedArray/prototype/join/separator-tostring-once-after-resized.js create mode 100644 js/src/tests/test262/built-ins/TypedArray/prototype/subarray/result-byteOffset-from-out-of-bounds.js create mode 100644 js/src/tests/test262/built-ins/TypedArray/prototype/values/make-in-bounds-after-exhausted.js create mode 100644 js/src/tests/test262/built-ins/TypedArray/prototype/values/make-out-of-bounds-after-exhausted.js create mode 100644 js/src/tests/test262/built-ins/TypedArray/prototype/with/index-validated-against-current-length.js create mode 100644 js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterated-array-changed-by-tonumber.js create mode 100644 js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterated-array-with-modified-array-iterator.js create mode 100644 js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/resized-out-of-bounds-to-in-bounds-index.js create mode 100644 js/src/tests/test262/intl402/DateTimeFormat/timezone-legacy-non-iana.js create mode 100644 js/src/tests/test262/intl402/DurationFormat/constructor-unit-style-defaults.js create mode 100644 js/src/tests/test262/intl402/DurationFormat/prototype/format/fractions-of-subsecond-units-en.js create mode 100644 js/src/tests/test262/intl402/DurationFormat/prototype/format/mixed-non-numeric-styles-es.js create mode 100644 js/src/tests/test262/intl402/DurationFormat/prototype/format/mixed-short-and-numeric.js create mode 100644 js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits-en.js create mode 100644 js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits-undefined-en.js delete mode 100644 js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits-undefined.js delete mode 100644 js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits.js create mode 100644 js/src/tests/test262/intl402/Locale/prototype/calendar/canonicalize.js create mode 100644 js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-iso-string.js create mode 100644 js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-string-calendar-annotation-invalid-key.js create mode 100644 js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/gregory-iso-weekofyear.js create mode 100644 js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/non-iso-week-of-year.js create mode 100644 js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/gregory-iso-weekofyear.js create mode 100644 js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/non-iso-week-of-year.js create mode 100644 js/src/tests/test262/intl402/Temporal/Instant/prototype/toLocaleString/dateStyle.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDate/prototype/toLocaleString/dateStyle.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDate/prototype/weekOfYear/browser.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDate/prototype/weekOfYear/gregory-iso-weekofyear.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDate/prototype/weekOfYear/non-iso-week-of-year.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDate/prototype/weekOfYear/shell.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDate/prototype/yearOfWeek/browser.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDate/prototype/yearOfWeek/gregory-iso-weekofyear.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDate/prototype/yearOfWeek/non-iso-week-of-year.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDate/prototype/yearOfWeek/shell.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/toLocaleString/dateStyle.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/weekOfYear/browser.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/weekOfYear/gregory-iso-weekofyear.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/weekOfYear/non-iso-week-of-year.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/weekOfYear/shell.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/browser.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/non-iso-week-of-year.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/shell.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainMonthDay/prototype/toLocaleString/dateStyle.js create mode 100644 js/src/tests/test262/intl402/Temporal/PlainYearMonth/prototype/toLocaleString/dateStyle.js create mode 100644 js/src/tests/test262/intl402/Temporal/TimeZone/from/timezone-string-legacy-non-iana.js create mode 100644 js/src/tests/test262/intl402/Temporal/TimeZone/legacy-non-iana.js create mode 100644 js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/toLocaleString/dateStyle.js create mode 100644 js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/browser.js create mode 100644 js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/gregory-iso-weekofyear.js create mode 100644 js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/non-iso-week-of-year.js create mode 100644 js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/shell.js create mode 100644 js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/browser.js create mode 100644 js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js create mode 100644 js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/non-iso-week-of-year.js create mode 100644 js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/shell.js delete mode 100644 js/src/tests/test262/language/expressions/assignment/S11.13.1_A7_T3.js create mode 100644 js/src/tests/test262/language/expressions/assignment/target-member-computed-reference.js create mode 100644 js/src/tests/test262/language/expressions/assignment/target-super-computed-reference.js delete mode 100644 js/src/tests/test262/language/global-code/script-decl-lex-var-declared-via-eval-sloppy.js delete mode 100644 js/src/tests/test262/language/global-code/script-decl-lex-var-declared-via-eval-strict-strict.js create mode 100644 js/src/tests/test262/language/global-code/script-decl-lex-var-declared-via-eval.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-i.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-m.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-multi-duplicate.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-s-escape.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-s.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-both-empty.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-code-point-repeat-i-1.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-code-point-repeat-i-2.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-no-colon-1.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-no-colon-2.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-no-colon-3.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-arbitrary.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-combining-i.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-combining-m.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-combining-s.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-d.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-g.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-non-display-1.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-non-display-2.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-non-flag.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-u.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-uppercase-I.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-y.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-zwj.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-zwnbsp.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-zwnj.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-i.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-m.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-multi-duplicate.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-s-escape.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-s.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-code-point-repeat-i-1.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-code-point-repeat-i-2.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-arbitrary.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-combining-i.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-combining-m.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-combining-s.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-d.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-g.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-non-display-1.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-non-display-2.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-non-flag.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-u.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-uppercase-I.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-y.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-zwj.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-zwnbsp.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-zwnj.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-case-fold-i.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-case-fold-m.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-case-fold-s.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-unicode-case-fold-i.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-unicode-case-fold-s.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-case-fold-i.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-case-fold-m.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-case-fold-s.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-unicode-case-fold-i.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-unicode-case-fold-s.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-code-point-repeat-i-1.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-code-point-repeat-i-2.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-arbitrary.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-combining-i.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-combining-m.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-combining-s.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-d.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-g.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-non-display-1.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-non-display-2.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-non-flag.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-u.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-uppercase-I.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-y.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-zwj.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-zwnbsp.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-zwnj.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-case-fold-i.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-case-fold-m.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-case-fold-s.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-case-fold-i.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-case-fold-s.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-escape-i.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-escape-m.js create mode 100644 js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-escape-s.js create mode 100644 js/src/tests/test262/language/module-code/top-level-await/async-module-does-not-block-sibling-modules.js create mode 100644 js/src/tests/test262/language/module-code/top-level-await/async-module-sync_FIXTURE.js create mode 100644 js/src/tests/test262/language/module-code/top-level-await/async-module-tla_FIXTURE.js create mode 100644 js/src/tests/test262/staging/built-ins/Array/browser.js create mode 100644 js/src/tests/test262/staging/built-ins/Array/prototype/browser.js create mode 100644 js/src/tests/test262/staging/built-ins/Array/prototype/flatMap/browser.js create mode 100644 js/src/tests/test262/staging/built-ins/Array/prototype/flatMap/callback-with-side-effects.js create mode 100644 js/src/tests/test262/staging/built-ins/Array/prototype/flatMap/shell.js create mode 100644 js/src/tests/test262/staging/built-ins/Array/prototype/shell.js create mode 100644 js/src/tests/test262/staging/built-ins/Array/shell.js create mode 100644 js/src/tests/test262/staging/built-ins/RegExp/browser.js create mode 100644 js/src/tests/test262/staging/built-ins/RegExp/named-groups/browser.js create mode 100644 js/src/tests/test262/staging/built-ins/RegExp/named-groups/duplicate-named-groups-replace.js create mode 100644 js/src/tests/test262/staging/built-ins/RegExp/named-groups/duplicate-named-groups-search.js create mode 100644 js/src/tests/test262/staging/built-ins/RegExp/named-groups/duplicate-named-groups.js create mode 100644 js/src/tests/test262/staging/built-ins/RegExp/named-groups/shell.js create mode 100644 js/src/tests/test262/staging/built-ins/RegExp/shell.js create mode 100644 js/src/tests/test262/staging/built-ins/browser.js create mode 100644 js/src/tests/test262/staging/built-ins/shell.js create mode 100644 js/src/tests/test262/staging/explicit-resource-management/Symbol/browser.js create mode 100644 js/src/tests/test262/staging/explicit-resource-management/Symbol/dispose/browser.js create mode 100644 js/src/tests/test262/staging/explicit-resource-management/Symbol/dispose/cross-realm.js create mode 100644 js/src/tests/test262/staging/explicit-resource-management/Symbol/dispose/prop-desc.js create mode 100644 js/src/tests/test262/staging/explicit-resource-management/Symbol/dispose/shell.js create mode 100644 js/src/tests/test262/staging/explicit-resource-management/Symbol/shell.js create mode 100644 js/src/tests/test262/staging/explicit-resource-management/browser.js create mode 100644 js/src/tests/test262/staging/explicit-resource-management/call-dispose-methods.js create mode 100644 js/src/tests/test262/staging/explicit-resource-management/shell.js (limited to 'js/src/tests/test262') diff --git a/js/src/tests/test262/GIT-INFO b/js/src/tests/test262/GIT-INFO index 0173bbb3c4..7798b62c2a 100644 --- a/js/src/tests/test262/GIT-INFO +++ b/js/src/tests/test262/GIT-INFO @@ -1,9 +1,5 @@ -commit 584048ed081d85f5eed6e884a7b40b6f4bcd67d7 -Author: Nicolò Ribaudo -Date: Tue Jan 30 16:53:17 2024 +0100 +commit 79e9b39f3a576154b1bc39f9dbd95d25addc4ebf +Author: Emmanuel Ferdman +Date: Sun Apr 14 01:49:16 2024 +0300 - Add additional tests for out-of-range date-times - - - https://github.com/tc39/proposal-temporal/pull/2727#discussion_r1414066610 - - https://github.com/tc39/proposal-temporal/pull/2727#discussion_r1414065876 - - https://github.com/tc39/proposal-temporal/pull/2727#discussion_r1414067272 + Update the location of `2nd-param-non-object.js` diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/not-a-constructor.js index a3936a335e..5e62df950e 100644 --- a/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/not-a-constructor.js @@ -28,7 +28,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getYear(); -}, '`let date = new Date(Date.now()); new date.getYear()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/not-a-constructor.js index 906214fde4..b984983549 100644 --- a/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/not-a-constructor.js @@ -28,7 +28,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.setYear(); -}, '`let date = new Date(Date.now()); new date.setYear()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/not-a-constructor.js index bb6c5f412f..1ee58ec5ae 100644 --- a/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/not-a-constructor.js @@ -28,7 +28,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.toGMTString(); -}, '`let date = new Date(Date.now()); new date.toGMTString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-cross-realm-instance.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-cross-realm-instance.js index 5c4f9a8234..666bd56e9e 100644 --- a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-cross-realm-instance.js +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-cross-realm-instance.js @@ -16,9 +16,7 @@ assert.throws( TypeError, function () { RegExp.prototype.compile.call(otherRealm_regexp); - }, - "`RegExp.prototype.compile.call(otherRealm_regexp)` throws TypeError" -); + }); assert.throws( other.TypeError, diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-subclass-instance.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-subclass-instance.js index 66f6e3f5a6..2bbe36f4c4 100644 --- a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-subclass-instance.js +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-subclass-instance.js @@ -13,16 +13,12 @@ assert.throws( TypeError, function () { subclass_regexp.compile(); - }, - "`subclass_regexp.compile()` throws TypeError" -); + }); assert.throws( TypeError, function () { RegExp.prototype.compile.call(subclass_regexp); - }, - "`RegExp.prototype.compile.call(subclass_regexp)` throws TypeError" -); + }); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/not-a-constructor.js index ca59226cbf..7935bb3faa 100644 --- a/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/not-a-constructor.js @@ -28,7 +28,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.anchor(); -}, '`new String.prototype.anchor()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/big/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/big/not-a-constructor.js index f2e5f3bfc7..7f5ab46c7b 100644 --- a/js/src/tests/test262/annexB/built-ins/String/prototype/big/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/big/not-a-constructor.js @@ -24,7 +24,7 @@ assert.sameValue(isConstructor(String.prototype.big), false, 'isConstructor(Stri assert.throws(TypeError, () => { new String.prototype.big(); -}, '`new String.prototype.big()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/blink/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/blink/not-a-constructor.js index 73d5488203..275fca49f8 100644 --- a/js/src/tests/test262/annexB/built-ins/String/prototype/blink/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/blink/not-a-constructor.js @@ -28,7 +28,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.blink(); -}, '`new String.prototype.blink()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/bold/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/bold/not-a-constructor.js index 1f8a7a155d..bac9d503cd 100644 --- a/js/src/tests/test262/annexB/built-ins/String/prototype/bold/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/bold/not-a-constructor.js @@ -28,7 +28,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.bold(); -}, '`new String.prototype.bold()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/not-a-constructor.js index 64fa0c534d..5199152f24 100644 --- a/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/not-a-constructor.js @@ -28,7 +28,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.fixed(); -}, '`new String.prototype.fixed()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/not-a-constructor.js index a5bfa4415c..93e7959b6e 100644 --- a/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/not-a-constructor.js @@ -28,7 +28,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.fontcolor(); -}, '`new String.prototype.fontcolor()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/not-a-constructor.js index d221a1348a..369d8a63ff 100644 --- a/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/not-a-constructor.js @@ -28,7 +28,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.fontsize(); -}, '`new String.prototype.fontsize()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/italics/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/italics/not-a-constructor.js index 4833d9b0e5..ee0efba295 100644 --- a/js/src/tests/test262/annexB/built-ins/String/prototype/italics/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/italics/not-a-constructor.js @@ -28,7 +28,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.italics(); -}, '`new String.prototype.italics()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/link/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/link/not-a-constructor.js index afd8d81733..7b0d604281 100644 --- a/js/src/tests/test262/annexB/built-ins/String/prototype/link/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/link/not-a-constructor.js @@ -28,7 +28,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.link(); -}, '`new String.prototype.link()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/small/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/small/not-a-constructor.js index a0a9aa6090..ca7d8b4c88 100644 --- a/js/src/tests/test262/annexB/built-ins/String/prototype/small/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/small/not-a-constructor.js @@ -28,7 +28,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.small(); -}, '`new String.prototype.small()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/strike/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/strike/not-a-constructor.js index 5f7bc6cbd1..c772410ed8 100644 --- a/js/src/tests/test262/annexB/built-ins/String/prototype/strike/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/strike/not-a-constructor.js @@ -28,7 +28,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.strike(); -}, '`new String.prototype.strike()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sub/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sub/not-a-constructor.js index 3c8b054e9a..23a9dd69d9 100644 --- a/js/src/tests/test262/annexB/built-ins/String/prototype/sub/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/sub/not-a-constructor.js @@ -24,7 +24,7 @@ assert.sameValue(isConstructor(String.prototype.sub), false, 'isConstructor(Stri assert.throws(TypeError, () => { new String.prototype.sub(); -}, '`new String.prototype.sub()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/not-a-constructor.js index 821d6473a4..35a5bd0121 100644 --- a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/not-a-constructor.js @@ -28,7 +28,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.substr(); -}, '`new String.prototype.substr()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sup/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sup/not-a-constructor.js index 461a34d60e..e0de689e39 100644 --- a/js/src/tests/test262/annexB/built-ins/String/prototype/sup/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/sup/not-a-constructor.js @@ -24,7 +24,7 @@ assert.sameValue(isConstructor(String.prototype.sup), false, 'isConstructor(Stri assert.throws(TypeError, () => { new String.prototype.sup(); -}, '`new String.prototype.sup()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/from/iterator-method-emulates-undefined.js b/js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/from/iterator-method-emulates-undefined.js index 5e41a374eb..b121d08169 100644 --- a/js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/from/iterator-method-emulates-undefined.js +++ b/js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/from/iterator-method-emulates-undefined.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Alexey Shvayka. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/annexB/built-ins/escape/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/escape/not-a-constructor.js index 9fd1e0deb7..f1f3a0caa7 100644 --- a/js/src/tests/test262/annexB/built-ins/escape/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/escape/not-a-constructor.js @@ -24,7 +24,7 @@ assert.sameValue(isConstructor(escape), false, 'isConstructor(escape) must retur assert.throws(TypeError, () => { new escape(''); -}, '`new escape(\'\')` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/unescape/not-a-constructor.js index 71c32f22c2..79070d3c7d 100644 --- a/js/src/tests/test262/annexB/built-ins/unescape/not-a-constructor.js +++ b/js/src/tests/test262/annexB/built-ins/unescape/not-a-constructor.js @@ -24,7 +24,7 @@ assert.sameValue(isConstructor(unescape), false, 'isConstructor(unescape) must r assert.throws(TypeError, () => { new unescape(''); -}, '`new unescape(\'\')` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/language/comments/single-line-html-close-first-line-1.js b/js/src/tests/test262/annexB/language/comments/single-line-html-close-first-line-1.js new file mode 100644 index 0000000000..708e42e4ae --- /dev/null +++ b/js/src/tests/test262/annexB/language/comments/single-line-html-close-first-line-1.js @@ -0,0 +1,34 @@ +--> a comment + +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-html-like-comments +description: > + A SingleLineHTMLCloseComment is allowed in the first line +flags: [raw] +info: | + InputElementHashbangOrRegExp :: + WhiteSpace + LineTerminator + Comment + CommonToken + HashbangComment + RegularExpressionLiteral + HTMLCloseComment + + HTMLCloseComment :: + WhiteSpaceSequence[opt] SingleLineDelimitedCommentSequence[opt] --> SingleLineCommentChars[opt] +negative: + phase: runtime + type: Test262Error +---*/ + +// Because this test concerns the interpretation of non-executable character +// sequences within ECMAScript source code, special care must be taken to +// ensure that executable code is evaluated as expected. +// +// Express the intended behavior by intentionally throwing an error; this +// guarantees that test runners will only consider the test "passing" if +// executable sequences are correctly interpreted as such. +throw new Test262Error("This is not in a comment"); diff --git a/js/src/tests/test262/annexB/language/comments/single-line-html-close-first-line-2.js b/js/src/tests/test262/annexB/language/comments/single-line-html-close-first-line-2.js new file mode 100644 index 0000000000..0b68aa0f6f --- /dev/null +++ b/js/src/tests/test262/annexB/language/comments/single-line-html-close-first-line-2.js @@ -0,0 +1,34 @@ + --> a comment + +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-html-like-comments +description: > + A SingleLineHTMLCloseComment is allowed in the first line when preceeded by spaces +flags: [raw] +info: | + InputElementHashbangOrRegExp :: + WhiteSpace + LineTerminator + Comment + CommonToken + HashbangComment + RegularExpressionLiteral + HTMLCloseComment + + HTMLCloseComment :: + WhiteSpaceSequence[opt] SingleLineDelimitedCommentSequence[opt] --> SingleLineCommentChars[opt] +negative: + phase: runtime + type: Test262Error +---*/ + +// Because this test concerns the interpretation of non-executable character +// sequences within ECMAScript source code, special care must be taken to +// ensure that executable code is evaluated as expected. +// +// Express the intended behavior by intentionally throwing an error; this +// guarantees that test runners will only consider the test "passing" if +// executable sequences are correctly interpreted as such. +throw new Test262Error("This is not in a comment"); diff --git a/js/src/tests/test262/annexB/language/comments/single-line-html-close-first-line-3.js b/js/src/tests/test262/annexB/language/comments/single-line-html-close-first-line-3.js new file mode 100644 index 0000000000..d638fd5080 --- /dev/null +++ b/js/src/tests/test262/annexB/language/comments/single-line-html-close-first-line-3.js @@ -0,0 +1,34 @@ +/* a comment */ /*another comment*/--> a comment + +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-html-like-comments +description: > + A SingleLineHTMLCloseComment is allowed in the first line when preceeded by spaces and single-line block comments +flags: [raw] +info: | + InputElementHashbangOrRegExp :: + WhiteSpace + LineTerminator + Comment + CommonToken + HashbangComment + RegularExpressionLiteral + HTMLCloseComment + + HTMLCloseComment :: + WhiteSpaceSequence[opt] SingleLineDelimitedCommentSequence[opt] --> SingleLineCommentChars[opt] +negative: + phase: runtime + type: Test262Error +---*/ + +// Because this test concerns the interpretation of non-executable character +// sequences within ECMAScript source code, special care must be taken to +// ensure that executable code is evaluated as expected. +// +// Express the intended behavior by intentionally throwing an error; this +// guarantees that test runners will only consider the test "passing" if +// executable sequences are correctly interpreted as such. +throw new Test262Error("This is not in a comment"); diff --git a/js/src/tests/test262/annexB/language/eval-code/direct/script-decl-lex-collision-in-sloppy-mode.js b/js/src/tests/test262/annexB/language/eval-code/direct/script-decl-lex-collision-in-sloppy-mode.js deleted file mode 100644 index 58d5a125b5..0000000000 --- a/js/src/tests/test262/annexB/language/eval-code/direct/script-decl-lex-collision-in-sloppy-mode.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2023 Alexey Shvayka. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-globaldeclarationinstantiation -description: Let binding collision with existing var declaration that was created for hoisted function. -info: | - [...] - 3. For each element name of lexNames, do - a. If env.HasVarDeclaration(name) is true, throw a SyntaxError exception. -flags: [noStrict] ----*/ - -eval('if (true) { function test262Fn() {} }'); - -assert.throws(SyntaxError, function() { - $262.evalScript('var x; let test262Fn;'); -}); - -assert.throws(ReferenceError, function() { - x; -}, 'no bindings created'); - -reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/language/eval-code/direct/script-decl-lex-no-collision-in-strict-mode-strict.js b/js/src/tests/test262/annexB/language/eval-code/direct/script-decl-lex-no-collision-in-strict-mode-strict.js deleted file mode 100644 index da859c843d..0000000000 --- a/js/src/tests/test262/annexB/language/eval-code/direct/script-decl-lex-no-collision-in-strict-mode-strict.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; -// Copyright (C) 2023 Alexey Shvayka. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-globaldeclarationinstantiation -description: No let binding collision with existing var declaration due to strict-mode eval(). -info: | - PerformEval ( x, strictCaller, direct ) - - [...] - 16. If direct is true, then - a. Let lexEnv be NewDeclarativeEnvironment(runningContext's LexicalEnvironment). - [...] - 18. If strictEval is true, set varEnv to lexEnv. -flags: [onlyStrict] ----*/ - -eval('if (true) { function test262Fn() {} }'); - -$262.evalScript('let test262Fn = 1;'); - -assert.sameValue(test262Fn, 1); - -reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/language/eval-code/direct/script-decl-lex-no-collision.js b/js/src/tests/test262/annexB/language/eval-code/direct/script-decl-lex-no-collision.js new file mode 100644 index 0000000000..643b11831d --- /dev/null +++ b/js/src/tests/test262/annexB/language/eval-code/direct/script-decl-lex-no-collision.js @@ -0,0 +1,35 @@ +// Copyright (C) 2023 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-globaldeclarationinstantiation +description: No let binding collision with existing var declaration due to eval(). +info: | + In strict mode: + + PerformEval ( x, strictCaller, direct ) + + [...] + 16. If direct is true, then + a. Let lexEnv be NewDeclarativeEnvironment(runningContext's LexicalEnvironment). + [...] + 18. If strictEval is true, set varEnv to lexEnv. + + In sloppy mode: + + GlobalDeclarationInstantiation ( script, env ) + + [...] + 3. For each element name of lexNames, do + a. If env.HasLexicalDeclaration(name) is true, throw a SyntaxError exception. + b. Let hasRestrictedGlobal be ? env.HasRestrictedGlobalProperty(name). + c. NOTE: Global var and function bindings (except those that are introduced by non-strict direct eval) are non-configurable and are therefore restricted global properties. + d. If hasRestrictedGlobal is true, throw a SyntaxError exception. +---*/ + +eval('if (true) { function test262Fn() {} }'); + +$262.evalScript('let test262Fn = 1;'); + +assert.sameValue(test262Fn, 1); + +reportCompare(0, 0); 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); diff --git a/js/src/tests/test262/built-ins/AsyncFunction/AsyncFunction-length.js b/js/src/tests/test262/built-ins/AsyncFunction/AsyncFunction-length.js index 03a0119a4e..856ec3b503 100644 --- a/js/src/tests/test262/built-ins/AsyncFunction/AsyncFunction-length.js +++ b/js/src/tests/test262/built-ins/AsyncFunction/AsyncFunction-length.js @@ -10,9 +10,11 @@ includes: [propertyHelper.js] ---*/ var AsyncFunction = async function foo() {}.constructor; -assert.sameValue(AsyncFunction.length, 1); -verifyNotWritable(AsyncFunction, 'length'); -verifyNotEnumerable(AsyncFunction, 'length'); -verifyConfigurable(AsyncFunction, 'length'); +verifyProperty(AsyncFunction, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/AsyncFunction/AsyncFunction-name.js b/js/src/tests/test262/built-ins/AsyncFunction/AsyncFunction-name.js index b745e91a15..b58d0e0a10 100644 --- a/js/src/tests/test262/built-ins/AsyncFunction/AsyncFunction-name.js +++ b/js/src/tests/test262/built-ins/AsyncFunction/AsyncFunction-name.js @@ -10,9 +10,11 @@ includes: [propertyHelper.js] ---*/ var AsyncFunction = async function foo() {}.constructor; -assert.sameValue(AsyncFunction.name, "AsyncFunction"); -verifyNotWritable(AsyncFunction, "name"); -verifyNotEnumerable(AsyncFunction, "name"); -verifyConfigurable(AsyncFunction, "name"); +verifyProperty(AsyncFunction, "name", { + value: "AsyncFunction", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/AsyncFunction/instance-has-name.js b/js/src/tests/test262/built-ins/AsyncFunction/instance-has-name.js index 13a6a8eb53..3492890300 100644 --- a/js/src/tests/test262/built-ins/AsyncFunction/instance-has-name.js +++ b/js/src/tests/test262/built-ins/AsyncFunction/instance-has-name.js @@ -10,9 +10,11 @@ includes: [propertyHelper.js] async function foo() {}; -assert.sameValue(foo.name, "foo"); -verifyNotWritable(foo, "name"); -verifyNotEnumerable(foo, "name"); -verifyConfigurable(foo, "name"); +verifyProperty(foo, "name", { + value: "foo", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/add/bad-range.js b/js/src/tests/test262/built-ins/Atomics/add/bad-range.js index 2654eb2364..218fd647ec 100644 --- a/js/src/tests/test262/built-ins/Atomics/add/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/add/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -18,7 +18,7 @@ testWithTypedArrayConstructors(function(TA) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.add(view, IdxGen(view), 10); - }, '`Atomics.add(view, IdxGen(view), 10)` throws RangeError'); + }); }); }, views); diff --git a/js/src/tests/test262/built-ins/Atomics/add/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/add/bigint/bad-range.js index 86f2456e24..f87b765f4d 100644 --- a/js/src/tests/test262/built-ins/Atomics/add/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/add/bigint/bad-range.js @@ -16,7 +16,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.add(view, IdxGen(view), 10n); - }, '`Atomics.add(view, IdxGen(view), 10n)` throws RangeError'); + }); }); }); diff --git a/js/src/tests/test262/built-ins/Atomics/add/good-views.js b/js/src/tests/test262/built-ins/Atomics/add/good-views.js index fdb204d040..0aa930296c 100644 --- a/js/src/tests/test262/built-ins/Atomics/add/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/add/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. 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/Atomics/add/non-shared-bufferdata.js b/js/src/tests/test262/built-ins/Atomics/add/non-shared-bufferdata.js index 2ca4c447f8..1304d10ae7 100644 --- a/js/src/tests/test262/built-ins/Atomics/add/non-shared-bufferdata.js +++ b/js/src/tests/test262/built-ins/Atomics/add/non-shared-bufferdata.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. 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/Atomics/add/non-shared-int-views-throws.js b/js/src/tests/test262/built-ins/Atomics/add/non-shared-int-views-throws.js index 6c7c88cec1..0fb2ff3c91 100644 --- a/js/src/tests/test262/built-ins/Atomics/add/non-shared-int-views-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/add/non-shared-int-views-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. 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/Atomics/add/non-views.js b/js/src/tests/test262/built-ins/Atomics/add/non-views.js index c10fa26753..85e50b31b4 100644 --- a/js/src/tests/test262/built-ins/Atomics/add/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/add/non-views.js @@ -13,7 +13,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray testWithAtomicsNonViewValues(function(view) { assert.throws(TypeError, function() { Atomics.add(view, 0, 0); - }, '`Atomics.add(view, 0, 0)` throws TypeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/add/not-a-constructor.js b/js/src/tests/test262/built-ins/Atomics/add/not-a-constructor.js index 723164589f..d824718211 100644 --- a/js/src/tests/test262/built-ins/Atomics/add/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Atomics/add/not-a-constructor.js @@ -26,7 +26,7 @@ assert.sameValue(isConstructor(Atomics.add), false, 'isConstructor(Atomics.add) assert.throws(TypeError, () => { new Atomics.add(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); -}, '`new Atomics.add(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/add/validate-arraytype-before-index-coercion.js b/js/src/tests/test262/built-ins/Atomics/add/validate-arraytype-before-index-coercion.js index 10ada1eceb..f579bcac5d 100644 --- a/js/src/tests/test262/built-ins/Atomics/add/validate-arraytype-before-index-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/add/validate-arraytype-before-index-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/add/validate-arraytype-before-value-coercion.js b/js/src/tests/test262/built-ins/Atomics/add/validate-arraytype-before-value-coercion.js index f52d769b76..675c1d2059 100644 --- a/js/src/tests/test262/built-ins/Atomics/add/validate-arraytype-before-value-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/add/validate-arraytype-before-value-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/and/bad-range.js b/js/src/tests/test262/built-ins/Atomics/and/bad-range.js index 8548ab5dc3..1f1d83102b 100644 --- a/js/src/tests/test262/built-ins/Atomics/and/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/and/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -18,7 +18,7 @@ testWithTypedArrayConstructors(function(TA) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.and(view, IdxGen(view), 10); - }, '`Atomics.and(view, IdxGen(view), 10)` throws RangeError'); + }); }); }, views); diff --git a/js/src/tests/test262/built-ins/Atomics/and/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/and/bigint/bad-range.js index a64ae66282..a031bc31e2 100644 --- a/js/src/tests/test262/built-ins/Atomics/and/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/and/bigint/bad-range.js @@ -16,7 +16,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.and(view, IdxGen(view), 10n); - }, '`Atomics.and(view, IdxGen(view), 10n)` throws RangeError'); + }); }); }); diff --git a/js/src/tests/test262/built-ins/Atomics/and/good-views.js b/js/src/tests/test262/built-ins/Atomics/and/good-views.js index 532b75674d..0e5a40ec00 100644 --- a/js/src/tests/test262/built-ins/Atomics/and/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/and/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. 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/Atomics/and/non-shared-bufferdata.js b/js/src/tests/test262/built-ins/Atomics/and/non-shared-bufferdata.js index be959d353d..ab6945fcb7 100644 --- a/js/src/tests/test262/built-ins/Atomics/and/non-shared-bufferdata.js +++ b/js/src/tests/test262/built-ins/Atomics/and/non-shared-bufferdata.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. 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/Atomics/and/non-shared-int-views-throws.js b/js/src/tests/test262/built-ins/Atomics/and/non-shared-int-views-throws.js index 90987ae1ce..67eee61a82 100644 --- a/js/src/tests/test262/built-ins/Atomics/and/non-shared-int-views-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/and/non-shared-int-views-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. 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/Atomics/and/non-views.js b/js/src/tests/test262/built-ins/Atomics/and/non-views.js index 49732f95c9..37b64d1d7f 100644 --- a/js/src/tests/test262/built-ins/Atomics/and/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/and/non-views.js @@ -13,7 +13,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray testWithAtomicsNonViewValues(function(view) { assert.throws(TypeError, function() { Atomics.and(view, 0, 0); - }, '`Atomics.and(view, 0, 0)` throws TypeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/and/not-a-constructor.js b/js/src/tests/test262/built-ins/Atomics/and/not-a-constructor.js index 9f6fb08569..c47a6e16b8 100644 --- a/js/src/tests/test262/built-ins/Atomics/and/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Atomics/and/not-a-constructor.js @@ -26,7 +26,7 @@ assert.sameValue(isConstructor(Atomics.and), false, 'isConstructor(Atomics.and) assert.throws(TypeError, () => { new Atomics.and(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); -}, '`new Atomics.and(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/and/validate-arraytype-before-index-coercion.js b/js/src/tests/test262/built-ins/Atomics/and/validate-arraytype-before-index-coercion.js index edfe4f88d0..e46ff549b4 100644 --- a/js/src/tests/test262/built-ins/Atomics/and/validate-arraytype-before-index-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/and/validate-arraytype-before-index-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/and/validate-arraytype-before-value-coercion.js b/js/src/tests/test262/built-ins/Atomics/and/validate-arraytype-before-value-coercion.js index 30b017f6b4..4235d4ad32 100644 --- a/js/src/tests/test262/built-ins/Atomics/and/validate-arraytype-before-value-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/and/validate-arraytype-before-value-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/compareExchange/bad-range.js b/js/src/tests/test262/built-ins/Atomics/compareExchange/bad-range.js index 507b33750c..d37df6c890 100644 --- a/js/src/tests/test262/built-ins/Atomics/compareExchange/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/compareExchange/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -18,7 +18,7 @@ testWithTypedArrayConstructors(function(TA) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.compareExchange(view, IdxGen(view), 10, 0); - }, '`Atomics.compareExchange(view, IdxGen(view), 10, 0)` throws RangeError'); + }); }); }, views); diff --git a/js/src/tests/test262/built-ins/Atomics/compareExchange/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/compareExchange/bigint/bad-range.js index 1799f1cefc..57fce441d1 100644 --- a/js/src/tests/test262/built-ins/Atomics/compareExchange/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/compareExchange/bigint/bad-range.js @@ -16,7 +16,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.compareExchange(view, IdxGen(view), 10, 0n); - }, '`Atomics.compareExchange(view, IdxGen(view), 10, 0n)` throws RangeError'); + }); }); }); diff --git a/js/src/tests/test262/built-ins/Atomics/compareExchange/good-views.js b/js/src/tests/test262/built-ins/Atomics/compareExchange/good-views.js index 3f1e5fd82c..a92fbbf9a0 100644 --- a/js/src/tests/test262/built-ins/Atomics/compareExchange/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/compareExchange/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. 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/Atomics/compareExchange/non-shared-bufferdata.js b/js/src/tests/test262/built-ins/Atomics/compareExchange/non-shared-bufferdata.js index a5d3058801..fe669bbcf8 100644 --- a/js/src/tests/test262/built-ins/Atomics/compareExchange/non-shared-bufferdata.js +++ b/js/src/tests/test262/built-ins/Atomics/compareExchange/non-shared-bufferdata.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. 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/Atomics/compareExchange/non-shared-int-views-throws.js b/js/src/tests/test262/built-ins/Atomics/compareExchange/non-shared-int-views-throws.js index 45df6f8cb5..637dea2721 100644 --- a/js/src/tests/test262/built-ins/Atomics/compareExchange/non-shared-int-views-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/compareExchange/non-shared-int-views-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. 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/Atomics/compareExchange/non-views.js b/js/src/tests/test262/built-ins/Atomics/compareExchange/non-views.js index f3be53cbe7..9ab32629de 100644 --- a/js/src/tests/test262/built-ins/Atomics/compareExchange/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/compareExchange/non-views.js @@ -13,7 +13,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray testWithAtomicsNonViewValues(function(view) { assert.throws(TypeError, function() { Atomics.compareExchange(view, 0, 0, 0); - }, '`Atomics.compareExchange(view, 0, 0, 0)` throws TypeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/compareExchange/not-a-constructor.js b/js/src/tests/test262/built-ins/Atomics/compareExchange/not-a-constructor.js index c42a00268b..207a8b2d4d 100644 --- a/js/src/tests/test262/built-ins/Atomics/compareExchange/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Atomics/compareExchange/not-a-constructor.js @@ -30,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Atomics.compareExchange(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); -}, '`new Atomics.compareExchange(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/compareExchange/validate-arraytype-before-expectedValue-coercion.js b/js/src/tests/test262/built-ins/Atomics/compareExchange/validate-arraytype-before-expectedValue-coercion.js index 7392e72344..d57c025eaa 100644 --- a/js/src/tests/test262/built-ins/Atomics/compareExchange/validate-arraytype-before-expectedValue-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/compareExchange/validate-arraytype-before-expectedValue-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/compareExchange/validate-arraytype-before-index-coercion.js b/js/src/tests/test262/built-ins/Atomics/compareExchange/validate-arraytype-before-index-coercion.js index 5ddd207d24..004d9f66a3 100644 --- a/js/src/tests/test262/built-ins/Atomics/compareExchange/validate-arraytype-before-index-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/compareExchange/validate-arraytype-before-index-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/compareExchange/validate-arraytype-before-replacementValue-coercion.js b/js/src/tests/test262/built-ins/Atomics/compareExchange/validate-arraytype-before-replacementValue-coercion.js index 065a032809..37676f2c7a 100644 --- a/js/src/tests/test262/built-ins/Atomics/compareExchange/validate-arraytype-before-replacementValue-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/compareExchange/validate-arraytype-before-replacementValue-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/exchange/bad-range.js b/js/src/tests/test262/built-ins/Atomics/exchange/bad-range.js index 23cda3ced4..7267562e60 100644 --- a/js/src/tests/test262/built-ins/Atomics/exchange/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/exchange/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -18,7 +18,7 @@ testWithTypedArrayConstructors(function(TA) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.exchange(view, IdxGen(view), 10, 0); - }, '`Atomics.exchange(view, IdxGen(view), 10, 0)` throws RangeError'); + }); }); }, views); diff --git a/js/src/tests/test262/built-ins/Atomics/exchange/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/exchange/bigint/bad-range.js index 205ecdcd59..9a54b77577 100644 --- a/js/src/tests/test262/built-ins/Atomics/exchange/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/exchange/bigint/bad-range.js @@ -16,7 +16,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.exchange(view, IdxGen(view), 10n, 0n); - }, '`Atomics.exchange(view, IdxGen(view), 10n, 0n)` throws RangeError'); + }); }); }); diff --git a/js/src/tests/test262/built-ins/Atomics/exchange/good-views.js b/js/src/tests/test262/built-ins/Atomics/exchange/good-views.js index 80eab9dfa6..b19a940390 100644 --- a/js/src/tests/test262/built-ins/Atomics/exchange/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/exchange/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. 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/Atomics/exchange/non-shared-bufferdata.js b/js/src/tests/test262/built-ins/Atomics/exchange/non-shared-bufferdata.js index 463ae4ebb6..31cdadc48f 100644 --- a/js/src/tests/test262/built-ins/Atomics/exchange/non-shared-bufferdata.js +++ b/js/src/tests/test262/built-ins/Atomics/exchange/non-shared-bufferdata.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. 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/Atomics/exchange/non-shared-int-views-throws.js b/js/src/tests/test262/built-ins/Atomics/exchange/non-shared-int-views-throws.js index e3b53900aa..29007955d8 100644 --- a/js/src/tests/test262/built-ins/Atomics/exchange/non-shared-int-views-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/exchange/non-shared-int-views-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. 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/Atomics/exchange/non-views.js b/js/src/tests/test262/built-ins/Atomics/exchange/non-views.js index 8cc0d76b0a..733df3f58c 100644 --- a/js/src/tests/test262/built-ins/Atomics/exchange/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/exchange/non-views.js @@ -13,7 +13,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray testWithAtomicsNonViewValues(function(view) { assert.throws(TypeError, function() { Atomics.exchange(view, 0, 0); - }, '`Atomics.exchange(view, 0, 0)` throws TypeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/exchange/nonshared-int-views.js b/js/src/tests/test262/built-ins/Atomics/exchange/nonshared-int-views.js index 5a45151e87..a6400d1f77 100644 --- a/js/src/tests/test262/built-ins/Atomics/exchange/nonshared-int-views.js +++ b/js/src/tests/test262/built-ins/Atomics/exchange/nonshared-int-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2017 Mozilla Corporation. 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/Atomics/exchange/not-a-constructor.js b/js/src/tests/test262/built-ins/Atomics/exchange/not-a-constructor.js index 2115000021..31e0599db0 100644 --- a/js/src/tests/test262/built-ins/Atomics/exchange/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Atomics/exchange/not-a-constructor.js @@ -26,7 +26,7 @@ assert.sameValue(isConstructor(Atomics.exchange), false, 'isConstructor(Atomics. assert.throws(TypeError, () => { new Atomics.exchange(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); -}, '`new Atomics.exchange(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/exchange/validate-arraytype-before-index-coercion.js b/js/src/tests/test262/built-ins/Atomics/exchange/validate-arraytype-before-index-coercion.js index 5e8b5c17e3..f5e3a94bf1 100644 --- a/js/src/tests/test262/built-ins/Atomics/exchange/validate-arraytype-before-index-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/exchange/validate-arraytype-before-index-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/exchange/validate-arraytype-before-value-coercion.js b/js/src/tests/test262/built-ins/Atomics/exchange/validate-arraytype-before-value-coercion.js index eb5589c6ea..faf2e2ef13 100644 --- a/js/src/tests/test262/built-ins/Atomics/exchange/validate-arraytype-before-value-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/exchange/validate-arraytype-before-value-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/isLockFree/not-a-constructor.js b/js/src/tests/test262/built-ins/Atomics/isLockFree/not-a-constructor.js index 03202213e7..1ff1840bcb 100644 --- a/js/src/tests/test262/built-ins/Atomics/isLockFree/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Atomics/isLockFree/not-a-constructor.js @@ -26,7 +26,7 @@ assert.sameValue(isConstructor(Atomics.isLockFree), false, 'isConstructor(Atomic assert.throws(TypeError, () => { new Atomics.isLockFree(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); -}, '`new Atomics.isLockFree(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/load/bad-range.js b/js/src/tests/test262/built-ins/Atomics/load/bad-range.js index 3dfe8ae858..ea68c9c4e0 100644 --- a/js/src/tests/test262/built-ins/Atomics/load/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/load/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -18,7 +18,7 @@ testWithTypedArrayConstructors(function(TA) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.load(view, IdxGen(view)); - }, '`Atomics.load(view, IdxGen(view))` throws RangeError'); + }); }); }, views); diff --git a/js/src/tests/test262/built-ins/Atomics/load/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/load/bigint/bad-range.js index bdb8eed01e..27f6010bef 100644 --- a/js/src/tests/test262/built-ins/Atomics/load/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/load/bigint/bad-range.js @@ -17,7 +17,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.load(view, IdxGen(view)); - }, '`Atomics.load(view, IdxGen(view))` throws RangeError'); + }); }); }); diff --git a/js/src/tests/test262/built-ins/Atomics/load/good-views.js b/js/src/tests/test262/built-ins/Atomics/load/good-views.js index 6f77377428..b196e35bb9 100644 --- a/js/src/tests/test262/built-ins/Atomics/load/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/load/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. 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/Atomics/load/non-shared-bufferdata.js b/js/src/tests/test262/built-ins/Atomics/load/non-shared-bufferdata.js index 73ae85260c..6d1aedc72b 100644 --- a/js/src/tests/test262/built-ins/Atomics/load/non-shared-bufferdata.js +++ b/js/src/tests/test262/built-ins/Atomics/load/non-shared-bufferdata.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. 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/Atomics/load/non-shared-int-views-throws.js b/js/src/tests/test262/built-ins/Atomics/load/non-shared-int-views-throws.js index a8bb46083c..4c0075da7d 100644 --- a/js/src/tests/test262/built-ins/Atomics/load/non-shared-int-views-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/load/non-shared-int-views-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. 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/Atomics/load/non-views.js b/js/src/tests/test262/built-ins/Atomics/load/non-views.js index a88dc89ee8..d0b482d8b0 100644 --- a/js/src/tests/test262/built-ins/Atomics/load/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/load/non-views.js @@ -13,7 +13,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray testWithAtomicsNonViewValues(function(view) { assert.throws(TypeError, function() { Atomics.load(view, 0); - }, '`Atomics.load(view, 0)` throws TypeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/load/not-a-constructor.js b/js/src/tests/test262/built-ins/Atomics/load/not-a-constructor.js index 270660c5cf..a03779be16 100644 --- a/js/src/tests/test262/built-ins/Atomics/load/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Atomics/load/not-a-constructor.js @@ -26,7 +26,7 @@ assert.sameValue(isConstructor(Atomics.load), false, 'isConstructor(Atomics.load assert.throws(TypeError, () => { new Atomics.load(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); -}, '`new Atomics.load(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/load/validate-arraytype-before-index-coercion.js b/js/src/tests/test262/built-ins/Atomics/load/validate-arraytype-before-index-coercion.js index 70ef58f258..4b6e06d9f2 100644 --- a/js/src/tests/test262/built-ins/Atomics/load/validate-arraytype-before-index-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/load/validate-arraytype-before-index-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/notify/bad-range.js b/js/src/tests/test262/built-ins/Atomics/notify/bad-range.js index 78d1f0336a..09600fd0fb 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/bad-range.js @@ -23,7 +23,7 @@ const i32a = new Int32Array( testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.notify(i32a, IdxGen(i32a), 0); - }, '`Atomics.notify(i32a, IdxGen(i32a), 0)` throws RangeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/notify/bigint/bad-range.js index 469d169ec9..7c8707612a 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/bigint/bad-range.js @@ -23,7 +23,7 @@ const i64a = new BigInt64Array( testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.notify(i64a, IdxGen(i64a), 0); - }, '`Atomics.notify(i64a, IdxGen(i64a), 0)` throws RangeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/bigint/non-bigint64-typedarray-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/bigint/non-bigint64-typedarray-throws.js index 94fc29e40d..eae67c20ac 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/bigint/non-bigint64-typedarray-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/bigint/non-bigint64-typedarray-throws.js @@ -28,10 +28,10 @@ const poisoned = { assert.throws(TypeError, function() { Atomics.wait(i64a, 0, 0); -}, '`Atomics.wait(i64a, 0, 0)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.wait(i64a, poisoned, poisoned); -}, '`Atomics.wait(i64a, poisoned, poisoned)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/bigint/non-shared-bufferdata-count-evaluation-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/bigint/non-shared-bufferdata-count-evaluation-throws.js index 5c5781f429..9c5911952f 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/bigint/non-shared-bufferdata-count-evaluation-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/bigint/non-shared-bufferdata-count-evaluation-throws.js @@ -31,6 +31,6 @@ const poisoned = { assert.throws(Test262Error, function() { Atomics.notify(i64a, poisoned, 0); -}, '`Atomics.notify(i64a, poisoned, 0)` throws Test262Error'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/bigint/non-shared-bufferdata-index-evaluation-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/bigint/non-shared-bufferdata-index-evaluation-throws.js index c345fa7265..bac6596a0f 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/bigint/non-shared-bufferdata-index-evaluation-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/bigint/non-shared-bufferdata-index-evaluation-throws.js @@ -28,7 +28,7 @@ const poisoned = { assert.throws(Test262Error, function() { Atomics.notify(i64a, 0, poisoned); -}, '`Atomics.notify(i64a, 0, poisoned)` throws Test262Error'); +}); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/bigint/non-shared-bufferdata-non-shared-int-views-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/bigint/non-shared-bufferdata-non-shared-int-views-throws.js index 274bb87374..f32861e48e 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/bigint/non-shared-bufferdata-non-shared-int-views-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/bigint/non-shared-bufferdata-non-shared-int-views-throws.js @@ -19,6 +19,6 @@ const poisoned = { assert.throws(TypeError, function() { Atomics.notify(new BigUint64Array(nonsab), poisoned, poisoned); -}, '`Atomics.notify(new BigUint64Array(nonsab), poisoned, poisoned)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/bigint/null-bufferdata-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/bigint/null-bufferdata-throws.js index 99bfc3cff9..75e2b6b3f9 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/bigint/null-bufferdata-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/bigint/null-bufferdata-throws.js @@ -34,6 +34,6 @@ try { assert.throws(TypeError, function() { Atomics.notify(i64a, poisoned, poisoned); -}, '`Atomics.notify(i64a, poisoned, poisoned)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/count-symbol-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/count-symbol-throws.js index 067e802544..dd59c2fc88 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/count-symbol-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/count-symbol-throws.js @@ -24,6 +24,6 @@ const i32a = new Int32Array( assert.throws(TypeError, function() { Atomics.notify(i32a, 0, Symbol()); -}, '`Atomics.notify(i32a, 0, Symbol())` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/count-tointeger-throws-then-wake-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/count-tointeger-throws-then-wake-throws.js index 69c3c39d09..ca99b74e1f 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/count-tointeger-throws-then-wake-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/count-tointeger-throws-then-wake-throws.js @@ -30,6 +30,6 @@ const poisoned = { assert.throws(Test262Error, function() { Atomics.notify(i32a, 0, poisoned); -}, '`Atomics.notify(i32a, 0, poisoned)` throws Test262Error'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/negative-index-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/negative-index-throws.js index 7b22715ce6..ed9dff1448 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/negative-index-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/negative-index-throws.js @@ -29,15 +29,15 @@ const poisoned = { assert.throws(RangeError, function() { Atomics.notify(i32a, -Infinity, poisoned); -}, '`Atomics.notify(i32a, -Infinity, poisoned)` throws RangeError'); +}); assert.throws(RangeError, function() { Atomics.notify(i32a, -7.999, poisoned); -}, '`Atomics.notify(i32a, -7.999, poisoned)` throws RangeError'); +}); assert.throws(RangeError, function() { Atomics.notify(i32a, -1, poisoned); -}, '`Atomics.notify(i32a, -1, poisoned)` throws RangeError'); +}); assert.throws(RangeError, function() { Atomics.notify(i32a, -300, poisoned); -}, '`Atomics.notify(i32a, -300, poisoned)` throws RangeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/non-int32-typedarray-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/non-int32-typedarray-throws.js index 5ca1ab5080..a3cf9027e3 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/non-int32-typedarray-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/non-int32-typedarray-throws.js @@ -27,14 +27,14 @@ assert.throws(TypeError, function() { new SharedArrayBuffer(Float64Array.BYTES_PER_ELEMENT * 8) ); Atomics.notify(view, poisoned, poisoned); -}, '`const view = new Float64Array( new SharedArrayBuffer(Float64Array.BYTES_PER_ELEMENT * 8) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { const view = new Float32Array( new SharedArrayBuffer(Float32Array.BYTES_PER_ELEMENT * 4) ); Atomics.notify(view, poisoned, poisoned); -}, '`const view = new Float32Array( new SharedArrayBuffer(Float32Array.BYTES_PER_ELEMENT * 4) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError'); +}); if (typeof Float16Array !== 'undefined') { assert.throws(TypeError, function() { @@ -42,7 +42,7 @@ if (typeof Float16Array !== 'undefined') { new SharedArrayBuffer(Float16Array.BYTES_PER_ELEMENT * 2) ); Atomics.notify(view, poisoned, poisoned); - }, '`const view = new Float16Array( new SharedArrayBuffer(Float16Array.BYTES_PER_ELEMENT * 2) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError'); + }); } assert.throws(TypeError, function() { @@ -50,41 +50,41 @@ assert.throws(TypeError, function() { new SharedArrayBuffer(Int16Array.BYTES_PER_ELEMENT * 2) ); Atomics.notify(view, poisoned, poisoned); -}, '`const view = new Int16Array( new SharedArrayBuffer(Int16Array.BYTES_PER_ELEMENT * 2) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { const view = new Int8Array( new SharedArrayBuffer(Int8Array.BYTES_PER_ELEMENT) ); Atomics.notify(view, poisoned, poisoned); -}, '`const view = new Int8Array( new SharedArrayBuffer(Int8Array.BYTES_PER_ELEMENT) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { const view = new Uint32Array( new SharedArrayBuffer(Uint32Array.BYTES_PER_ELEMENT * 4) ); Atomics.notify(new Uint32Array(), poisoned, poisoned); -}, '`const view = new Uint32Array( new SharedArrayBuffer(Uint32Array.BYTES_PER_ELEMENT * 4) ); Atomics.notify(new Uint32Array(), poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { const view = new Uint16Array( new SharedArrayBuffer(Uint16Array.BYTES_PER_ELEMENT * 2) ); Atomics.notify(view, poisoned, poisoned); -}, '`const view = new Uint16Array( new SharedArrayBuffer(Uint16Array.BYTES_PER_ELEMENT * 2) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { const view = new Uint8Array( new SharedArrayBuffer(Uint8Array.BYTES_PER_ELEMENT) ); Atomics.notify(view, poisoned, poisoned); -}, '`const view = new Uint8Array( new SharedArrayBuffer(Uint8Array.BYTES_PER_ELEMENT) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { const view = new Uint8ClampedArray( new SharedArrayBuffer(Uint8ClampedArray.BYTES_PER_ELEMENT) ); Atomics.notify(view, poisoned, poisoned); -}, '`const view = new Uint8ClampedArray( new SharedArrayBuffer(Uint8ClampedArray.BYTES_PER_ELEMENT) ); Atomics.notify(view, poisoned, poisoned)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/non-shared-bufferdata-count-evaluation-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/non-shared-bufferdata-count-evaluation-throws.js index c745669449..a30211d6a2 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/non-shared-bufferdata-count-evaluation-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/non-shared-bufferdata-count-evaluation-throws.js @@ -32,7 +32,7 @@ const poisoned = { assert.throws(Test262Error, function() { Atomics.notify(i32a, 0, poisoned); -}, '`Atomics.notify(i32a, 0, poisoned)` throws Test262Error'); +}); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/non-shared-bufferdata-index-evaluation-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/non-shared-bufferdata-index-evaluation-throws.js index d2cda0718b..799c906bba 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/non-shared-bufferdata-index-evaluation-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/non-shared-bufferdata-index-evaluation-throws.js @@ -28,7 +28,7 @@ const poisoned = { assert.throws(Test262Error, function() { Atomics.notify(i32a, poisoned, 0); -}, '`Atomics.notify(i32a, poisoned, 0)` throws Test262Error'); +}); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/non-shared-bufferdata-non-shared-int-views-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/non-shared-bufferdata-non-shared-int-views-throws.js index 9f9ebd1bb8..6bcc702ef3 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/non-shared-bufferdata-non-shared-int-views-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/non-shared-bufferdata-non-shared-int-views-throws.js @@ -19,26 +19,26 @@ const poisoned = { assert.throws(TypeError, function() { Atomics.notify(new Int16Array(nonsab), poisoned, poisoned); -}, '`Atomics.notify(new Int16Array(nonsab), poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.notify(new Int8Array(nonsab), poisoned, poisoned); -}, '`Atomics.notify(new Int8Array(nonsab), poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.notify(new Uint32Array(nonsab), poisoned, poisoned); -}, '`Atomics.notify(new Uint32Array(nonsab), poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.notify(new Uint16Array(nonsab), poisoned, poisoned); -}, '`Atomics.notify(new Uint16Array(nonsab), poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.notify(new Uint8Array(nonsab), poisoned, poisoned); -}, '`Atomics.notify(new Uint8Array(nonsab), poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.notify(new Uint8ClampedArray(nonsab), poisoned, poisoned); -}, '`Atomics.notify(new Uint8ClampedArray(nonsab), poisoned, poisoned)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/non-shared-int-views.js b/js/src/tests/test262/built-ins/Atomics/notify/non-shared-int-views.js index 4cb606a813..f879615fbd 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/non-shared-int-views.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/non-shared-int-views.js @@ -19,26 +19,26 @@ const poisoned = { assert.throws(TypeError, function() { Atomics.notify(new Int16Array(sab), poisoned, poisoned); -}, '`Atomics.notify(new Int16Array(sab), poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.notify(new Int8Array(sab), poisoned, poisoned); -}, '`Atomics.notify(new Int8Array(sab), poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.notify(new Uint32Array(sab), poisoned, poisoned); -}, '`Atomics.notify(new Uint32Array(sab), poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.notify(new Uint16Array(sab), poisoned, poisoned); -}, '`Atomics.notify(new Uint16Array(sab), poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.notify(new Uint8Array(sab), poisoned, poisoned); -}, '`Atomics.notify(new Uint8Array(sab), poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.notify(new Uint8ClampedArray(sab), poisoned, poisoned); -}, '`Atomics.notify(new Uint8ClampedArray(sab), poisoned, poisoned)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/non-views.js b/js/src/tests/test262/built-ins/Atomics/notify/non-views.js index e068c2d5c7..c01806f9bc 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/non-views.js @@ -13,7 +13,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray testWithAtomicsNonViewValues(function(nonView) { assert.throws(TypeError, function() { Atomics.notify(nonView, 0, 0); - }, '`Atomics.notify(nonView, 0, 0)` throws TypeError'); // Even with count == 0 + }); // Even with count == 0 }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/not-a-constructor.js b/js/src/tests/test262/built-ins/Atomics/notify/not-a-constructor.js index fd1cbdce47..7788ec48ae 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/not-a-constructor.js @@ -26,7 +26,7 @@ assert.sameValue(isConstructor(Atomics.notify), false, 'isConstructor(Atomics.no assert.throws(TypeError, () => { new Atomics.notify(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); -}, '`new Atomics.notify(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/not-a-typedarray-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/not-a-typedarray-throws.js index 5f9b7e2b08..befa3511ee 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/not-a-typedarray-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/not-a-typedarray-throws.js @@ -23,10 +23,10 @@ const poisoned = { assert.throws(TypeError, function() { Atomics.wait({}, 0, 0, 0); -}, '`Atomics.wait({}, 0, 0, 0)` throws TypeError'); +}); assert.throws(TypeError, function () { Atomics.wait({}, poisoned, poisoned, poisoned); -}, '`Atomics.wait({}, poisoned, poisoned, poisoned)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/not-an-object-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/not-an-object-throws.js index c8ca4b2a7f..3ed2e9336a 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/not-an-object-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/not-an-object-throws.js @@ -22,30 +22,30 @@ const poisoned = { assert.throws(TypeError, function() { Atomics.notify(null, poisoned, poisoned); -}, '`Atomics.notify(null, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.notify(undefined, poisoned, poisoned); -}, '`Atomics.notify(undefined, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.notify(true, poisoned, poisoned); -}, '`Atomics.notify(true, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.notify(false, poisoned, poisoned); -}, '`Atomics.notify(false, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.notify('***string***', poisoned, poisoned); -}, '`Atomics.notify(\'***string***\', poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.notify(Number.NEGATIVE_INFINITY, poisoned, poisoned); -}, '`Atomics.notify(Number.NEGATIVE_INFINITY, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.notify(Symbol('***symbol***'), poisoned, poisoned); -}, '`Atomics.notify(Symbol(\'***symbol***\'), poisoned, poisoned)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/null-bufferdata-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/null-bufferdata-throws.js index f6594d3331..efe816189c 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/null-bufferdata-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/null-bufferdata-throws.js @@ -41,6 +41,6 @@ try { assert.throws(TypeError, function() { Atomics.notify(i32a, poisoned, poisoned); -}, '`Atomics.notify(i32a, poisoned, poisoned)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/out-of-range-index-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/out-of-range-index-throws.js index cc64555b1e..42d54cbf25 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/out-of-range-index-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/out-of-range-index-throws.js @@ -29,12 +29,12 @@ var poisoned = { assert.throws(RangeError, function() { Atomics.notify(i32a, Infinity, poisoned); -}, '`Atomics.notify(i32a, Infinity, poisoned)` throws RangeError'); +}); assert.throws(RangeError, function() { Atomics.notify(i32a, 4, poisoned); -}, '`Atomics.notify(i32a, 4, poisoned)` throws RangeError'); +}); assert.throws(RangeError, function() { Atomics.notify(i32a, 200, poisoned); -}, '`Atomics.notify(i32a, 200, poisoned)` throws RangeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/symbol-for-index-throws.js b/js/src/tests/test262/built-ins/Atomics/notify/symbol-for-index-throws.js index 1a157f59c6..ddde5e8939 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/symbol-for-index-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/symbol-for-index-throws.js @@ -47,18 +47,18 @@ const poisonedToPrimitive = { assert.throws(Test262Error, function() { Atomics.notify(i32a, poisonedValueOf, poisonedValueOf); -}, '`Atomics.notify(i32a, poisonedValueOf, poisonedValueOf)` throws Test262Error'); +}); assert.throws(Test262Error, function() { Atomics.notify(i32a, poisonedToPrimitive, poisonedToPrimitive); -}, '`Atomics.notify(i32a, poisonedToPrimitive, poisonedToPrimitive)` throws Test262Error'); +}); assert.throws(TypeError, function() { Atomics.notify(i32a, Symbol("foo"), poisonedValueOf); -}, '`Atomics.notify(i32a, Symbol("foo"), poisonedValueOf)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.notify(i32a, Symbol("foo"), poisonedToPrimitive); -}, '`Atomics.notify(i32a, Symbol("foo"), poisonedToPrimitive)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/validate-arraytype-before-count-coercion.js b/js/src/tests/test262/built-ins/Atomics/notify/validate-arraytype-before-count-coercion.js index 6ddf964c81..9750bd3171 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/validate-arraytype-before-count-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/validate-arraytype-before-count-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/notify/validate-arraytype-before-index-coercion.js b/js/src/tests/test262/built-ins/Atomics/notify/validate-arraytype-before-index-coercion.js index 3f4b498b4e..aaf24ba46e 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/validate-arraytype-before-index-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/validate-arraytype-before-index-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/or/bad-range.js b/js/src/tests/test262/built-ins/Atomics/or/bad-range.js index eaa6285ec4..28bcf0b8a1 100644 --- a/js/src/tests/test262/built-ins/Atomics/or/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/or/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -18,7 +18,7 @@ testWithTypedArrayConstructors(function(TA) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.or(view, IdxGen(view), 10); - }, '`Atomics.or(view, IdxGen(view), 10)` throws RangeError'); + }); }); }, views); diff --git a/js/src/tests/test262/built-ins/Atomics/or/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/or/bigint/bad-range.js index 9ae3dd11c0..15c12332ed 100644 --- a/js/src/tests/test262/built-ins/Atomics/or/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/or/bigint/bad-range.js @@ -16,7 +16,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.or(view, IdxGen(view), 10n); - }, '`Atomics.or(view, IdxGen(view), 10n)` throws RangeError'); + }); }); }); diff --git a/js/src/tests/test262/built-ins/Atomics/or/good-views.js b/js/src/tests/test262/built-ins/Atomics/or/good-views.js index b004226bd8..64423cf284 100644 --- a/js/src/tests/test262/built-ins/Atomics/or/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/or/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. 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/Atomics/or/non-shared-bufferdata.js b/js/src/tests/test262/built-ins/Atomics/or/non-shared-bufferdata.js index 8afe735477..4049f887a1 100644 --- a/js/src/tests/test262/built-ins/Atomics/or/non-shared-bufferdata.js +++ b/js/src/tests/test262/built-ins/Atomics/or/non-shared-bufferdata.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. 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/Atomics/or/non-shared-int-views-throws.js b/js/src/tests/test262/built-ins/Atomics/or/non-shared-int-views-throws.js index 90987ae1ce..67eee61a82 100644 --- a/js/src/tests/test262/built-ins/Atomics/or/non-shared-int-views-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/or/non-shared-int-views-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. 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/Atomics/or/non-views.js b/js/src/tests/test262/built-ins/Atomics/or/non-views.js index e5fe5d9079..0dd7672471 100644 --- a/js/src/tests/test262/built-ins/Atomics/or/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/or/non-views.js @@ -13,7 +13,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray testWithAtomicsNonViewValues(function(view) { assert.throws(TypeError, function() { Atomics.or(view, 0, 0); - }, '`Atomics.or(view, 0, 0)` throws TypeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/or/not-a-constructor.js b/js/src/tests/test262/built-ins/Atomics/or/not-a-constructor.js index 8c40656b9a..c3817fbf56 100644 --- a/js/src/tests/test262/built-ins/Atomics/or/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Atomics/or/not-a-constructor.js @@ -26,7 +26,7 @@ assert.sameValue(isConstructor(Atomics.or), false, 'isConstructor(Atomics.or) mu assert.throws(TypeError, () => { new Atomics.or(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); -}, '`new Atomics.or(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/or/validate-arraytype-before-index-coercion.js b/js/src/tests/test262/built-ins/Atomics/or/validate-arraytype-before-index-coercion.js index 1f016df232..445a74eedb 100644 --- a/js/src/tests/test262/built-ins/Atomics/or/validate-arraytype-before-index-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/or/validate-arraytype-before-index-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/or/validate-arraytype-before-value-coercion.js b/js/src/tests/test262/built-ins/Atomics/or/validate-arraytype-before-value-coercion.js index f94a54a843..b1057df597 100644 --- a/js/src/tests/test262/built-ins/Atomics/or/validate-arraytype-before-value-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/or/validate-arraytype-before-value-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/prop-desc.js b/js/src/tests/test262/built-ins/Atomics/prop-desc.js index ffcbac8fa0..dabc6a18d6 100644 --- a/js/src/tests/test262/built-ins/Atomics/prop-desc.js +++ b/js/src/tests/test262/built-ins/Atomics/prop-desc.js @@ -29,11 +29,11 @@ assert.sameValue(typeof Atomics, "object", 'The value of `typeof Atomics` is "ob assert.throws(TypeError, function() { Atomics(); -}, '`Atomics()` throws TypeError'); +}); assert.throws(TypeError, function() { new Atomics(); -}, '`new Atomics()` throws TypeError'); +}); verifyProperty(this, "Atomics", { enumerable: false, diff --git a/js/src/tests/test262/built-ins/Atomics/store/bad-range.js b/js/src/tests/test262/built-ins/Atomics/store/bad-range.js index e383d1d9ff..674fba1df0 100644 --- a/js/src/tests/test262/built-ins/Atomics/store/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/store/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -18,7 +18,7 @@ testWithTypedArrayConstructors(function(TA) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.store(view, IdxGen(view), 10); - }, '`Atomics.store(view, IdxGen(view), 10)` throws RangeError'); + }); }); }, views); diff --git a/js/src/tests/test262/built-ins/Atomics/store/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/store/bigint/bad-range.js index e7dd5520ce..e1ecbaeeda 100644 --- a/js/src/tests/test262/built-ins/Atomics/store/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/store/bigint/bad-range.js @@ -16,7 +16,7 @@ testWithBigIntTypedArrayConstructors(TA => { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.store(view, IdxGen(view), 10n); - }, '`Atomics.store(view, IdxGen(view), 10n)` throws RangeError'); + }); }); }); diff --git a/js/src/tests/test262/built-ins/Atomics/store/good-views.js b/js/src/tests/test262/built-ins/Atomics/store/good-views.js index c24a7cd4c9..932b8bb926 100644 --- a/js/src/tests/test262/built-ins/Atomics/store/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/store/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. 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/Atomics/store/non-shared-bufferdata.js b/js/src/tests/test262/built-ins/Atomics/store/non-shared-bufferdata.js index 78f1dd9ce0..801c1bea38 100644 --- a/js/src/tests/test262/built-ins/Atomics/store/non-shared-bufferdata.js +++ b/js/src/tests/test262/built-ins/Atomics/store/non-shared-bufferdata.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. 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/Atomics/store/non-shared-int-views-throws.js b/js/src/tests/test262/built-ins/Atomics/store/non-shared-int-views-throws.js index 3924de90d3..675a6d7e00 100644 --- a/js/src/tests/test262/built-ins/Atomics/store/non-shared-int-views-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/store/non-shared-int-views-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. 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/Atomics/store/non-views.js b/js/src/tests/test262/built-ins/Atomics/store/non-views.js index 46e7b5e812..aa2608b304 100644 --- a/js/src/tests/test262/built-ins/Atomics/store/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/store/non-views.js @@ -13,7 +13,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray testWithAtomicsNonViewValues(function(view) { assert.throws(TypeError, function() { Atomics.store(view, 0, 0); - }, '`Atomics.store(view, 0, 0)` throws TypeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/store/not-a-constructor.js b/js/src/tests/test262/built-ins/Atomics/store/not-a-constructor.js index c9b126ba56..6fb8b73191 100644 --- a/js/src/tests/test262/built-ins/Atomics/store/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Atomics/store/not-a-constructor.js @@ -26,7 +26,7 @@ assert.sameValue(isConstructor(Atomics.store), false, 'isConstructor(Atomics.sto assert.throws(TypeError, () => { new Atomics.store(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); -}, '`new Atomics.store(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/store/validate-arraytype-before-index-coercion.js b/js/src/tests/test262/built-ins/Atomics/store/validate-arraytype-before-index-coercion.js index 08422c1339..4fb7cf03ad 100644 --- a/js/src/tests/test262/built-ins/Atomics/store/validate-arraytype-before-index-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/store/validate-arraytype-before-index-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/store/validate-arraytype-before-value-coercion.js b/js/src/tests/test262/built-ins/Atomics/store/validate-arraytype-before-value-coercion.js index 990d1d163e..3416e22e63 100644 --- a/js/src/tests/test262/built-ins/Atomics/store/validate-arraytype-before-value-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/store/validate-arraytype-before-value-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/sub/bad-range.js b/js/src/tests/test262/built-ins/Atomics/sub/bad-range.js index 7e08c03da5..48a6394293 100644 --- a/js/src/tests/test262/built-ins/Atomics/sub/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/sub/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -18,7 +18,7 @@ testWithTypedArrayConstructors(function(TA) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.sub(view, IdxGen(view), 10); - }, '`Atomics.sub(view, IdxGen(view), 10)` throws RangeError'); + }); }); }, views); diff --git a/js/src/tests/test262/built-ins/Atomics/sub/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/sub/bigint/bad-range.js index b0ce7d8cdc..f0a02edc20 100644 --- a/js/src/tests/test262/built-ins/Atomics/sub/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/sub/bigint/bad-range.js @@ -16,7 +16,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.sub(view, IdxGen(view), 10n); - }, '`Atomics.sub(view, IdxGen(view), 10n)` throws RangeError'); + }); }); }); diff --git a/js/src/tests/test262/built-ins/Atomics/sub/good-views.js b/js/src/tests/test262/built-ins/Atomics/sub/good-views.js index 60ea4ad569..0352b30ac2 100644 --- a/js/src/tests/test262/built-ins/Atomics/sub/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/sub/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. 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/Atomics/sub/non-shared-bufferdata.js b/js/src/tests/test262/built-ins/Atomics/sub/non-shared-bufferdata.js index 3f36ea5eea..2d78a9abcd 100644 --- a/js/src/tests/test262/built-ins/Atomics/sub/non-shared-bufferdata.js +++ b/js/src/tests/test262/built-ins/Atomics/sub/non-shared-bufferdata.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. 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/Atomics/sub/non-shared-int-views-throws.js b/js/src/tests/test262/built-ins/Atomics/sub/non-shared-int-views-throws.js index c2413ed30b..a72892d925 100644 --- a/js/src/tests/test262/built-ins/Atomics/sub/non-shared-int-views-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/sub/non-shared-int-views-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. 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/Atomics/sub/non-views.js b/js/src/tests/test262/built-ins/Atomics/sub/non-views.js index 85ee77acff..246470bf62 100644 --- a/js/src/tests/test262/built-ins/Atomics/sub/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/sub/non-views.js @@ -13,7 +13,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray testWithAtomicsNonViewValues(function(view) { assert.throws(TypeError, function() { Atomics.sub(view, 0, 0); - }, '`Atomics.sub(view, 0, 0)` throws TypeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/sub/not-a-constructor.js b/js/src/tests/test262/built-ins/Atomics/sub/not-a-constructor.js index 74991a59dc..98563ad324 100644 --- a/js/src/tests/test262/built-ins/Atomics/sub/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Atomics/sub/not-a-constructor.js @@ -26,7 +26,7 @@ assert.sameValue(isConstructor(Atomics.sub), false, 'isConstructor(Atomics.sub) assert.throws(TypeError, () => { new Atomics.sub(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); -}, '`new Atomics.sub(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/sub/validate-arraytype-before-index-coercion.js b/js/src/tests/test262/built-ins/Atomics/sub/validate-arraytype-before-index-coercion.js index 4bb9587e6d..bd717872c1 100644 --- a/js/src/tests/test262/built-ins/Atomics/sub/validate-arraytype-before-index-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/sub/validate-arraytype-before-index-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/sub/validate-arraytype-before-value-coercion.js b/js/src/tests/test262/built-ins/Atomics/sub/validate-arraytype-before-value-coercion.js index 7af4d36a94..0234ad4ba4 100644 --- a/js/src/tests/test262/built-ins/Atomics/sub/validate-arraytype-before-value-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/sub/validate-arraytype-before-value-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/wait/bad-range.js b/js/src/tests/test262/built-ins/Atomics/wait/bad-range.js index 93175371b9..3602773a4d 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bad-range.js @@ -23,7 +23,7 @@ const i32a = new Int32Array( testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.wait(i32a, IdxGen(i32a), 0, 0); - }, '`Atomics.wait(i32a, IdxGen(i32a), 0, 0)` throws RangeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/bad-range.js index c36d379406..8035ae5428 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/bad-range.js @@ -23,7 +23,7 @@ const i64a = new BigInt64Array( testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.wait(i64a, IdxGen(i64a), 0n, 0); - }, '`Atomics.wait(i64a, IdxGen(i64a), 0n, 0)` throws RangeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/cannot-suspend-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/cannot-suspend-throws.js index 212dbfddc6..4ca336c9dd 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/cannot-suspend-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/cannot-suspend-throws.js @@ -22,6 +22,6 @@ const i64a = new BigInt64Array(new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELE assert.throws(TypeError, function() { Atomics.wait(i64a, 0, 0n, 0); -}, '`Atomics.wait(i64a, 0, 0n, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-index-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-index-throws.js index 4d976026a1..489806e301 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-index-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-index-throws.js @@ -28,15 +28,15 @@ const poisoned = { assert.throws(RangeError, function() { Atomics.wait(i64a, -Infinity, poisoned, poisoned); -}, '`Atomics.wait(i64a, -Infinity, poisoned, poisoned)` throws RangeError'); +}); assert.throws(RangeError, function() { Atomics.wait(i64a, -7.999, poisoned, poisoned); -}, '`Atomics.wait(i64a, -7.999, poisoned, poisoned)` throws RangeError'); +}); assert.throws(RangeError, function() { Atomics.wait(i64a, -1, poisoned, poisoned); -}, '`Atomics.wait(i64a, -1, poisoned, poisoned)` throws RangeError'); +}); assert.throws(RangeError, function() { Atomics.wait(i64a, -300, poisoned, poisoned); -}, '`Atomics.wait(i64a, -300, poisoned, poisoned)` throws RangeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/non-bigint64-typedarray-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/non-bigint64-typedarray-throws.js index ed42bf7849..4aada1c582 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/non-bigint64-typedarray-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/non-bigint64-typedarray-throws.js @@ -35,10 +35,10 @@ const poisoned = { assert.throws(TypeError, function() { Atomics.wait(i64a, 0, 0n, 0); -}, '`Atomics.wait(i64a, 0, 0n, 0)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.wait(i64a, poisoned, poisoned, poisoned); -}, '`Atomics.wait(i64a, poisoned, poisoned, poisoned)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/non-shared-bufferdata-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/non-shared-bufferdata-throws.js index ec45720916..04e61cae42 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/non-shared-bufferdata-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/non-shared-bufferdata-throws.js @@ -25,10 +25,10 @@ const poisoned = { assert.throws(TypeError, function() { Atomics.wait(i64a, 0, 0n, 0); -}, '`Atomics.wait(i64a, 0, 0n, 0)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.wait(i64a, poisoned, poisoned, poisoned); -}, '`Atomics.wait(i64a, poisoned, poisoned, poisoned)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/null-bufferdata-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/null-bufferdata-throws.js index 9499b9f0e6..bfc095cd32 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/null-bufferdata-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/null-bufferdata-throws.js @@ -43,6 +43,6 @@ try { assert.throws(TypeError, function() { Atomics.wait(i64a, poisoned, poisoned, poisoned); -}, '`Atomics.wait(i64a, poisoned, poisoned, poisoned)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/out-of-range-index-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/out-of-range-index-throws.js index 582a251abb..6475a4f027 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/out-of-range-index-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/out-of-range-index-throws.js @@ -29,12 +29,12 @@ const poisoned = { assert.throws(RangeError, function() { Atomics.wait(i64a, Infinity, poisoned, poisoned); -}, '`Atomics.wait(i64a, Infinity, poisoned, poisoned)` throws RangeError'); +}); assert.throws(RangeError, function() { Atomics.wait(i64a, 8, poisoned, poisoned); -}, '`Atomics.wait(i64a, 8, poisoned, poisoned)` throws RangeError'); +}); assert.throws(RangeError, function() { Atomics.wait(i64a, 200, poisoned, poisoned); -}, '`Atomics.wait(i64a, 200, poisoned, poisoned)` throws RangeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/cannot-suspend-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/cannot-suspend-throws.js index a11c635cd1..5889536890 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/cannot-suspend-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/cannot-suspend-throws.js @@ -25,6 +25,6 @@ const i32a = new Int32Array( assert.throws(TypeError, function() { Atomics.wait(i32a, 0, 0, 0); -}, '`Atomics.wait(i32a, 0, 0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/negative-index-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/negative-index-throws.js index 61d0b84067..0993497b0f 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/negative-index-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/negative-index-throws.js @@ -30,15 +30,15 @@ const poisoned = { assert.throws(RangeError, function() { Atomics.wait(i32a, -Infinity, poisoned, poisoned); -}, '`Atomics.wait(i32a, -Infinity, poisoned, poisoned)` throws RangeError'); +}); assert.throws(RangeError, function() { Atomics.wait(i32a, -7.999, poisoned, poisoned); -}, '`Atomics.wait(i32a, -7.999, poisoned, poisoned)` throws RangeError'); +}); assert.throws(RangeError, function() { Atomics.wait(i32a, -1, poisoned, poisoned); -}, '`Atomics.wait(i32a, -1, poisoned, poisoned)` throws RangeError'); +}); assert.throws(RangeError, function() { Atomics.wait(i32a, -300, poisoned, poisoned); -}, '`Atomics.wait(i32a, -300, poisoned, poisoned)` throws RangeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/non-int32-typedarray-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/non-int32-typedarray-throws.js index 64fec573f5..9b5deec8fa 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/non-int32-typedarray-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/non-int32-typedarray-throws.js @@ -27,14 +27,14 @@ assert.throws(TypeError, function() { new SharedArrayBuffer(Float64Array.BYTES_PER_ELEMENT * 8) ); Atomics.wait(view, poisoned, poisoned, poisoned); -}, '`const view = new Float64Array( new SharedArrayBuffer(Float64Array.BYTES_PER_ELEMENT * 8) ); Atomics.wait(view, poisoned, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { const view = new Float32Array( new SharedArrayBuffer(Float32Array.BYTES_PER_ELEMENT * 4) ); Atomics.wait(view, poisoned, poisoned, poisoned); -}, '`const view = new Float32Array( new SharedArrayBuffer(Float32Array.BYTES_PER_ELEMENT * 4) ); Atomics.wait(view, poisoned, poisoned, poisoned)` throws TypeError'); +}); if (typeof Float16Array !== 'undefined') { assert.throws(TypeError, function() { @@ -42,7 +42,7 @@ if (typeof Float16Array !== 'undefined') { new SharedArrayBuffer(Float16Array.BYTES_PER_ELEMENT * 2) ); Atomics.wait(view, poisoned, poisoned, poisoned); - }, '`const view = new Float16Array( new SharedArrayBuffer(Float16Array.BYTES_PER_ELEMENT * 2) ); Atomics.wait(view, poisoned, poisoned, poisoned)` throws TypeError'); + }); } assert.throws(TypeError, function() { @@ -50,41 +50,41 @@ assert.throws(TypeError, function() { new SharedArrayBuffer(Int16Array.BYTES_PER_ELEMENT * 2) ); Atomics.wait(view, poisoned, poisoned, poisoned); -}, '`const view = new Int16Array( new SharedArrayBuffer(Int16Array.BYTES_PER_ELEMENT * 2) ); Atomics.wait(view, poisoned, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { const view = new Int8Array( new SharedArrayBuffer(Int8Array.BYTES_PER_ELEMENT) ); Atomics.wait(view, poisoned, poisoned, poisoned); -}, '`const view = new Int8Array( new SharedArrayBuffer(Int8Array.BYTES_PER_ELEMENT) ); Atomics.wait(view, poisoned, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { const view = new Uint32Array( new SharedArrayBuffer(Uint32Array.BYTES_PER_ELEMENT * 4) ); Atomics.wait(view, poisoned, poisoned, poisoned); -}, '`const view = new Uint32Array( new SharedArrayBuffer(Uint32Array.BYTES_PER_ELEMENT * 4) ); Atomics.wait(view, poisoned, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { const view = new Uint16Array( new SharedArrayBuffer(Uint16Array.BYTES_PER_ELEMENT * 2) ); Atomics.wait(view, poisoned, poisoned, poisoned); -}, '`const view = new Uint16Array( new SharedArrayBuffer(Uint16Array.BYTES_PER_ELEMENT * 2) ); Atomics.wait(view, poisoned, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { const view = new Uint8Array( new SharedArrayBuffer(Uint8Array.BYTES_PER_ELEMENT) ); Atomics.wait(view, poisoned, poisoned, poisoned); -}, '`const view = new Uint8Array( new SharedArrayBuffer(Uint8Array.BYTES_PER_ELEMENT) ); Atomics.wait(view, poisoned, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { const view = new Uint8ClampedArray( new SharedArrayBuffer(Uint8ClampedArray.BYTES_PER_ELEMENT) ); Atomics.wait(view, poisoned, poisoned, poisoned); -}, '`const view = new Uint8ClampedArray( new SharedArrayBuffer(Uint8ClampedArray.BYTES_PER_ELEMENT) ); Atomics.wait(view, poisoned, poisoned, poisoned)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/non-shared-bufferdata-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/non-shared-bufferdata-throws.js index dcee5b7c34..409661602c 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/non-shared-bufferdata-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/non-shared-bufferdata-throws.js @@ -28,10 +28,10 @@ const poisoned = { assert.throws(TypeError, function() { Atomics.wait(i32a, 0, 0, 0); -}, '`Atomics.wait(i32a, 0, 0, 0)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.wait(i32a, poisoned, poisoned, poisoned); -}, '`Atomics.wait(i32a, poisoned, poisoned, poisoned)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/not-a-typedarray-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/not-a-typedarray-throws.js index 484d1affec..ac4f4228ef 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/not-a-typedarray-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/not-a-typedarray-throws.js @@ -23,10 +23,10 @@ var poisoned = { assert.throws(TypeError, function() { Atomics.wait({}, 0, 0, 0); -}, '`Atomics.wait({}, 0, 0, 0)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.wait({}, poisoned, poisoned, poisoned); -}, '`Atomics.wait({}, poisoned, poisoned, poisoned)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/not-an-object-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/not-an-object-throws.js index 64ce6c2277..881d43802c 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/not-an-object-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/not-an-object-throws.js @@ -22,30 +22,30 @@ var poisoned = { assert.throws(TypeError, function() { Atomics.wait(null, poisoned, poisoned, poisoned); -}, '`Atomics.wait(null, poisoned, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.wait(undefined, poisoned, poisoned, poisoned); -}, '`Atomics.wait(undefined, poisoned, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.wait(true, poisoned, poisoned, poisoned); -}, '`Atomics.wait(true, poisoned, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.wait(false, poisoned, poisoned, poisoned); -}, '`Atomics.wait(false, poisoned, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.wait('***string***', poisoned, poisoned, poisoned); -}, '`Atomics.wait(\'***string***\', poisoned, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.wait(Number.NEGATIVE_INFINITY, poisoned, poisoned, poisoned); -}, '`Atomics.wait(Number.NEGATIVE_INFINITY, poisoned, poisoned, poisoned)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.wait(Symbol('***symbol***'), poisoned, poisoned, poisoned); -}, '`Atomics.wait(Symbol(\'***symbol***\'), poisoned, poisoned, poisoned)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/null-bufferdata-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/null-bufferdata-throws.js index 0b8ab82185..90fe511a66 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/null-bufferdata-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/null-bufferdata-throws.js @@ -41,6 +41,6 @@ try { assert.throws(TypeError, function() { Atomics.wait(i32a, poisoned, poisoned, poisoned); -}, '`Atomics.wait(i32a, poisoned, poisoned, poisoned)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/out-of-range-index-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/out-of-range-index-throws.js index d2d3fdea27..fb7a379a19 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/out-of-range-index-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/out-of-range-index-throws.js @@ -29,15 +29,15 @@ const poisoned = { assert.throws(RangeError, function() { Atomics.wait(i32a, Infinity, poisoned, poisoned); -}, '`Atomics.wait(i32a, Infinity, poisoned, poisoned)` throws RangeError'); +}); assert.throws(RangeError, function() { Atomics.wait(i32a, -1, poisoned, poisoned); -}, '`Atomics.wait(i32a, -1, poisoned, poisoned)` throws RangeError'); +}); assert.throws(RangeError, function() { Atomics.wait(i32a, 4, poisoned, poisoned); -}, '`Atomics.wait(i32a, 4, poisoned, poisoned)` throws RangeError'); +}); assert.throws(RangeError, function() { Atomics.wait(i32a, 200, poisoned, poisoned); -}, '`Atomics.wait(i32a, 200, poisoned, poisoned)` throws RangeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/poisoned-object-for-timeout-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/poisoned-object-for-timeout-throws.js index 2d41dcb4d6..7127597c44 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/poisoned-object-for-timeout-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/poisoned-object-for-timeout-throws.js @@ -37,10 +37,10 @@ const poisonedToPrimitive = { assert.throws(Test262Error, function() { Atomics.wait(i32a, 0, 0, poisonedValueOf); -}, '`Atomics.wait(i32a, 0, 0, poisonedValueOf)` throws Test262Error'); +}); assert.throws(Test262Error, function() { Atomics.wait(i32a, 0, 0, poisonedToPrimitive); -}, '`Atomics.wait(i32a, 0, 0, poisonedToPrimitive)` throws Test262Error'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-index-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-index-throws.js index 332588e972..0b86b62d5d 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-index-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-index-throws.js @@ -47,18 +47,18 @@ const poisonedToPrimitive = { assert.throws(Test262Error, function() { Atomics.wait(i32a, poisonedValueOf, poisonedValueOf, poisonedValueOf); -}, '`Atomics.wait(i32a, poisonedValueOf, poisonedValueOf, poisonedValueOf)` throws Test262Error'); +}); assert.throws(Test262Error, function() { Atomics.wait(i32a, poisonedToPrimitive, poisonedToPrimitive, poisonedToPrimitive); -}, '`Atomics.wait(i32a, poisonedToPrimitive, poisonedToPrimitive, poisonedToPrimitive)` throws Test262Error'); +}); assert.throws(TypeError, function() { Atomics.wait(i32a, Symbol('foo'), poisonedValueOf, poisonedValueOf); -}, '`Atomics.wait(i32a, Symbol(\'foo\'), poisonedValueOf, poisonedValueOf)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.wait(i32a, Symbol('foo'), poisonedToPrimitive, poisonedToPrimitive); -}, '`Atomics.wait(i32a, Symbol(\'foo\'), poisonedToPrimitive, poisonedToPrimitive)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-timeout-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-timeout-throws.js index 76d6874f28..2e75ac65f9 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-timeout-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-timeout-throws.js @@ -33,18 +33,18 @@ var poisonedToPrimitive = { assert.throws(Test262Error, function() { Atomics.wait(i32a, 0, 0, poisonedValueOf); -}, '`Atomics.wait(i32a, 0, 0, poisonedValueOf)` throws Test262Error'); +}); assert.throws(Test262Error, function() { Atomics.wait(i32a, 0, 0, poisonedToPrimitive); -}, '`Atomics.wait(i32a, 0, 0, poisonedToPrimitive)` throws Test262Error'); +}); assert.throws(TypeError, function() { Atomics.wait(i32a, 0, 0, Symbol("foo")); -}, '`Atomics.wait(i32a, 0, 0, Symbol("foo"))` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.wait(i32a, 0, 0, Symbol("foo")); -}, '`Atomics.wait(i32a, 0, 0, Symbol("foo"))` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-value-throws.js b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-value-throws.js index 3a4e3a8cbf..2186a4bace 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-value-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-value-throws.js @@ -38,18 +38,18 @@ const poisonedToPrimitive = { assert.throws(Test262Error, function() { Atomics.wait(i32a, 0, poisonedValueOf, poisonedValueOf); -}, '`Atomics.wait(i32a, 0, poisonedValueOf, poisonedValueOf)` throws Test262Error'); +}); assert.throws(Test262Error, function() { Atomics.wait(i32a, 0, poisonedToPrimitive, poisonedToPrimitive); -}, '`Atomics.wait(i32a, 0, poisonedToPrimitive, poisonedToPrimitive)` throws Test262Error'); +}); assert.throws(TypeError, function() { Atomics.wait(i32a, 0, Symbol("foo"), poisonedValueOf); -}, '`Atomics.wait(i32a, 0, Symbol("foo"), poisonedValueOf)` throws TypeError'); +}); assert.throws(TypeError, function() { Atomics.wait(i32a, 0, Symbol("foo"), poisonedToPrimitive); -}, '`Atomics.wait(i32a, 0, Symbol("foo"), poisonedToPrimitive)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/validate-arraytype-before-index-coercion.js b/js/src/tests/test262/built-ins/Atomics/wait/validate-arraytype-before-index-coercion.js index 26586d313e..4288a65f89 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/validate-arraytype-before-index-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/validate-arraytype-before-index-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/wait/validate-arraytype-before-timeout-coercion.js b/js/src/tests/test262/built-ins/Atomics/wait/validate-arraytype-before-timeout-coercion.js index 58328bc348..c714769674 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/validate-arraytype-before-timeout-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/validate-arraytype-before-timeout-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/wait/validate-arraytype-before-value-coercion.js b/js/src/tests/test262/built-ins/Atomics/wait/validate-arraytype-before-value-coercion.js index b597ebf9f2..0c993843af 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/validate-arraytype-before-value-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/validate-arraytype-before-value-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/waitAsync/validate-arraytype-before-index-coercion.js b/js/src/tests/test262/built-ins/Atomics/waitAsync/validate-arraytype-before-index-coercion.js index 4bdb4215ab..9886ac6d06 100644 --- a/js/src/tests/test262/built-ins/Atomics/waitAsync/validate-arraytype-before-index-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/waitAsync/validate-arraytype-before-index-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip -- Atomics.waitAsync is not supported +// |reftest| shell-option(--enable-float16array) skip -- Atomics.waitAsync is not supported // Copyright (C) 2020 Rick Waldron. 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/Atomics/waitAsync/validate-arraytype-before-value-coercion.js b/js/src/tests/test262/built-ins/Atomics/waitAsync/validate-arraytype-before-value-coercion.js index c329676b4d..5f165c8035 100644 --- a/js/src/tests/test262/built-ins/Atomics/waitAsync/validate-arraytype-before-value-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/waitAsync/validate-arraytype-before-value-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip -- Atomics.waitAsync is not supported +// |reftest| shell-option(--enable-float16array) skip -- Atomics.waitAsync is not supported // Copyright (C) 2020 Rick Waldron. 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/Atomics/xor/bad-range.js b/js/src/tests/test262/built-ins/Atomics/xor/bad-range.js index a0f267a353..73237bcc50 100644 --- a/js/src/tests/test262/built-ins/Atomics/xor/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/xor/bad-range.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -18,7 +18,7 @@ testWithTypedArrayConstructors(function(TA) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.xor(view, IdxGen(view), 0); - }, '`Atomics.xor(view, IdxGen(view), 0)` throws RangeError'); + }); }); }, views); diff --git a/js/src/tests/test262/built-ins/Atomics/xor/bigint/bad-range.js b/js/src/tests/test262/built-ins/Atomics/xor/bigint/bad-range.js index 08e2427d5f..16a38a8922 100644 --- a/js/src/tests/test262/built-ins/Atomics/xor/bigint/bad-range.js +++ b/js/src/tests/test262/built-ins/Atomics/xor/bigint/bad-range.js @@ -17,7 +17,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { testWithAtomicsOutOfBoundsIndices(function(IdxGen) { assert.throws(RangeError, function() { Atomics.xor(view, IdxGen(view), 10); - }, '`Atomics.xor(view, IdxGen(view), 10)` throws RangeError'); + }); }); }); diff --git a/js/src/tests/test262/built-ins/Atomics/xor/good-views.js b/js/src/tests/test262/built-ins/Atomics/xor/good-views.js index 6c70e71b28..1548900871 100644 --- a/js/src/tests/test262/built-ins/Atomics/xor/good-views.js +++ b/js/src/tests/test262/built-ins/Atomics/xor/good-views.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics // Copyright (C) 2017 Mozilla Corporation. 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/Atomics/xor/non-shared-bufferdata.js b/js/src/tests/test262/built-ins/Atomics/xor/non-shared-bufferdata.js index b8b4ec7bf2..2c1739108a 100644 --- a/js/src/tests/test262/built-ins/Atomics/xor/non-shared-bufferdata.js +++ b/js/src/tests/test262/built-ins/Atomics/xor/non-shared-bufferdata.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. 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/Atomics/xor/non-shared-int-views-throws.js b/js/src/tests/test262/built-ins/Atomics/xor/non-shared-int-views-throws.js index d3f1dedbd8..4803a385a8 100644 --- a/js/src/tests/test262/built-ins/Atomics/xor/non-shared-int-views-throws.js +++ b/js/src/tests/test262/built-ins/Atomics/xor/non-shared-int-views-throws.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2017 Mozilla Corporation. 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/Atomics/xor/non-views.js b/js/src/tests/test262/built-ins/Atomics/xor/non-views.js index 64767f3236..ab1e6d2164 100644 --- a/js/src/tests/test262/built-ins/Atomics/xor/non-views.js +++ b/js/src/tests/test262/built-ins/Atomics/xor/non-views.js @@ -13,7 +13,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray testWithAtomicsNonViewValues(function(view) { assert.throws(TypeError, function() { Atomics.xor(view, 0, 0); - }, '`Atomics.xor(view, 0, 0)` throws TypeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/xor/not-a-constructor.js b/js/src/tests/test262/built-ins/Atomics/xor/not-a-constructor.js index 292954d861..fb7f185257 100644 --- a/js/src/tests/test262/built-ins/Atomics/xor/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Atomics/xor/not-a-constructor.js @@ -26,7 +26,7 @@ assert.sameValue(isConstructor(Atomics.xor), false, 'isConstructor(Atomics.xor) assert.throws(TypeError, () => { new Atomics.xor(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT))); -}, '`new Atomics.xor(new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)))` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/xor/validate-arraytype-before-index-coercion.js b/js/src/tests/test262/built-ins/Atomics/xor/validate-arraytype-before-index-coercion.js index dc401d40f6..366a9d5172 100644 --- a/js/src/tests/test262/built-ins/Atomics/xor/validate-arraytype-before-index-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/xor/validate-arraytype-before-index-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/Atomics/xor/validate-arraytype-before-value-coercion.js b/js/src/tests/test262/built-ins/Atomics/xor/validate-arraytype-before-value-coercion.js index b4ee63b0aa..c2d7e9b44a 100644 --- a/js/src/tests/test262/built-ins/Atomics/xor/validate-arraytype-before-value-coercion.js +++ b/js/src/tests/test262/built-ins/Atomics/xor/validate-arraytype-before-value-coercion.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally // Copyright (C) 2019 André Bargull. 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/BigInt/asIntN/not-a-constructor.js b/js/src/tests/test262/built-ins/BigInt/asIntN/not-a-constructor.js index 7875347fcf..433e276878 100644 --- a/js/src/tests/test262/built-ins/BigInt/asIntN/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/BigInt/asIntN/not-a-constructor.js @@ -23,6 +23,6 @@ assert.sameValue(isConstructor(BigInt.asIntN), false, 'isConstructor(BigInt.asIn assert.throws(TypeError, () => { new BigInt.asIntN(64, 1n); -}, '`new BigInt.asIntN(64, 1n)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/BigInt/asUintN/not-a-constructor.js b/js/src/tests/test262/built-ins/BigInt/asUintN/not-a-constructor.js index e1208f5886..8e1bf945a0 100644 --- a/js/src/tests/test262/built-ins/BigInt/asUintN/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/BigInt/asUintN/not-a-constructor.js @@ -23,6 +23,6 @@ assert.sameValue(isConstructor(BigInt.asUintN), false, 'isConstructor(BigInt.asU assert.throws(TypeError, () => { new BigInt.asUintN(64, 1n); -}, '`new BigInt.asUintN(64, 1n)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/BigInt/prototype/toLocaleString/not-a-constructor.js b/js/src/tests/test262/built-ins/BigInt/prototype/toLocaleString/not-a-constructor.js index e51206920a..0880f443eb 100644 --- a/js/src/tests/test262/built-ins/BigInt/prototype/toLocaleString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/BigInt/prototype/toLocaleString/not-a-constructor.js @@ -28,6 +28,6 @@ assert.sameValue( assert.throws(TypeError, () => { let n = 1n; new n.toLocaleString(); -}, '`let n = 1n; new n.toLocaleString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/BigInt/prototype/toString/not-a-constructor.js b/js/src/tests/test262/built-ins/BigInt/prototype/toString/not-a-constructor.js index ffa6c1491c..82379998ef 100644 --- a/js/src/tests/test262/built-ins/BigInt/prototype/toString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/BigInt/prototype/toString/not-a-constructor.js @@ -28,6 +28,6 @@ assert.sameValue( assert.throws(TypeError, () => { let n = 1n; new n.toString(); -}, '`let n = 1n; new n.toString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/BigInt/prototype/valueOf/not-a-constructor.js b/js/src/tests/test262/built-ins/BigInt/prototype/valueOf/not-a-constructor.js index 1476cd46dd..2046584fda 100644 --- a/js/src/tests/test262/built-ins/BigInt/prototype/valueOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/BigInt/prototype/valueOf/not-a-constructor.js @@ -28,6 +28,6 @@ assert.sameValue( assert.throws(TypeError, () => { let n = 1n; new n.valueOf(); -}, '`let n = 1n; new n.valueOf()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Boolean/prototype/toString/length.js b/js/src/tests/test262/built-ins/Boolean/prototype/toString/length.js index a61183ebe0..bcaddc2e7b 100644 --- a/js/src/tests/test262/built-ins/Boolean/prototype/toString/length.js +++ b/js/src/tests/test262/built-ins/Boolean/prototype/toString/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Boolean.prototype.toString.length, 0); - -verifyNotEnumerable(Boolean.prototype.toString, "length"); -verifyNotWritable(Boolean.prototype.toString, "length"); -verifyConfigurable(Boolean.prototype.toString, "length"); +verifyProperty(Boolean.prototype.toString, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Boolean/prototype/toString/name.js b/js/src/tests/test262/built-ins/Boolean/prototype/toString/name.js index 55b337eaad..1e3edcda85 100644 --- a/js/src/tests/test262/built-ins/Boolean/prototype/toString/name.js +++ b/js/src/tests/test262/built-ins/Boolean/prototype/toString/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Boolean.prototype.toString.name, "toString"); - -verifyNotEnumerable(Boolean.prototype.toString, "name"); -verifyNotWritable(Boolean.prototype.toString, "name"); -verifyConfigurable(Boolean.prototype.toString, "name"); +verifyProperty(Boolean.prototype.toString, "name", { + value: "toString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Boolean/prototype/toString/not-a-constructor.js b/js/src/tests/test262/built-ins/Boolean/prototype/toString/not-a-constructor.js index 548a4e70c7..db2416404e 100644 --- a/js/src/tests/test262/built-ins/Boolean/prototype/toString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Boolean/prototype/toString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Boolean.prototype.toString(); -}, '`new Boolean.prototype.toString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Boolean/prototype/valueOf/length.js b/js/src/tests/test262/built-ins/Boolean/prototype/valueOf/length.js index 0d49d0670b..2cf7287737 100644 --- a/js/src/tests/test262/built-ins/Boolean/prototype/valueOf/length.js +++ b/js/src/tests/test262/built-ins/Boolean/prototype/valueOf/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Boolean.prototype.valueOf.length, 0); - -verifyNotEnumerable(Boolean.prototype.valueOf, "length"); -verifyNotWritable(Boolean.prototype.valueOf, "length"); -verifyConfigurable(Boolean.prototype.valueOf, "length"); +verifyProperty(Boolean.prototype.valueOf, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Boolean/prototype/valueOf/name.js b/js/src/tests/test262/built-ins/Boolean/prototype/valueOf/name.js index bb0b1138eb..934986997e 100644 --- a/js/src/tests/test262/built-ins/Boolean/prototype/valueOf/name.js +++ b/js/src/tests/test262/built-ins/Boolean/prototype/valueOf/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Boolean.prototype.valueOf.name, "valueOf"); - -verifyNotEnumerable(Boolean.prototype.valueOf, "name"); -verifyNotWritable(Boolean.prototype.valueOf, "name"); -verifyConfigurable(Boolean.prototype.valueOf, "name"); +verifyProperty(Boolean.prototype.valueOf, "name", { + value: "valueOf", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Boolean/prototype/valueOf/not-a-constructor.js b/js/src/tests/test262/built-ins/Boolean/prototype/valueOf/not-a-constructor.js index f3c549e341..1459698f70 100644 --- a/js/src/tests/test262/built-ins/Boolean/prototype/valueOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Boolean/prototype/valueOf/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Boolean.prototype.valueOf(); -}, '`new Boolean.prototype.valueOf()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/byteOffset-validated-against-initial-buffer-length.js b/js/src/tests/test262/built-ins/DataView/byteOffset-validated-against-initial-buffer-length.js new file mode 100644 index 0000000000..51b030b66b --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/byteOffset-validated-against-initial-buffer-length.js @@ -0,0 +1,46 @@ +// Copyright (C) 2024 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview-buffer-byteoffset-bytelength +description: > + The byteOffset argument is validated against the initial buffer length. +info: | + DataView ( buffer [ , byteOffset [ , byteLength ] ] ) + + ... + 3. Let offset be ? ToIndex(byteOffset). + ... + 5. Let bufferByteLength be ArrayBufferByteLength(buffer, seq-cst). + 6. If offset > bufferByteLength, throw a RangeError exception. + ... + 10. Let O be ? OrdinaryCreateFromConstructor(NewTarget, "%DataView.prototype%", + « [[DataView]], [[ViewedArrayBuffer]], [[ByteLength]], [[ByteOffset]] »). + ... + + OrdinaryCreateFromConstructor ( constructor, intrinsicDefaultProto [ , internalSlotsList ] ) + + ... + 2. Let proto be ? GetPrototypeFromConstructor(constructor, intrinsicDefaultProto). + ... + +features: [Reflect.construct] +---*/ + +let newTarget = Object.defineProperty(function(){}.bind(), "prototype", { + get() { + throw new Test262Error("GetPrototypeFromConstructor not executed"); + } +}); + +// Zero length buffer. +let ab = new ArrayBuffer(0); + +// Byte offset is larger than the buffer length, which is zero. +let byteOffset = 10; + +assert.throws(RangeError, () => { + Reflect.construct(DataView, [ab, byteOffset], newTarget); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/name.js b/js/src/tests/test262/built-ins/DataView/name.js index 2b1e1c74bd..da2852d9f8 100644 --- a/js/src/tests/test262/built-ins/DataView/name.js +++ b/js/src/tests/test262/built-ins/DataView/name.js @@ -8,10 +8,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.name, "DataView", "The value of `DataView.name` is `'DataView'`"); - -verifyNotEnumerable(DataView, "name"); -verifyNotWritable(DataView, "name"); -verifyConfigurable(DataView, "name"); +verifyProperty(DataView, "name", { + value: "DataView", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/buffer/length.js b/js/src/tests/test262/built-ins/DataView/prototype/buffer/length.js index 826ab9e259..6d49bd8107 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/buffer/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/buffer/length.js @@ -24,10 +24,11 @@ includes: [propertyHelper.js] var desc = Object.getOwnPropertyDescriptor(DataView.prototype, "buffer"); -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/DataView/prototype/buffer/name.js b/js/src/tests/test262/built-ins/DataView/prototype/buffer/name.js index 6721b00274..62460653b2 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/buffer/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/buffer/name.js @@ -17,13 +17,11 @@ var descriptor = Object.getOwnPropertyDescriptor( DataView.prototype, 'buffer' ); -assert.sameValue( - descriptor.get.name, 'get buffer', - 'The value of `descriptor.get.name` is `"get buffer"`' -); - -verifyNotEnumerable(descriptor.get, 'name'); -verifyNotWritable(descriptor.get, 'name'); -verifyConfigurable(descriptor.get, 'name'); +verifyProperty(descriptor.get, "name", { + value: "get buffer", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/byteLength/length.js b/js/src/tests/test262/built-ins/DataView/prototype/byteLength/length.js index 85dd54adcf..94a56f8fb4 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/byteLength/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/byteLength/length.js @@ -24,10 +24,11 @@ includes: [propertyHelper.js] var desc = Object.getOwnPropertyDescriptor(DataView.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/DataView/prototype/byteLength/name.js b/js/src/tests/test262/built-ins/DataView/prototype/byteLength/name.js index b437bd7173..5dee2ae780 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/byteLength/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/byteLength/name.js @@ -17,13 +17,11 @@ var descriptor = Object.getOwnPropertyDescriptor( DataView.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/DataView/prototype/byteOffset/length.js b/js/src/tests/test262/built-ins/DataView/prototype/byteOffset/length.js index 6565d89280..b6ed091883 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/byteOffset/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/byteOffset/length.js @@ -24,10 +24,11 @@ includes: [propertyHelper.js] var desc = Object.getOwnPropertyDescriptor(DataView.prototype, "byteOffset"); -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/DataView/prototype/byteOffset/name.js b/js/src/tests/test262/built-ins/DataView/prototype/byteOffset/name.js index e77dc91d09..f4e24e3bc3 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/byteOffset/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/byteOffset/name.js @@ -17,13 +17,11 @@ var descriptor = Object.getOwnPropertyDescriptor( DataView.prototype, 'byteOffset' ); -assert.sameValue( - descriptor.get.name, 'get byteOffset', - 'The value of `descriptor.get.name` is `"get byteOffset"`' -); - -verifyNotEnumerable(descriptor.get, 'name'); -verifyNotWritable(descriptor.get, 'name'); -verifyConfigurable(descriptor.get, 'name'); +verifyProperty(descriptor.get, "name", { + value: "get byteOffset", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getBigInt64/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/getBigInt64/not-a-constructor.js index 20cb228a77..d6a83eb7fd 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getBigInt64/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getBigInt64/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.getBigInt64(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getBigInt64(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getBigUint64/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/getBigUint64/not-a-constructor.js index c9a26de1fa..d310d4ea5c 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getBigUint64/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getBigUint64/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.getBigUint64(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getBigUint64(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/browser.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/detached-buffer-after-toindex-byteoffset.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/detached-buffer-after-toindex-byteoffset.js new file mode 100644 index 0000000000..58d6f5547b --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/detached-buffer-after-toindex-byteoffset.js @@ -0,0 +1,26 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: > + Detached buffer is only checked after ToIndex(requestIndex) +features: [Float16Array] +includes: [detachArrayBuffer.js] +---*/ + +var buffer = new ArrayBuffer(6); +var sample = new DataView(buffer, 0); + +$DETACHBUFFER(buffer); + +assert.throws(RangeError, function() { + sample.getFloat16(-1); +}); + +assert.throws(RangeError, function() { + sample.getFloat16(Infinity); +}, "Infinity"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/detached-buffer-before-outofrange-byteoffset.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/detached-buffer-before-outofrange-byteoffset.js new file mode 100644 index 0000000000..07c76080e1 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/detached-buffer-before-outofrange-byteoffset.js @@ -0,0 +1,24 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: > + Detached buffer is checked before out of range byteOffset's value +features: [Float16Array] +includes: [detachArrayBuffer.js] +---*/ + +var sample; +var buffer = new ArrayBuffer(12); + +sample = new DataView(buffer, 0); + +$DETACHBUFFER(buffer); + +assert.throws(TypeError, function() { + sample.getFloat16(13); +}, "13"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/detached-buffer.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/detached-buffer.js new file mode 100644 index 0000000000..f7c59cb29c --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/detached-buffer.js @@ -0,0 +1,21 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: > + Throws a TypeError if buffer is detached +features: [Float16Array] +includes: [detachArrayBuffer.js] +---*/ + +var buffer = new ArrayBuffer(1); +var sample = new DataView(buffer, 0); + +$DETACHBUFFER(buffer); +assert.throws(TypeError, function() { + sample.getFloat16(0); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/index-is-out-of-range.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/index-is-out-of-range.js new file mode 100644 index 0000000000..7781bde810 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/index-is-out-of-range.js @@ -0,0 +1,63 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: > + Throws a RangeError if getIndex + elementSize > viewSize +features: [Float16Array] +---*/ + +var sample; +var buffer = new ArrayBuffer(12); + +sample = new DataView(buffer, 0); + +assert.throws(RangeError, function() { + sample.getFloat16(Infinity); +}, "getIndex == Infinity"); + +assert.throws(RangeError, function() { + sample.getFloat16(13); +}, "13 + 2 > 12"); + +assert.throws(RangeError, function() { + sample.getFloat16(12); +}, "12 + 2 > 12"); + +assert.throws(RangeError, function() { + sample.getFloat16(11); +}, "11 + 2 > 12"); + +sample = new DataView(buffer, 10); +assert.throws(RangeError, function() { + sample.getFloat16(1); +}, "1 + 2 > 2 (offset)"); + +sample = new DataView(buffer, 11); +assert.throws(RangeError, function() { + sample.getFloat16(0); +}, "0 + 2 > 1 (offset)"); + +sample = new DataView(buffer, 0, 2); +assert.throws(RangeError, function() { + sample.getFloat16(1); +}, "1 + 2 > 2 (length)"); + +sample = new DataView(buffer, 0, 1); +assert.throws(RangeError, function() { + sample.getFloat16(0); +}, "0 + 2 > 1 (length)"); + +sample = new DataView(buffer, 4, 2); +assert.throws(RangeError, function() { + sample.getFloat16(1); +}, "1 + 2 > 2 (offset+length)"); + +sample = new DataView(buffer, 4, 1); +assert.throws(RangeError, function() { + sample.getFloat16(0); +}, "0 + 2 > 1 (offset+length)"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/length.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/length.js new file mode 100644 index 0000000000..bd71c6cbda --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/length.js @@ -0,0 +1,20 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: > + DataView.prototype.getFloat16.length is 1. +features: [Float16Array] +includes: [propertyHelper.js] +---*/ + +verifyProperty(DataView.prototype.getFloat16, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/minus-zero.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/minus-zero.js new file mode 100644 index 0000000000..2279538fd7 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/minus-zero.js @@ -0,0 +1,21 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: > + Return -0 +features: [Float16Array] +---*/ + +var buffer = new ArrayBuffer(8); +var sample = new DataView(buffer, 0); + +sample.setUint8(0, 128); +sample.setUint8(1, 0); + +var result = sample.getFloat16(0); +assert.sameValue(result, -0); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/name.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/name.js new file mode 100644 index 0000000000..df100772a9 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/name.js @@ -0,0 +1,20 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: > + DataView.prototype.getFloat16.name is "getFloat16". +features: [Float16Array] +includes: [propertyHelper.js] +---*/ + +verifyProperty(DataView.prototype.getFloat16, "name", { + value: "getFloat16", + writable: false, + enumerable: false, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/negative-byteoffset-throws.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/negative-byteoffset-throws.js new file mode 100644 index 0000000000..ada6286fd5 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/negative-byteoffset-throws.js @@ -0,0 +1,23 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: > + Throws a RangeError if ToInteger(byteOffset) < 0 +features: [Float16Array] +---*/ + +var buffer = new ArrayBuffer(12); +var sample = new DataView(buffer, 0); + +assert.throws(RangeError, function() { + sample.getFloat16(-1); +}, "-1"); + +assert.throws(RangeError, function() { + sample.getFloat16(-Infinity); +}, "-Infinity"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/not-a-constructor.js new file mode 100644 index 0000000000..af811a5e30 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/not-a-constructor.js @@ -0,0 +1,24 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.getFloat16 does not implement [[Construct]], is not new-able +includes: [isConstructor.js] +features: [Float16Array, Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.getFloat16), + false, + 'isConstructor(DataView.prototype.getFloat16) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.getFloat16(0, 0); +}); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/resizable-buffer.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/resizable-buffer.js new file mode 100644 index 0000000000..ef1bbcdb4e --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/resizable-buffer.js @@ -0,0 +1,44 @@ +// |reftest| shell-option(--enable-arraybuffer-resizable) shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- Float16Array,resizable-arraybuffer is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-dataview.prototype.getfloat16 +description: Throws a TypeError if buffer is out-of-bounds +features: [Float16Array, DataView, ArrayBuffer, resizable-arraybuffer] +---*/ + +assert.sameValue( + typeof ArrayBuffer.prototype.resize, + 'function', + 'implements ArrayBuffer.prototype.resize' +); + +var buffer = new ArrayBuffer(24, {maxByteLength: 32}); +var sample = new DataView(buffer, 0, 16); + +try { + buffer.resize(32); +} catch (_) {} + +assert.sameValue(sample.getFloat16(0), 0, 'following grow'); + +try { + buffer.resize(16); +} catch (_) {} + +assert.sameValue(sample.getFloat16(0), 0, 'following shrink (within bounds)'); + +var expectedError; +try { + buffer.resize(8); + expectedError = TypeError; +} catch (_) { + expectedError = Test262Error; +} + +assert.throws(expectedError, function() { + sample.getFloat16(0); + throw new Test262Error('the operation completed successfully'); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-abrupt-from-tonumber-byteoffset-symbol.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-abrupt-from-tonumber-byteoffset-symbol.js new file mode 100644 index 0000000000..1643b832b4 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-abrupt-from-tonumber-byteoffset-symbol.js @@ -0,0 +1,21 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: > + Return abrupt from ToNumber(symbol byteOffset) +features: [Float16Array, Symbol] +---*/ + +var buffer = new ArrayBuffer(1); +var sample = new DataView(buffer, 0); + +var s = Symbol("1"); + +assert.throws(TypeError, function() { + sample.getFloat16(s); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-abrupt-from-tonumber-byteoffset.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-abrupt-from-tonumber-byteoffset.js new file mode 100644 index 0000000000..1c5088df49 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-abrupt-from-tonumber-byteoffset.js @@ -0,0 +1,35 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: > + Return abrupt from ToNumber(byteOffset) +features: [Float16Array] +---*/ + +var buffer = new ArrayBuffer(1); +var sample = new DataView(buffer, 0); + +var bo1 = { + valueOf: function() { + throw new Test262Error(); + } +}; + +var bo2 = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + sample.getFloat16(bo1); +}, "valueOf"); + +assert.throws(Test262Error, function() { + sample.getFloat16(bo2); +}, "toString"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-infinity.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-infinity.js new file mode 100644 index 0000000000..26c0fcecd8 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-infinity.js @@ -0,0 +1,23 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: > + Return Infinity values +features: [Float16Array, DataView.prototype.setUint8] +---*/ + +var buffer = new ArrayBuffer(4); +var sample = new DataView(buffer, 0); + +sample.setUint8(0, 124); // 0b01111100 +sample.setUint8(1, 0); +sample.setUint8(2, 252); // 0b11111100 +sample.setUint8(3, 0); + +assert.sameValue(sample.getFloat16(0), Infinity); +assert.sameValue(sample.getFloat16(2), -Infinity); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-nan.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-nan.js new file mode 100644 index 0000000000..56af38b203 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-nan.js @@ -0,0 +1,23 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: > + Return NaN values +features: [Float16Array, DataView.prototype.setUint8] +---*/ + +var buffer = new ArrayBuffer(8); +var sample = new DataView(buffer, 0); + +sample.setUint8(0, 126); // 0b01111110 +sample.setUint8(1, 0); +sample.setUint8(2, 254); // 0b11111110 +sample.setUint8(3, 0); + +assert.sameValue(sample.getFloat16(0), NaN); +assert.sameValue(sample.getFloat16(2), NaN); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-value-clean-arraybuffer.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-value-clean-arraybuffer.js new file mode 100644 index 0000000000..bf8b2b0685 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-value-clean-arraybuffer.js @@ -0,0 +1,26 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: > + Return value from Buffer using a clean ArrayBuffer +features: [Float16Array] +---*/ + +var buffer = new ArrayBuffer(8); +var sample = new DataView(buffer, 0); + +assert.sameValue(sample.getFloat16(0, true), 0, "sample.getFloat16(0, true)"); +assert.sameValue(sample.getFloat16(1, true), 0, "sample.getFloat16(1, true)"); +assert.sameValue(sample.getFloat16(2, true), 0, "sample.getFloat16(2, true)"); +assert.sameValue(sample.getFloat16(3, true), 0, "sample.getFloat16(3, true)"); +assert.sameValue(sample.getFloat16(4, true), 0, "sample.getFloat16(4, true)"); +assert.sameValue(sample.getFloat16(0, false), 0, "sample.getFloat16(0, false)"); +assert.sameValue(sample.getFloat16(1, false), 0, "sample.getFloat16(1, false)"); +assert.sameValue(sample.getFloat16(2, false), 0, "sample.getFloat16(2, false)"); +assert.sameValue(sample.getFloat16(3, false), 0, "sample.getFloat16(3, false)"); +assert.sameValue(sample.getFloat16(4, false), 0, "sample.getFloat16(4, false)"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-values-custom-offset.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-values-custom-offset.js new file mode 100644 index 0000000000..c121bd316c --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-values-custom-offset.js @@ -0,0 +1,29 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: > + Return values from Buffer using a custom offset +features: [Float16Array, DataView.prototype.setUint8] +---*/ + +var buffer = new ArrayBuffer(8); +var sample = new DataView(buffer, 0); + +sample.setUint8(4, 75); // 01001011 +sample.setUint8(5, 75); // 01001011 +sample.setUint8(6, 76); // 01001100 +sample.setUint8(7, 77); // 01001101 + +sample = new DataView(buffer, 4); + +assert.sameValue(sample.getFloat16(0, false), 14.5859375, "0, false"); // 01001011 01001011 +assert.sameValue(sample.getFloat16(1, false), 14.59375, "1, false"); // 01001011 01001100 +assert.sameValue(sample.getFloat16(2, false), 17.203125, "2, false"); // 01001100 01001101 +assert.sameValue(sample.getFloat16(0, true), 14.5859375, "0, true"); // 01001011 01001011 +assert.sameValue(sample.getFloat16(1, true), 17.171875, "1, true"); // 01001100 01001011 +assert.sameValue(sample.getFloat16(2, true), 21.1875, "2, true"); // 01001101 01001100 + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-values.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-values.js new file mode 100644 index 0000000000..51b3b874cd --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/return-values.js @@ -0,0 +1,40 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: > + Return values from Buffer +features: [Float16Array, DataView.prototype.setUint8] +---*/ + +var buffer = new ArrayBuffer(4); +var sample = new DataView(buffer, 0); + +sample.setUint8(0, 66); // 01000010 +sample.setUint8(1, 40); // 00101000 +sample.setUint8(2, 64); // 01000000 +sample.setUint8(3, 224); // 11100000 + +assert.sameValue(sample.getFloat16(0, false), 3.078125, "0, false"); // 01000010 00101000 +assert.sameValue(sample.getFloat16(1, false), 0.033203125, "1, false"); // 00101000 01000000 +assert.sameValue(sample.getFloat16(2, false), 2.4375, "2, false"); // 01000000 11100000 + +assert.sameValue(sample.getFloat16(0, true), 0.03326416015625, "0, true"); // 00101000 01000010 +assert.sameValue(sample.getFloat16(1, true), 2.078125, "1, true"); // 01000000 00101000 +assert.sameValue(sample.getFloat16(2, true), -544, "2, true"); // 11100000 01000000 + +sample.setUint8(0, 75); // 01001011 +sample.setUint8(1, 75); // 01001011 +sample.setUint8(2, 76); // 01001100 +sample.setUint8(3, 76); // 01001101 + +assert.sameValue(sample.getFloat16(0, false), 14.5859375, "0, false"); // 01001011 01001011 +assert.sameValue(sample.getFloat16(1, false), 14.59375, "1, false"); // 01001011 01001100 +assert.sameValue(sample.getFloat16(2, false), 17.1875, "2, false"); // 01001100 01001101 +assert.sameValue(sample.getFloat16(0, true), 14.5859375, "0, true"); // 01001011 01001011 +assert.sameValue(sample.getFloat16(1, true), 17.171875, "1, true"); // 01001100 01001011 +assert.sameValue(sample.getFloat16(2, true), 17.1875, "2, true"); // 01001100 01001101 + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/shell.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/this-has-no-dataview-internal.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/this-has-no-dataview-internal.js new file mode 100644 index 0000000000..3b77b7f5b7 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/this-has-no-dataview-internal.js @@ -0,0 +1,32 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: > + Throws a TypeError if this does not have a [[DataView]] internal slot +features: [Float16Array, Int8Array] +---*/ + +var getFloat16 = DataView.prototype.getFloat16; + +assert.throws(TypeError, function() { + getFloat16.call({}); +}, "{}"); + +assert.throws(TypeError, function() { + getFloat16.call([]); +}, "[]"); + +var ab = new ArrayBuffer(1); +assert.throws(TypeError, function() { + getFloat16.call(ab); +}, "ArrayBuffer"); + +var ta = new Int8Array(); +assert.throws(TypeError, function() { + getFloat16.call(ta); +}, "TypedArray"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/this-is-not-object.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/this-is-not-object.js new file mode 100644 index 0000000000..917dc61dc8 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/this-is-not-object.js @@ -0,0 +1,42 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: Throws a TypeError if this is not Object +features: [Float16Array, Symbol] +---*/ + +var getFloat16 = DataView.prototype.getFloat16; + +assert.throws(TypeError, function() { + getFloat16.call(undefined); +}, "undefined"); + +assert.throws(TypeError, function() { + getFloat16.call(null); +}, "null"); + +assert.throws(TypeError, function() { + getFloat16.call(1); +}, "1"); + +assert.throws(TypeError, function() { + getFloat16.call("string"); +}, "string"); + +assert.throws(TypeError, function() { + getFloat16.call(true); +}, "true"); + +assert.throws(TypeError, function() { + getFloat16.call(false); +}, "false"); + +var s = Symbol("1"); +assert.throws(TypeError, function() { + getFloat16.call(s); +}, "symbol"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/to-boolean-littleendian.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/to-boolean-littleendian.js new file mode 100644 index 0000000000..793f95477c --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/to-boolean-littleendian.js @@ -0,0 +1,31 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getfloat16 +description: > + Boolean littleEndian argument coerced in ToBoolean +features: [Float16Array, DataView.prototype.setUint8, Symbol] +---*/ + +var buffer = new ArrayBuffer(2); +var sample = new DataView(buffer, 0); + +sample.setUint8(0, 75); +sample.setUint8(1, 76); + +// False +assert.sameValue(sample.getFloat16(0), 14.59375, "no arg"); +assert.sameValue(sample.getFloat16(0, undefined), 14.59375, "undefined"); +assert.sameValue(sample.getFloat16(0, null), 14.59375, "null"); +assert.sameValue(sample.getFloat16(0, 0), 14.59375, "0"); +assert.sameValue(sample.getFloat16(0, ""), 14.59375, "the empty string"); + +// True +assert.sameValue(sample.getFloat16(0, {}), 17.171875, "{}"); +assert.sameValue(sample.getFloat16(0, Symbol("1")), 17.171875, "symbol"); +assert.sameValue(sample.getFloat16(0, 1), 17.171875, "1"); +assert.sameValue(sample.getFloat16(0, "string"), 17.171875, "string"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/toindex-byteoffset.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/toindex-byteoffset.js new file mode 100644 index 0000000000..ae51364d35 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat16/toindex-byteoffset.js @@ -0,0 +1,53 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.getFloat16 +description: > + ToIndex conversions on byteOffset +features: [Float16Array, DataView.prototype.setUint8] +---*/ + +var buffer = new ArrayBuffer(6); +var sample = new DataView(buffer, 0); + +sample.setUint8(0, 75); +sample.setUint8(1, 76); +sample.setUint8(2, 77); +sample.setUint8(3, 78); +sample.setUint8(4, 79); +sample.setUint8(5, 80); + +var obj1 = { + valueOf: function() { + return 3; + } +}; + +var obj2 = { + toString: function() { + return 2; + } +}; + +assert.sameValue(sample.getFloat16(-0), 14.59375, "-0"); +assert.sameValue(sample.getFloat16(obj1), 25.234375, "object's valueOf"); +assert.sameValue(sample.getFloat16(obj2), 21.21875, "object's toString"); +assert.sameValue(sample.getFloat16(""), 14.59375, "the Empty string"); +assert.sameValue(sample.getFloat16("0"), 14.59375, "string '0'"); +assert.sameValue(sample.getFloat16("2"), 21.21875, "string '2'"); +assert.sameValue(sample.getFloat16(true), 17.203125, "true"); +assert.sameValue(sample.getFloat16(false), 14.59375, "false"); +assert.sameValue(sample.getFloat16(NaN), 14.59375, "NaN"); +assert.sameValue(sample.getFloat16(null), 14.59375, "null"); +assert.sameValue(sample.getFloat16(0.1), 14.59375, "0.1"); +assert.sameValue(sample.getFloat16(0.9), 14.59375, "0.9"); +assert.sameValue(sample.getFloat16(1.1), 17.203125, "1.1"); +assert.sameValue(sample.getFloat16(1.9), 17.203125, "1.9"); +assert.sameValue(sample.getFloat16(-0.1), 14.59375, "-0.1"); +assert.sameValue(sample.getFloat16(-0.99999), 14.59375, "-0.99999"); +assert.sameValue(sample.getFloat16(undefined), 14.59375, "undefined"); +assert.sameValue(sample.getFloat16(), 14.59375, "no arg"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat32/length.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat32/length.js index 8f1256a67b..c05fb88469 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getFloat32/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat32/length.js @@ -23,10 +23,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.getFloat32.length, 1); - -verifyNotEnumerable(DataView.prototype.getFloat32, "length"); -verifyNotWritable(DataView.prototype.getFloat32, "length"); -verifyConfigurable(DataView.prototype.getFloat32, "length"); +verifyProperty(DataView.prototype.getFloat32, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat32/name.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat32/name.js index 26e5b6d3e0..1feabf5047 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getFloat32/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat32/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.getFloat32.name, "getFloat32"); - -verifyNotEnumerable(DataView.prototype.getFloat32, "name"); -verifyNotWritable(DataView.prototype.getFloat32, "name"); -verifyConfigurable(DataView.prototype.getFloat32, "name"); +verifyProperty(DataView.prototype.getFloat32, "name", { + value: "getFloat32", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat32/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat32/not-a-constructor.js index 628d35ed6d..cb2eef1326 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getFloat32/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat32/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.getFloat32(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getFloat32(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat64/length.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat64/length.js index 3a2a4d7fcf..d8082606bc 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getFloat64/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat64/length.js @@ -23,10 +23,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.getFloat64.length, 1); - -verifyNotEnumerable(DataView.prototype.getFloat64, "length"); -verifyNotWritable(DataView.prototype.getFloat64, "length"); -verifyConfigurable(DataView.prototype.getFloat64, "length"); +verifyProperty(DataView.prototype.getFloat64, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat64/name.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat64/name.js index 2ae4d6ebae..020a27ccbc 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getFloat64/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat64/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.getFloat64.name, "getFloat64"); - -verifyNotEnumerable(DataView.prototype.getFloat64, "name"); -verifyNotWritable(DataView.prototype.getFloat64, "name"); -verifyConfigurable(DataView.prototype.getFloat64, "name"); +verifyProperty(DataView.prototype.getFloat64, "name", { + value: "getFloat64", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getFloat64/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/getFloat64/not-a-constructor.js index 551e9935fa..1bdeebec4a 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getFloat64/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getFloat64/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.getFloat64(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getFloat64(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getInt16/length.js b/js/src/tests/test262/built-ins/DataView/prototype/getInt16/length.js index c3b2db9ee3..493574f48d 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getInt16/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getInt16/length.js @@ -23,10 +23,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.getInt16.length, 1); - -verifyNotEnumerable(DataView.prototype.getInt16, "length"); -verifyNotWritable(DataView.prototype.getInt16, "length"); -verifyConfigurable(DataView.prototype.getInt16, "length"); +verifyProperty(DataView.prototype.getInt16, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getInt16/name.js b/js/src/tests/test262/built-ins/DataView/prototype/getInt16/name.js index 933b5b3ddf..c054c266cc 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getInt16/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getInt16/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.getInt16.name, "getInt16"); - -verifyNotEnumerable(DataView.prototype.getInt16, "name"); -verifyNotWritable(DataView.prototype.getInt16, "name"); -verifyConfigurable(DataView.prototype.getInt16, "name"); +verifyProperty(DataView.prototype.getInt16, "name", { + value: "getInt16", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getInt16/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/getInt16/not-a-constructor.js index f4a3a72970..3e720ea085 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getInt16/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getInt16/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.getInt16(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getInt16(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getInt32/length.js b/js/src/tests/test262/built-ins/DataView/prototype/getInt32/length.js index 746487b54a..7482320415 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getInt32/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getInt32/length.js @@ -23,10 +23,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.getInt32.length, 1); - -verifyNotEnumerable(DataView.prototype.getInt32, "length"); -verifyNotWritable(DataView.prototype.getInt32, "length"); -verifyConfigurable(DataView.prototype.getInt32, "length"); +verifyProperty(DataView.prototype.getInt32, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getInt32/name.js b/js/src/tests/test262/built-ins/DataView/prototype/getInt32/name.js index 7c44bd6960..48b4d515e2 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getInt32/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getInt32/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.getInt32.name, "getInt32"); - -verifyNotEnumerable(DataView.prototype.getInt32, "name"); -verifyNotWritable(DataView.prototype.getInt32, "name"); -verifyConfigurable(DataView.prototype.getInt32, "name"); +verifyProperty(DataView.prototype.getInt32, "name", { + value: "getInt32", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getInt32/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/getInt32/not-a-constructor.js index 2e987dc405..6710a816dd 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getInt32/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getInt32/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.getInt32(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getInt32(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getInt8/length.js b/js/src/tests/test262/built-ins/DataView/prototype/getInt8/length.js index 7ad4e7999c..b9ec2cc2dd 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getInt8/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getInt8/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.getInt8.length, 1); - -verifyNotEnumerable(DataView.prototype.getInt8, "length"); -verifyNotWritable(DataView.prototype.getInt8, "length"); -verifyConfigurable(DataView.prototype.getInt8, "length"); +verifyProperty(DataView.prototype.getInt8, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getInt8/name.js b/js/src/tests/test262/built-ins/DataView/prototype/getInt8/name.js index 4e56fcf221..e56be1d203 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getInt8/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getInt8/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.getInt8.name, "getInt8"); - -verifyNotEnumerable(DataView.prototype.getInt8, "name"); -verifyNotWritable(DataView.prototype.getInt8, "name"); -verifyConfigurable(DataView.prototype.getInt8, "name"); +verifyProperty(DataView.prototype.getInt8, "name", { + value: "getInt8", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getInt8/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/getInt8/not-a-constructor.js index 8acdd1a409..48e5a88efe 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getInt8/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getInt8/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.getInt8(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getInt8(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getUint16/length.js b/js/src/tests/test262/built-ins/DataView/prototype/getUint16/length.js index 3403612bf9..19633b33fe 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getUint16/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getUint16/length.js @@ -23,10 +23,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.getUint16.length, 1); - -verifyNotEnumerable(DataView.prototype.getUint16, "length"); -verifyNotWritable(DataView.prototype.getUint16, "length"); -verifyConfigurable(DataView.prototype.getUint16, "length"); +verifyProperty(DataView.prototype.getUint16, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getUint16/name.js b/js/src/tests/test262/built-ins/DataView/prototype/getUint16/name.js index 3c39801e23..54cfb46a1d 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getUint16/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getUint16/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.getUint16.name, "getUint16"); - -verifyNotEnumerable(DataView.prototype.getUint16, "name"); -verifyNotWritable(DataView.prototype.getUint16, "name"); -verifyConfigurable(DataView.prototype.getUint16, "name"); +verifyProperty(DataView.prototype.getUint16, "name", { + value: "getUint16", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getUint16/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/getUint16/not-a-constructor.js index c56587ca00..06c27fb236 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getUint16/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getUint16/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.getUint16(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getUint16(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getUint32/length.js b/js/src/tests/test262/built-ins/DataView/prototype/getUint32/length.js index 5ca99f56e8..544ffc4536 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getUint32/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getUint32/length.js @@ -23,10 +23,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.getUint32.length, 1); - -verifyNotEnumerable(DataView.prototype.getUint32, "length"); -verifyNotWritable(DataView.prototype.getUint32, "length"); -verifyConfigurable(DataView.prototype.getUint32, "length"); +verifyProperty(DataView.prototype.getUint32, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getUint32/name.js b/js/src/tests/test262/built-ins/DataView/prototype/getUint32/name.js index 9e5f2f2a5c..259d024dc4 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getUint32/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getUint32/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.getUint32.name, "getUint32"); - -verifyNotEnumerable(DataView.prototype.getUint32, "name"); -verifyNotWritable(DataView.prototype.getUint32, "name"); -verifyConfigurable(DataView.prototype.getUint32, "name"); +verifyProperty(DataView.prototype.getUint32, "name", { + value: "getUint32", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getUint32/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/getUint32/not-a-constructor.js index 423a22224f..a3b3c483b6 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getUint32/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getUint32/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.getUint32(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getUint32(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getUint8/length.js b/js/src/tests/test262/built-ins/DataView/prototype/getUint8/length.js index aaa458a70e..fd67db7453 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getUint8/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getUint8/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.getUint8.length, 1); - -verifyNotEnumerable(DataView.prototype.getUint8, "length"); -verifyNotWritable(DataView.prototype.getUint8, "length"); -verifyConfigurable(DataView.prototype.getUint8, "length"); +verifyProperty(DataView.prototype.getUint8, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getUint8/name.js b/js/src/tests/test262/built-ins/DataView/prototype/getUint8/name.js index 071782c08f..1fd1de4e03 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getUint8/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getUint8/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.getUint8.name, "getUint8"); - -verifyNotEnumerable(DataView.prototype.getUint8, "name"); -verifyNotWritable(DataView.prototype.getUint8, "name"); -verifyConfigurable(DataView.prototype.getUint8, "name"); +verifyProperty(DataView.prototype.getUint8, "name", { + value: "getUint8", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/getUint8/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/getUint8/not-a-constructor.js index 63c22bc84a..ff3afe1647 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/getUint8/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/getUint8/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.getUint8(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.getUint8(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setBigInt64/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/setBigInt64/not-a-constructor.js index 3d57145553..ee47e8ebb7 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setBigInt64/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setBigInt64/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.setBigInt64(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setBigInt64(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setBigUint64/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/setBigUint64/not-a-constructor.js index 393dab357e..1e07e42d5e 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setBigUint64/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setBigUint64/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.setBigUint64(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setBigUint64(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/browser.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/detached-buffer-after-number-value.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/detached-buffer-after-number-value.js new file mode 100644 index 0000000000..7978099dcd --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/detached-buffer-after-number-value.js @@ -0,0 +1,27 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + Detached buffer is checked after ToNumber(value) +features: [Float16Array] +includes: [detachArrayBuffer.js] +---*/ + +var buffer = new ArrayBuffer(8); +var sample = new DataView(buffer, 0); + +var v = { + valueOf: function() { + throw new Test262Error(); + } +}; + +$DETACHBUFFER(buffer); +assert.throws(Test262Error, function() { + sample.setFloat16(0, v); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/detached-buffer-after-toindex-byteoffset.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/detached-buffer-after-toindex-byteoffset.js new file mode 100644 index 0000000000..864850f787 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/detached-buffer-after-toindex-byteoffset.js @@ -0,0 +1,26 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + Detached buffer is only checked after ToIndex(requestIndex) +features: [Float16Array] +includes: [detachArrayBuffer.js] +---*/ + +var buffer = new ArrayBuffer(8); +var sample = new DataView(buffer, 0); + +$DETACHBUFFER(buffer); + +assert.throws(RangeError, function() { + sample.setFloat16(Infinity, 0); +}, "Infinity"); + +assert.throws(RangeError, function() { + sample.setFloat16(-1, 0); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/detached-buffer-before-outofrange-byteoffset.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/detached-buffer-before-outofrange-byteoffset.js new file mode 100644 index 0000000000..1d9d289e63 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/detached-buffer-before-outofrange-byteoffset.js @@ -0,0 +1,24 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + Detached buffer is checked before out of range byteOffset's value +features: [Float16Array] +includes: [detachArrayBuffer.js] +---*/ + +var sample; +var buffer = new ArrayBuffer(12); + +sample = new DataView(buffer, 0); + +$DETACHBUFFER(buffer); + +assert.throws(TypeError, function() { + sample.setFloat16(13, 0); +}, "13"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/detached-buffer.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/detached-buffer.js new file mode 100644 index 0000000000..11e71b7cb8 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/detached-buffer.js @@ -0,0 +1,21 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + Throws a TypeError if buffer is detached +features: [Float16Array] +includes: [detachArrayBuffer.js] +---*/ + +var buffer = new ArrayBuffer(1); +var sample = new DataView(buffer, 0); + +$DETACHBUFFER(buffer); +assert.throws(TypeError, function() { + sample.setFloat16(0, 0); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/index-check-before-value-conversion.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/index-check-before-value-conversion.js new file mode 100644 index 0000000000..e1b2b18b35 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/index-check-before-value-conversion.js @@ -0,0 +1,36 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + RangeError exception for negative index is thrown before the value conversion. +features: [Float16Array] +---*/ + +var dataView = new DataView(new ArrayBuffer(8), 0); + +var poisoned = { + valueOf: function() { + throw new Test262Error("valueOf called"); + } +}; + +assert.throws(RangeError, function() { + dataView.setFloat16(-1.5, poisoned); +}, "setFloat16(-1.5, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setFloat16(-1, poisoned); +}, "setFloat16(-1, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setFloat16(-Infinity, poisoned); +}, "setFloat16(-Infinity, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setFloat16(Infinity, poisoned); +}, "setFloat16(Infinity, poisoned)"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/index-is-out-of-range.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/index-is-out-of-range.js new file mode 100644 index 0000000000..11f0e02a03 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/index-is-out-of-range.js @@ -0,0 +1,71 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + Throws a RangeError if getIndex + elementSize > viewSize +features: [Float16Array] +---*/ + +var sample; +var buffer = new ArrayBuffer(12); + +sample = new DataView(buffer, 0); + +assert.throws(RangeError, function() { + sample.setFloat16(Infinity, 39); +}, "getIndex == Infinity"); + +assert.throws(RangeError, function() { + sample.setFloat16(13, 39); +}, "13 + 2 > 12"); + +assert.throws(RangeError, function() { + sample.setFloat16(12, 39); +}, "12 + 2 > 12"); + +assert.throws(RangeError, function() { + sample.setFloat16(11, 39); +}, "11 + 2 > 12"); + +sample = new DataView(buffer, 10); +assert.throws(RangeError, function() { + sample.setFloat16(1, 39); +}, "1 + 2 > 2 (offset)"); + +sample = new DataView(buffer, 11); +assert.throws(RangeError, function() { + sample.setFloat16(0, 39); +}, "0 + 2 > 1 (offset)"); + +sample = new DataView(buffer, 0, 2); +assert.throws(RangeError, function() { + sample.setFloat16(1, 39); +}, "1 + 2 > 2 (length)"); + +sample = new DataView(buffer, 0, 1); +assert.throws(RangeError, function() { + sample.setFloat16(0, 39); +}, "0 + 2 > 1 (length)"); + +sample = new DataView(buffer, 4, 2); +assert.throws(RangeError, function() { + sample.setFloat16(1, 39); +}, "1 + 2 > 2 (offset+length)"); + +sample = new DataView(buffer, 4, 1); +assert.throws(RangeError, function() { + sample.setFloat16(0, 39); +}, "0 + 2 > 1 (offset+length)"); + +sample = new DataView(buffer, 0); +assert.sameValue(sample.getFloat16(0), 0, "[0] no value was set"); +assert.sameValue(sample.getFloat16(2), 0, "[1] no value was set"); +assert.sameValue(sample.getFloat16(4), 0, "[2] no value was set"); +assert.sameValue(sample.getFloat16(6), 0, "[3] no value was set"); +assert.sameValue(sample.getFloat16(8), 0, "[4] no value was set"); +assert.sameValue(sample.getFloat16(10), 0, "[5] no value was set"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/length.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/length.js new file mode 100644 index 0000000000..d6e2809511 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/length.js @@ -0,0 +1,20 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + DataView.prototype.setFloat16.length is 2. +features: [Float16Array] +includes: [propertyHelper.js] +---*/ + +verifyProperty(DataView.prototype.setFloat16, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/name.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/name.js new file mode 100644 index 0000000000..41ef3bb195 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/name.js @@ -0,0 +1,20 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + DataView.prototype.setFloat16.name is "setFloat16". +features: [Float16Array] +includes: [propertyHelper.js] +---*/ + +verifyProperty(DataView.prototype.setFloat16, "name", { + value: "setFloat16", + writable: false, + enumerable: false, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/negative-byteoffset-throws.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/negative-byteoffset-throws.js new file mode 100644 index 0000000000..84722723ad --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/negative-byteoffset-throws.js @@ -0,0 +1,25 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + Throws a RangeError if getIndex < 0 +features: [Float16Array] +---*/ + +var buffer = new ArrayBuffer(12); +var sample = new DataView(buffer, 0); + +assert.throws(RangeError, function() { + sample.setFloat16(-1, 39); +}, "-1"); +assert.sameValue(sample.getFloat32(0), 0, "-1 - no value was set"); + +assert.throws(RangeError, function() { + sample.setFloat16(-Infinity, 39); +}, "-Infinity"); +assert.sameValue(sample.getFloat32(0), 0, "-Infinity - no value was set"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/no-value-arg.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/no-value-arg.js new file mode 100644 index 0000000000..75f634b0a9 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/no-value-arg.js @@ -0,0 +1,20 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + Set value as undefined (cast to NaN) when value argument is not present +features: [Float16Array] +---*/ + +var buffer = new ArrayBuffer(8); +var sample = new DataView(buffer, 0); + +var result = sample.setFloat16(0); + +assert.sameValue(sample.getFloat16(0), NaN); +assert.sameValue(result, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/not-a-constructor.js new file mode 100644 index 0000000000..549f33ba39 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/not-a-constructor.js @@ -0,0 +1,24 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + DataView.prototype.setFloat16 does not implement [[Construct]], is not new-able +includes: [isConstructor.js] +features: [Float16Array, Reflect.construct, DataView, arrow-function, ArrayBuffer] +---*/ + +assert.sameValue( + isConstructor(DataView.prototype.setFloat16), + false, + 'isConstructor(DataView.prototype.setFloat16) must return false' +); + +assert.throws(TypeError, () => { + let dv = new DataView(new ArrayBuffer(16)); new dv.setFloat16(0, 0); +}); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/range-check-after-value-conversion.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/range-check-after-value-conversion.js new file mode 100644 index 0000000000..04e87fc18c --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/range-check-after-value-conversion.js @@ -0,0 +1,28 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setFloat16 +description: > + Index bounds checks are performed after value conversion. +features: [Float16Array] +---*/ + +var dataView = new DataView(new ArrayBuffer(8), 0); + +var poisoned = { + valueOf: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + dataView.setFloat16(100, poisoned); +}, "setFloat16(100, poisoned)"); + +assert.throws(Test262Error, function() { + dataView.setFloat16('100', poisoned); +}, "setFloat16('100', poisoned)"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/resizable-buffer.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/resizable-buffer.js new file mode 100644 index 0000000000..17b09d9b13 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/resizable-buffer.js @@ -0,0 +1,44 @@ +// |reftest| shell-option(--enable-arraybuffer-resizable) shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- Float16Array,resizable-arraybuffer is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-dataview.prototype.setfloat16 +description: Throws a TypeError if buffer is out-of-bounds +features: [Float16Array, DataView, ArrayBuffer, resizable-arraybuffer] +---*/ + +assert.sameValue( + typeof ArrayBuffer.prototype.resize, + 'function', + 'implements ArrayBuffer.prototype.resize' +); + +var buffer = new ArrayBuffer(24, {maxByteLength: 32}); +var sample = new DataView(buffer, 0, 16); + +try { + buffer.resize(32); +} catch (_) {} + +assert.sameValue(sample.setFloat16(0, 10), undefined, 'following grow'); + +try { + buffer.resize(16); +} catch (_) {} + +assert.sameValue(sample.setFloat16(0, 20), undefined, 'following shrink (within bounds)'); + +var expectedError; +try { + buffer.resize(8); + expectedError = TypeError; +} catch (_) { + expectedError = Test262Error; +} + +assert.throws(expectedError, function() { + sample.setFloat16(0, 30); + throw new Test262Error('the operation completed successfully'); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/return-abrupt-from-tonumber-byteoffset-symbol.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/return-abrupt-from-tonumber-byteoffset-symbol.js new file mode 100644 index 0000000000..d56fea3aa5 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/return-abrupt-from-tonumber-byteoffset-symbol.js @@ -0,0 +1,21 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + Return abrupt from ToNumber(symbol byteOffset) +features: [Float16Array, Symbol] +---*/ + +var buffer = new ArrayBuffer(1); +var sample = new DataView(buffer, 0); + +var s = Symbol("1"); + +assert.throws(TypeError, function() { + sample.setFloat16(s); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/return-abrupt-from-tonumber-byteoffset.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/return-abrupt-from-tonumber-byteoffset.js new file mode 100644 index 0000000000..4c70428fc1 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/return-abrupt-from-tonumber-byteoffset.js @@ -0,0 +1,35 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + Return abrupt from ToNumber(byteOffset) +features: [Float16Array] +---*/ + +var buffer = new ArrayBuffer(1); +var sample = new DataView(buffer, 0); + +var bo1 = { + valueOf: function() { + throw new Test262Error(); + } +}; + +var bo2 = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + sample.setFloat16(bo1, 1); +}, "valueOf"); + +assert.throws(Test262Error, function() { + sample.setFloat16(bo2, 1); +}, "toString"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/return-abrupt-from-tonumber-value-symbol.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/return-abrupt-from-tonumber-value-symbol.js new file mode 100644 index 0000000000..01639d1e10 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/return-abrupt-from-tonumber-value-symbol.js @@ -0,0 +1,21 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + Return abrupt from ToNumber(symbol value) +features: [Float16Array, Symbol] +---*/ + +var buffer = new ArrayBuffer(4); +var sample = new DataView(buffer, 0); + +var s = Symbol("1"); + +assert.throws(TypeError, function() { + sample.setFloat16(0, s); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/return-abrupt-from-tonumber-value.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/return-abrupt-from-tonumber-value.js new file mode 100644 index 0000000000..802757cffc --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/return-abrupt-from-tonumber-value.js @@ -0,0 +1,35 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + Return abrupt from ToNumber(value) +features: [Float16Array] +---*/ + +var buffer = new ArrayBuffer(4); +var sample = new DataView(buffer, 0); + +var bo1 = { + valueOf: function() { + throw new Test262Error(); + } +}; + +var bo2 = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + sample.setFloat16(0, bo1); +}, "valueOf"); + +assert.throws(Test262Error, function() { + sample.setFloat16(0, bo2); +}, "toString"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/set-values-little-endian-order.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/set-values-little-endian-order.js new file mode 100644 index 0000000000..dcbdd57594 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/set-values-little-endian-order.js @@ -0,0 +1,25 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + Set values with little endian order. +features: [Float16Array] +---*/ + +var buffer = new ArrayBuffer(2); +var sample = new DataView(buffer, 0); + +var result; + +result = sample.setFloat16(0, 42, true); // 01010001 01000000 +assert.sameValue(result, undefined, "returns undefined #1"); +assert.sameValue(sample.getFloat16(0), 2.158203125); // 01000000 01010001 + +result = sample.setFloat16(0, 2.158203125, true); +assert.sameValue(result, undefined, "returns undefined #2"); +assert.sameValue(sample.getFloat16(0), 42); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/set-values-return-undefined.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/set-values-return-undefined.js new file mode 100644 index 0000000000..52212f556a --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/set-values-return-undefined.js @@ -0,0 +1,36 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + Set values and return undefined +features: [Float16Array] +includes: [byteConversionValues.js] +---*/ + +var buffer = new ArrayBuffer(2); +var sample = new DataView(buffer, 0); +var values = byteConversionValues.values; +var expectedValues = byteConversionValues.expected.Float16; + +values.forEach(function(value, i) { + var result; + var expected = expectedValues[i]; + + result = sample.setFloat16(0, value, false); + + assert.sameValue( + sample.getFloat16(0), + expected, + "value: " + value + ); + assert.sameValue( + result, + undefined, + "return is undefined, value: " + value + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/shell.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/this-has-no-dataview-internal.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/this-has-no-dataview-internal.js new file mode 100644 index 0000000000..e0d2c72daa --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/this-has-no-dataview-internal.js @@ -0,0 +1,32 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + Throws a TypeError if this does not have a [[DataView]] internal slot +features: [Float16Array, Int8Array] +---*/ + +var setFloat16 = DataView.prototype.setFloat16; + +assert.throws(TypeError, function() { + setFloat16.call({}); +}, "{}"); + +assert.throws(TypeError, function() { + setFloat16.call([]); +}, "[]"); + +var ab = new ArrayBuffer(1); +assert.throws(TypeError, function() { + setFloat16.call(ab); +}, "ArrayBuffer"); + +var ta = new Int8Array(); +assert.throws(TypeError, function() { + setFloat16.call(ta); +}, "TypedArray"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/this-is-not-object.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/this-is-not-object.js new file mode 100644 index 0000000000..182647f76f --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/this-is-not-object.js @@ -0,0 +1,42 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: Throws a TypeError if this is not Object +features: [Float16Array, Symbol] +---*/ + +var setFloat16 = DataView.prototype.setFloat16; + +assert.throws(TypeError, function() { + setFloat16.call(undefined); +}, "undefined"); + +assert.throws(TypeError, function() { + setFloat16.call(null); +}, "null"); + +assert.throws(TypeError, function() { + setFloat16.call(1); +}, "1"); + +assert.throws(TypeError, function() { + setFloat16.call("string"); +}, "string"); + +assert.throws(TypeError, function() { + setFloat16.call(true); +}, "true"); + +assert.throws(TypeError, function() { + setFloat16.call(false); +}, "false"); + +var s = Symbol("1"); +assert.throws(TypeError, function() { + setFloat16.call(s); +}, "symbol"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/to-boolean-littleendian.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/to-boolean-littleendian.js new file mode 100644 index 0000000000..1840009be6 --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/to-boolean-littleendian.js @@ -0,0 +1,37 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + Boolean littleEndian argument coerced in ToBoolean +features: [Float16Array, Symbol] +---*/ + +var buffer = new ArrayBuffer(2); +var sample = new DataView(buffer, 0); + +// False +sample.setFloat16(0, 1); +assert.sameValue(sample.getFloat16(0), 1, "no arg"); +sample.setFloat16(0, 2, undefined); +assert.sameValue(sample.getFloat16(0), 2, "undefined"); +sample.setFloat16(0, 3, null); +assert.sameValue(sample.getFloat16(0), 3, "null"); +sample.setFloat16(0, 4, 0); +assert.sameValue(sample.getFloat16(0), 4, "0"); +sample.setFloat16(0, 5, ""); +assert.sameValue(sample.getFloat16(0), 5, "the empty string"); + +// True +sample.setFloat16(0, 6, {}); // 01000110 00000000 +assert.sameValue(sample.getFloat16(0), 0.000004172325134277344, "{}"); // 00000000 01000110 +sample.setFloat16(0, 7, Symbol("1")); // 01000111 00000000 +assert.sameValue(sample.getFloat16(0), 0.000004231929779052734, "symbol"); // 00000000 01000111 +sample.setFloat16(0, 8, 1); // 01001000 00000000 +assert.sameValue(sample.getFloat16(0), 0.000004291534423828125, "1"); // 00000000 01001000 +sample.setFloat16(0, 9, "string"); // 01001000 10000000 +assert.sameValue(sample.getFloat16(0), -0.000004291534423828125, "string"); // 10000000 01001000 + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/toindex-byteoffset.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/toindex-byteoffset.js new file mode 100644 index 0000000000..2e637768de --- /dev/null +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat16/toindex-byteoffset.js @@ -0,0 +1,99 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-dataview.prototype.setfloat16 +description: > + ToIndex conversions on byteOffset +features: [Float16Array] +---*/ + +var buffer = new ArrayBuffer(6); +var sample = new DataView(buffer, 0); + +var obj1 = { + valueOf: function() { + return 3; + } +}; + +var obj2 = { + toString: function() { + return 4; + } +}; + +sample.setFloat16(0, 0); +sample.setFloat16(-0, 42); +assert.sameValue(sample.getFloat16(0), 42, "-0"); + +sample.setFloat16(3, 0); +sample.setFloat16(obj1, 42); +assert.sameValue(sample.getFloat16(3), 42, "object's valueOf"); + +sample.setFloat16(4, 0); +sample.setFloat16(obj2, 42); +assert.sameValue(sample.getFloat16(4), 42, "object's toString"); + +sample.setFloat16(0, 0); +sample.setFloat16("", 42); +assert.sameValue(sample.getFloat16(0), 42, "the Empty string"); + +sample.setFloat16(0, 0); +sample.setFloat16("0", 42); +assert.sameValue(sample.getFloat16(0), 42, "string '0'"); + +sample.setFloat16(2, 0); +sample.setFloat16("2", 42); +assert.sameValue(sample.getFloat16(2), 42, "string '2'"); + +sample.setFloat16(1, 0); +sample.setFloat16(true, 42); +assert.sameValue(sample.getFloat16(1), 42, "true"); + +sample.setFloat16(0, 0); +sample.setFloat16(false, 42); +assert.sameValue(sample.getFloat16(0), 42, "false"); + +sample.setFloat16(0, 0); +sample.setFloat16(NaN, 42); +assert.sameValue(sample.getFloat16(0), 42, "NaN"); + +sample.setFloat16(0, 0); +sample.setFloat16(null, 42); +assert.sameValue(sample.getFloat16(0), 42, "null"); + +sample.setFloat16(0, 0); +sample.setFloat16(0.1, 42); +assert.sameValue(sample.getFloat16(0), 42, "0.1"); + +sample.setFloat16(0, 0); +sample.setFloat16(0.9, 42); +assert.sameValue(sample.getFloat16(0), 42, "0.9"); + +sample.setFloat16(1, 0); +sample.setFloat16(1.1, 42); +assert.sameValue(sample.getFloat16(1), 42, "1.1"); + +sample.setFloat16(1, 0); +sample.setFloat16(1.9, 42); +assert.sameValue(sample.getFloat16(1), 42, "1.9"); + +sample.setFloat16(0, 0); +sample.setFloat16(-0.1, 42); +assert.sameValue(sample.getFloat16(0), 42, "-0.1"); + +sample.setFloat16(0, 0); +sample.setFloat16(-0.99999, 42); +assert.sameValue(sample.getFloat16(0), 42, "-0.99999"); + +sample.setFloat16(0, 0); +sample.setFloat16(undefined, 42); +assert.sameValue(sample.getFloat16(0), 42, "undefined"); + +sample.setFloat16(0, 7); +sample.setFloat16(); +assert.sameValue(sample.getFloat16(0), NaN, "no arg"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat32/length.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat32/length.js index aeda1f8804..80fdfa5ab8 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setFloat32/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat32/length.js @@ -23,10 +23,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.setFloat32.length, 2); - -verifyNotEnumerable(DataView.prototype.setFloat32, "length"); -verifyNotWritable(DataView.prototype.setFloat32, "length"); -verifyConfigurable(DataView.prototype.setFloat32, "length"); +verifyProperty(DataView.prototype.setFloat32, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat32/name.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat32/name.js index 497527f0ab..56e832d61c 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setFloat32/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat32/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.setFloat32.name, "setFloat32"); - -verifyNotEnumerable(DataView.prototype.setFloat32, "name"); -verifyNotWritable(DataView.prototype.setFloat32, "name"); -verifyConfigurable(DataView.prototype.setFloat32, "name"); +verifyProperty(DataView.prototype.setFloat32, "name", { + value: "setFloat32", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat32/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat32/not-a-constructor.js index 6388f109ab..c0d4b634cf 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setFloat32/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat32/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.setFloat32(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setFloat32(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat64/length.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat64/length.js index 50eb0bbe97..2fcf6428b3 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setFloat64/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat64/length.js @@ -23,10 +23,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.setFloat64.length, 2); - -verifyNotEnumerable(DataView.prototype.setFloat64, "length"); -verifyNotWritable(DataView.prototype.setFloat64, "length"); -verifyConfigurable(DataView.prototype.setFloat64, "length"); +verifyProperty(DataView.prototype.setFloat64, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat64/name.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat64/name.js index 05ca0ec912..e788228f90 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setFloat64/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat64/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.setFloat64.name, "setFloat64"); - -verifyNotEnumerable(DataView.prototype.setFloat64, "name"); -verifyNotWritable(DataView.prototype.setFloat64, "name"); -verifyConfigurable(DataView.prototype.setFloat64, "name"); +verifyProperty(DataView.prototype.setFloat64, "name", { + value: "setFloat64", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setFloat64/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/setFloat64/not-a-constructor.js index 12ff2af998..305dd13372 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setFloat64/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setFloat64/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.setFloat64(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setFloat64(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setInt16/length.js b/js/src/tests/test262/built-ins/DataView/prototype/setInt16/length.js index 74e11083b2..1e1640d623 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setInt16/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setInt16/length.js @@ -23,10 +23,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.setInt16.length, 2); - -verifyNotEnumerable(DataView.prototype.setInt16, "length"); -verifyNotWritable(DataView.prototype.setInt16, "length"); -verifyConfigurable(DataView.prototype.setInt16, "length"); +verifyProperty(DataView.prototype.setInt16, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setInt16/name.js b/js/src/tests/test262/built-ins/DataView/prototype/setInt16/name.js index 15220b4d94..3841b8e318 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setInt16/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setInt16/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.setInt16.name, "setInt16"); - -verifyNotEnumerable(DataView.prototype.setInt16, "name"); -verifyNotWritable(DataView.prototype.setInt16, "name"); -verifyConfigurable(DataView.prototype.setInt16, "name"); +verifyProperty(DataView.prototype.setInt16, "name", { + value: "setInt16", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setInt16/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/setInt16/not-a-constructor.js index b04ec4ac06..85616d68cd 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setInt16/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setInt16/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.setInt16(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setInt16(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setInt32/length.js b/js/src/tests/test262/built-ins/DataView/prototype/setInt32/length.js index 57bcc4db46..9d1fe1515a 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setInt32/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setInt32/length.js @@ -23,10 +23,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.setInt32.length, 2); - -verifyNotEnumerable(DataView.prototype.setInt32, "length"); -verifyNotWritable(DataView.prototype.setInt32, "length"); -verifyConfigurable(DataView.prototype.setInt32, "length"); +verifyProperty(DataView.prototype.setInt32, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setInt32/name.js b/js/src/tests/test262/built-ins/DataView/prototype/setInt32/name.js index 54f2572e30..22c81b434b 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setInt32/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setInt32/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.setInt32.name, "setInt32"); - -verifyNotEnumerable(DataView.prototype.setInt32, "name"); -verifyNotWritable(DataView.prototype.setInt32, "name"); -verifyConfigurable(DataView.prototype.setInt32, "name"); +verifyProperty(DataView.prototype.setInt32, "name", { + value: "setInt32", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setInt32/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/setInt32/not-a-constructor.js index 2f73e1a327..43cc02faf8 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setInt32/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setInt32/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.setInt32(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setInt32(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setInt8/length.js b/js/src/tests/test262/built-ins/DataView/prototype/setInt8/length.js index 8900d3121e..c1fb981599 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setInt8/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setInt8/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.setInt8.length, 2); - -verifyNotEnumerable(DataView.prototype.setInt8, "length"); -verifyNotWritable(DataView.prototype.setInt8, "length"); -verifyConfigurable(DataView.prototype.setInt8, "length"); +verifyProperty(DataView.prototype.setInt8, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setInt8/name.js b/js/src/tests/test262/built-ins/DataView/prototype/setInt8/name.js index 8464b328a4..4be8f0eb0a 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setInt8/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setInt8/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.setInt8.name, "setInt8"); - -verifyNotEnumerable(DataView.prototype.setInt8, "name"); -verifyNotWritable(DataView.prototype.setInt8, "name"); -verifyConfigurable(DataView.prototype.setInt8, "name"); +verifyProperty(DataView.prototype.setInt8, "name", { + value: "setInt8", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setInt8/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/setInt8/not-a-constructor.js index e497bc1d7b..63c758cfe1 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setInt8/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setInt8/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.setInt8(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setInt8(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setUint16/length.js b/js/src/tests/test262/built-ins/DataView/prototype/setUint16/length.js index 51e8fa626d..87c8e16952 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setUint16/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setUint16/length.js @@ -23,10 +23,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.setUint16.length, 2); - -verifyNotEnumerable(DataView.prototype.setUint16, "length"); -verifyNotWritable(DataView.prototype.setUint16, "length"); -verifyConfigurable(DataView.prototype.setUint16, "length"); +verifyProperty(DataView.prototype.setUint16, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setUint16/name.js b/js/src/tests/test262/built-ins/DataView/prototype/setUint16/name.js index 25d12bb4b4..58e6dc20d6 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setUint16/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setUint16/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.setUint16.name, "setUint16"); - -verifyNotEnumerable(DataView.prototype.setUint16, "name"); -verifyNotWritable(DataView.prototype.setUint16, "name"); -verifyConfigurable(DataView.prototype.setUint16, "name"); +verifyProperty(DataView.prototype.setUint16, "name", { + value: "setUint16", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setUint16/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/setUint16/not-a-constructor.js index d03027a4e5..e372ae6f8a 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setUint16/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setUint16/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.setUint16(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setUint16(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setUint32/length.js b/js/src/tests/test262/built-ins/DataView/prototype/setUint32/length.js index 274874d9b6..2a70739e78 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setUint32/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setUint32/length.js @@ -23,10 +23,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.setUint32.length, 2); - -verifyNotEnumerable(DataView.prototype.setUint32, "length"); -verifyNotWritable(DataView.prototype.setUint32, "length"); -verifyConfigurable(DataView.prototype.setUint32, "length"); +verifyProperty(DataView.prototype.setUint32, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setUint32/name.js b/js/src/tests/test262/built-ins/DataView/prototype/setUint32/name.js index 1d72ad1c79..c5b4ad6698 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setUint32/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setUint32/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.setUint32.name, "setUint32"); - -verifyNotEnumerable(DataView.prototype.setUint32, "name"); -verifyNotWritable(DataView.prototype.setUint32, "name"); -verifyConfigurable(DataView.prototype.setUint32, "name"); +verifyProperty(DataView.prototype.setUint32, "name", { + value: "setUint32", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setUint32/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/setUint32/not-a-constructor.js index 91a589a3c4..15e0115a3f 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setUint32/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setUint32/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.setUint32(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setUint32(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setUint8/length.js b/js/src/tests/test262/built-ins/DataView/prototype/setUint8/length.js index 63f58f4637..d003409e1f 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setUint8/length.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setUint8/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.setUint8.length, 2); - -verifyNotEnumerable(DataView.prototype.setUint8, "length"); -verifyNotWritable(DataView.prototype.setUint8, "length"); -verifyConfigurable(DataView.prototype.setUint8, "length"); +verifyProperty(DataView.prototype.setUint8, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setUint8/name.js b/js/src/tests/test262/built-ins/DataView/prototype/setUint8/name.js index f023fc8bdf..6521b0afd8 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setUint8/name.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setUint8/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(DataView.prototype.setUint8.name, "setUint8"); - -verifyNotEnumerable(DataView.prototype.setUint8, "name"); -verifyNotWritable(DataView.prototype.setUint8, "name"); -verifyConfigurable(DataView.prototype.setUint8, "name"); +verifyProperty(DataView.prototype.setUint8, "name", { + value: "setUint8", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setUint8/not-a-constructor.js b/js/src/tests/test262/built-ins/DataView/prototype/setUint8/not-a-constructor.js index 25899332b7..395755f64d 100644 --- a/js/src/tests/test262/built-ins/DataView/prototype/setUint8/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/DataView/prototype/setUint8/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let dv = new DataView(new ArrayBuffer(16)); new dv.setUint8(0, 0); -}, '`let dv = new DataView(new ArrayBuffer(16)); new dv.setUint8(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/DataView/shell.js b/js/src/tests/test262/built-ins/DataView/shell.js index 6bf8be5e31..2b6d995ad7 100644 --- a/js/src/tests/test262/built-ins/DataView/shell.js +++ b/js/src/tests/test262/built-ins/DataView/shell.js @@ -53,7 +53,22 @@ var byteConversionValues = { -4294967296, // - ( 2 ** 32 ) Infinity, -Infinity, - 0 + 0, + 2049, // an integer which rounds down under ties-to-even when cast to float16 + 2051, // an integer which rounds up under ties-to-even when cast to float16 + 0.00006103515625, // smallest normal float16 + 0.00006097555160522461, // largest subnormal float16 + 5.960464477539063e-8, // smallest float16 + 2.9802322387695312e-8, // largest double which rounds to 0 when cast to float16 + 2.980232238769532e-8, // smallest double which does not round to 0 when cast to float16 + 8.940696716308594e-8, // a double which rounds up to a subnormal under ties-to-even when cast to float16 + 1.4901161193847656e-7, // a double which rounds down to a subnormal under ties-to-even when cast to float16 + 1.490116119384766e-7, // the next double above the one on the previous line one + 65504, // max finite float16 + 65520, // smallest double which rounds to infinity when cast to float16 + 65519.99999999999, // largest double which does not round to infinity when cast to float16 + 0.000061005353927612305, // smallest double which rounds to a non-subnormal when cast to float16 + 0.0000610053539276123 // largest double which rounds to a subnormal when cast to float16 ], expected: { @@ -98,7 +113,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 1, // 2049 + 3, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + -32, // 65504 + -16, // 65520 + -17, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint8: [ 127, // 127 @@ -141,7 +171,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 1, // 2049 + 3, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 224, // 65504 + 240, // 65520 + 239, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint8Clamped: [ 127, // 127 @@ -184,7 +229,22 @@ var byteConversionValues = { 0, // -4294967296 255, // Infinity 0, // -Infinity - 0 + 0, // 0 + 255, // 2049 + 255, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 255, // 65504 + 255, // 65520 + 255, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Int16: [ 127, // 127 @@ -227,7 +287,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + -32, // 65504 + -16, // 65520 + -17, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint16: [ 127, // 127 @@ -270,7 +345,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Int32: [ 127, // 127 @@ -313,7 +403,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint32: [ 127, // 127 @@ -356,93 +461,138 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Float16: [ - 127, // 127 - 128, // 128 - 32768, // 32767 - 32768, // 32768 - Infinity, // 2147483647 - Infinity, // 2147483648 - 255, // 255 - 256, // 256 - Infinity, // 65535 - Infinity, // 65536 - Infinity, // 4294967295 - Infinity, // 4294967296 - Infinity, // 9007199254740991 - Infinity, // 9007199254740992 - 1.099609375, // 1.1 - 0.0999755859375, // 0.1 - 0.5, // 0.5 - 0.5, // 0.50000001, - 0.60009765625, // 0.6 - 0.7001953125, // 0.7 - NaN, // undefined - -1, // -1 - -0, // -0 - -0.0999755859375, // -0.1 - -1.099609375, // -1.1 - NaN, // NaN - -127, // -127 - -128, // -128 - -32768, // -32767 - -32768, // -32768 - -Infinity, // -2147483647 - -Infinity, // -2147483648 - -255, // -255 - -256, // -256 - -Infinity, // -65535 - -Infinity, // -65536 - -Infinity, // -4294967295 - -Infinity, // -4294967296 - Infinity, // Infinity - -Infinity, // -Infinity - 0 + 127, // 127 + 128, // 128 + 32768, // 32767 + 32768, // 32768 + Infinity, // 2147483647 + Infinity, // 2147483648 + 255, // 255 + 256, // 256 + Infinity, // 65535 + Infinity, // 65536 + Infinity, // 4294967295 + Infinity, // 4294967296 + Infinity, // 9007199254740991 + Infinity, // 9007199254740992 + 1.099609375, // 1.1 + 0.0999755859375, // 0.1 + 0.5, // 0.5 + 0.5, // 0.50000001, + 0.60009765625, // 0.6 + 0.7001953125, // 0.7 + NaN, // undefined + -1, // -1 + -0, // -0 + -0.0999755859375, // -0.1 + -1.099609375, // -1.1 + NaN, // NaN + -127, // -127 + -128, // -128 + -32768, // -32767 + -32768, // -32768 + -Infinity, // -2147483647 + -Infinity, // -2147483648 + -255, // -255 + -256, // -256 + -Infinity, // -65535 + -Infinity, // -65536 + -Infinity, // -4294967295 + -Infinity, // -4294967296 + Infinity, // Infinity + -Infinity, // -Infinity + 0, // 0 + 2048, // 2049 + 2052, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 5.960464477539063e-8, // 2.980232238769532e-8 + 1.1920928955078125e-7, // 8.940696716308594e-8 + 1.1920928955078125e-7, // 1.4901161193847656e-7 + 1.7881393432617188e-7, // 1.490116119384766e-7 + 65504, // 65504 + Infinity, // 65520 + 65504, // 65519.99999999999 + 0.00006103515625, // 0.000061005353927612305 + 0.00006097555160522461 // 0.0000610053539276123 ], Float32: [ - 127, // 127 - 128, // 128 - 32767, // 32767 - 32768, // 32768 - 2147483648, // 2147483647 - 2147483648, // 2147483648 - 255, // 255 - 256, // 256 - 65535, // 65535 - 65536, // 65536 - 4294967296, // 4294967295 - 4294967296, // 4294967296 - 9007199254740992, // 9007199254740991 - 9007199254740992, // 9007199254740992 - 1.100000023841858, // 1.1 - 0.10000000149011612, // 0.1 - 0.5, // 0.5 - 0.5, // 0.50000001, - 0.6000000238418579, // 0.6 - 0.699999988079071, // 0.7 - NaN, // undefined - -1, // -1 - -0, // -0 - -0.10000000149011612, // -0.1 - -1.100000023841858, // -1.1 - NaN, // NaN - -127, // -127 - -128, // -128 - -32767, // -32767 - -32768, // -32768 - -2147483648, // -2147483647 - -2147483648, // -2147483648 - -255, // -255 - -256, // -256 - -65535, // -65535 - -65536, // -65536 - -4294967296, // -4294967295 - -4294967296, // -4294967296 - Infinity, // Infinity - -Infinity, // -Infinity - 0 + 127, // 127 + 128, // 128 + 32767, // 32767 + 32768, // 32768 + 2147483648, // 2147483647 + 2147483648, // 2147483648 + 255, // 255 + 256, // 256 + 65535, // 65535 + 65536, // 65536 + 4294967296, // 4294967295 + 4294967296, // 4294967296 + 9007199254740992, // 9007199254740991 + 9007199254740992, // 9007199254740992 + 1.100000023841858, // 1.1 + 0.10000000149011612, // 0.1 + 0.5, // 0.5 + 0.5, // 0.50000001, + 0.6000000238418579, // 0.6 + 0.699999988079071, // 0.7 + NaN, // undefined + -1, // -1 + -0, // -0 + -0.10000000149011612, // -0.1 + -1.100000023841858, // -1.1 + NaN, // NaN + -127, // -127 + -128, // -128 + -32767, // -32767 + -32768, // -32768 + -2147483648, // -2147483647 + -2147483648, // -2147483648 + -255, // -255 + -256, // -256 + -65535, // -65535 + -65536, // -65536 + -4294967296, // -4294967295 + -4294967296, // -4294967296 + Infinity, // Infinity + -Infinity, // -Infinity + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 2.9802322387695312e-8, // 2.9802322387695312e-8 + 2.9802322387695312e-8, // 2.980232238769532e-8 + 8.940696716308594e-8, // 8.940696716308594e-8 + 1.4901161193847656e-7, // 1.4901161193847656e-7 + 1.4901161193847656e-7, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65520, // 65519.99999999999 + 0.000061005353927612305, // 0.000061005353927612305 + 0.000061005353927612305 // 0.0000610053539276123 ], Float64: [ 127, // 127 @@ -485,7 +635,22 @@ var byteConversionValues = { -4294967296, // -4294967296 Infinity, // Infinity -Infinity, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 2.9802322387695312e-8, // 2.9802322387695312e-8 + 2.980232238769532e-8, // 2.980232238769532e-8 + 8.940696716308594e-8, // 8.940696716308594e-8 + 1.4901161193847656e-7, // 1.4901161193847656e-7 + 1.490116119384766e-7, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519.99999999999, // 65519.99999999999 + 0.000061005353927612305, // 0.000061005353927612305 + 0.0000610053539276123 // 0.0000610053539276123 ] } }; diff --git a/js/src/tests/test262/built-ins/Date/UTC/name.js b/js/src/tests/test262/built-ins/Date/UTC/name.js index 3310708e58..4b94d366f8 100644 --- a/js/src/tests/test262/built-ins/Date/UTC/name.js +++ b/js/src/tests/test262/built-ins/Date/UTC/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.UTC.name, "UTC"); - -verifyNotEnumerable(Date.UTC, "name"); -verifyNotWritable(Date.UTC, "name"); -verifyConfigurable(Date.UTC, "name"); +verifyProperty(Date.UTC, "name", { + value: "UTC", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/UTC/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/UTC/not-a-constructor.js index b655948879..25ef5bf8eb 100644 --- a/js/src/tests/test262/built-ins/Date/UTC/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/UTC/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Date.UTC), false, 'isConstructor(Date.UTC) must r assert.throws(TypeError, () => { new Date.UTC(); -}, '`new Date.UTC()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/name.js b/js/src/tests/test262/built-ins/Date/name.js index 29e869ec72..d58490e5cd 100644 --- a/js/src/tests/test262/built-ins/Date/name.js +++ b/js/src/tests/test262/built-ins/Date/name.js @@ -16,10 +16,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.name, "Date"); - -verifyNotEnumerable(Date, "name"); -verifyNotWritable(Date, "name"); -verifyConfigurable(Date, "name"); +verifyProperty(Date, "name", { + value: "Date", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/now/name.js b/js/src/tests/test262/built-ins/Date/now/name.js index 4189f1f4e7..f150e257f8 100644 --- a/js/src/tests/test262/built-ins/Date/now/name.js +++ b/js/src/tests/test262/built-ins/Date/now/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.now.name, "now"); - -verifyNotEnumerable(Date.now, "name"); -verifyNotWritable(Date.now, "name"); -verifyConfigurable(Date.now, "name"); +verifyProperty(Date.now, "name", { + value: "now", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/now/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/now/not-a-constructor.js index d6a7cf0555..9aac86a56f 100644 --- a/js/src/tests/test262/built-ins/Date/now/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/now/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Date.now), false, 'isConstructor(Date.now) must r assert.throws(TypeError, () => { new Date.now(); -}, '`new Date.now()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/parse/name.js b/js/src/tests/test262/built-ins/Date/parse/name.js index 79595c22f8..0c7fa328a2 100644 --- a/js/src/tests/test262/built-ins/Date/parse/name.js +++ b/js/src/tests/test262/built-ins/Date/parse/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.parse.name, "parse"); - -verifyNotEnumerable(Date.parse, "name"); -verifyNotWritable(Date.parse, "name"); -verifyConfigurable(Date.parse, "name"); +verifyProperty(Date.parse, "name", { + value: "parse", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/parse/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/parse/not-a-constructor.js index 01551a621c..f129a9c814 100644 --- a/js/src/tests/test262/built-ins/Date/parse/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/parse/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Date.parse), false, 'isConstructor(Date.parse) mu assert.throws(TypeError, () => { new Date.parse(); -}, '`new Date.parse()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/Symbol.toPrimitive/length.js b/js/src/tests/test262/built-ins/Date/prototype/Symbol.toPrimitive/length.js index 1e46f05120..16f78857f2 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/Symbol.toPrimitive/length.js +++ b/js/src/tests/test262/built-ins/Date/prototype/Symbol.toPrimitive/length.js @@ -20,10 +20,11 @@ features: [Symbol.toPrimitive] includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype[Symbol.toPrimitive].length, 1); - -verifyNotEnumerable(Date.prototype[Symbol.toPrimitive], 'length'); -verifyNotWritable(Date.prototype[Symbol.toPrimitive], 'length'); -verifyConfigurable(Date.prototype[Symbol.toPrimitive], 'length'); +verifyProperty(Date.prototype[Symbol.toPrimitive], "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/Symbol.toPrimitive/name.js b/js/src/tests/test262/built-ins/Date/prototype/Symbol.toPrimitive/name.js index e1e40be0fe..58d9c00d6b 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/Symbol.toPrimitive/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/Symbol.toPrimitive/name.js @@ -17,12 +17,11 @@ features: [Symbol.toPrimitive] includes: [propertyHelper.js] ---*/ -assert.sameValue( - Date.prototype[Symbol.toPrimitive].name, '[Symbol.toPrimitive]' -); - -verifyNotEnumerable(Date.prototype[Symbol.toPrimitive], 'name'); -verifyNotWritable(Date.prototype[Symbol.toPrimitive], 'name'); -verifyConfigurable(Date.prototype[Symbol.toPrimitive], 'name'); +verifyProperty(Date.prototype[Symbol.toPrimitive], "name", { + value: "[Symbol.toPrimitive]", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getDate/name.js b/js/src/tests/test262/built-ins/Date/prototype/getDate/name.js index 3c1574d163..31c1a36efe 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getDate/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getDate/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getDate.name, "getDate"); - -verifyNotEnumerable(Date.prototype.getDate, "name"); -verifyNotWritable(Date.prototype.getDate, "name"); -verifyConfigurable(Date.prototype.getDate, "name"); +verifyProperty(Date.prototype.getDate, "name", { + value: "getDate", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getDate/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getDate/not-a-constructor.js index 675f61b753..7e3837fede 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getDate/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getDate/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getDate(); -}, '`let date = new Date(Date.now()); new date.getDate()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getDay/name.js b/js/src/tests/test262/built-ins/Date/prototype/getDay/name.js index 89c16d7928..3244db692f 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getDay/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getDay/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getDay.name, "getDay"); - -verifyNotEnumerable(Date.prototype.getDay, "name"); -verifyNotWritable(Date.prototype.getDay, "name"); -verifyConfigurable(Date.prototype.getDay, "name"); +verifyProperty(Date.prototype.getDay, "name", { + value: "getDay", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getDay/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getDay/not-a-constructor.js index 08a25137e9..e4fc295059 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getDay/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getDay/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getDay(); -}, '`let date = new Date(Date.now()); new date.getDay()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getFullYear/name.js b/js/src/tests/test262/built-ins/Date/prototype/getFullYear/name.js index d6a5b8e6ce..c02da77602 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getFullYear/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getFullYear/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getFullYear.name, "getFullYear"); - -verifyNotEnumerable(Date.prototype.getFullYear, "name"); -verifyNotWritable(Date.prototype.getFullYear, "name"); -verifyConfigurable(Date.prototype.getFullYear, "name"); +verifyProperty(Date.prototype.getFullYear, "name", { + value: "getFullYear", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getFullYear/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getFullYear/not-a-constructor.js index 917047cfdb..7a265deb84 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getFullYear/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getFullYear/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getFullYear(); -}, '`let date = new Date(Date.now()); new date.getFullYear()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getHours/name.js b/js/src/tests/test262/built-ins/Date/prototype/getHours/name.js index b775ade1e9..e93e27affa 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getHours/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getHours/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getHours.name, "getHours"); - -verifyNotEnumerable(Date.prototype.getHours, "name"); -verifyNotWritable(Date.prototype.getHours, "name"); -verifyConfigurable(Date.prototype.getHours, "name"); +verifyProperty(Date.prototype.getHours, "name", { + value: "getHours", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getHours/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getHours/not-a-constructor.js index bdb019bbee..38fa17a44d 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getHours/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getHours/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getHours(); -}, '`let date = new Date(Date.now()); new date.getHours()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getMilliseconds/name.js b/js/src/tests/test262/built-ins/Date/prototype/getMilliseconds/name.js index 0845a2c619..3cea2cb689 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getMilliseconds/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getMilliseconds/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getMilliseconds.name, "getMilliseconds"); - -verifyNotEnumerable(Date.prototype.getMilliseconds, "name"); -verifyNotWritable(Date.prototype.getMilliseconds, "name"); -verifyConfigurable(Date.prototype.getMilliseconds, "name"); +verifyProperty(Date.prototype.getMilliseconds, "name", { + value: "getMilliseconds", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getMilliseconds/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getMilliseconds/not-a-constructor.js index 4682cd3c1e..8b0397c310 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getMilliseconds/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getMilliseconds/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getMilliseconds(); -}, '`let date = new Date(Date.now()); new date.getMilliseconds()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getMinutes/name.js b/js/src/tests/test262/built-ins/Date/prototype/getMinutes/name.js index e1d71363bb..b6b919af98 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getMinutes/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getMinutes/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getMinutes.name, "getMinutes"); - -verifyNotEnumerable(Date.prototype.getMinutes, "name"); -verifyNotWritable(Date.prototype.getMinutes, "name"); -verifyConfigurable(Date.prototype.getMinutes, "name"); +verifyProperty(Date.prototype.getMinutes, "name", { + value: "getMinutes", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getMinutes/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getMinutes/not-a-constructor.js index 21682d79fc..1459f9b19f 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getMinutes/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getMinutes/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getMinutes(); -}, '`let date = new Date(Date.now()); new date.getMinutes()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getMonth/name.js b/js/src/tests/test262/built-ins/Date/prototype/getMonth/name.js index 7071c3d694..5e349f09e5 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getMonth/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getMonth/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getMonth.name, "getMonth"); - -verifyNotEnumerable(Date.prototype.getMonth, "name"); -verifyNotWritable(Date.prototype.getMonth, "name"); -verifyConfigurable(Date.prototype.getMonth, "name"); +verifyProperty(Date.prototype.getMonth, "name", { + value: "getMonth", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getMonth/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getMonth/not-a-constructor.js index 53c9ac0819..1b51675a68 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getMonth/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getMonth/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getMonth(); -}, '`let date = new Date(Date.now()); new date.getMonth()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getSeconds/name.js b/js/src/tests/test262/built-ins/Date/prototype/getSeconds/name.js index 56d30ef47f..7903622149 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getSeconds/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getSeconds/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getSeconds.name, "getSeconds"); - -verifyNotEnumerable(Date.prototype.getSeconds, "name"); -verifyNotWritable(Date.prototype.getSeconds, "name"); -verifyConfigurable(Date.prototype.getSeconds, "name"); +verifyProperty(Date.prototype.getSeconds, "name", { + value: "getSeconds", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getSeconds/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getSeconds/not-a-constructor.js index cae3edd42d..c9cd79ad73 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getSeconds/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getSeconds/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getSeconds(); -}, '`let date = new Date(Date.now()); new date.getSeconds()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getTime/name.js b/js/src/tests/test262/built-ins/Date/prototype/getTime/name.js index 3c05eb5508..7c78012059 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getTime/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getTime/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getTime.name, "getTime"); - -verifyNotEnumerable(Date.prototype.getTime, "name"); -verifyNotWritable(Date.prototype.getTime, "name"); -verifyConfigurable(Date.prototype.getTime, "name"); +verifyProperty(Date.prototype.getTime, "name", { + value: "getTime", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getTime/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getTime/not-a-constructor.js index 31e56a6eb3..1df1a5d935 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getTime/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getTime/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getTime(); -}, '`let date = new Date(Date.now()); new date.getTime()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getTimezoneOffset/name.js b/js/src/tests/test262/built-ins/Date/prototype/getTimezoneOffset/name.js index 0fe3e7046d..ff10e286cb 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getTimezoneOffset/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getTimezoneOffset/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getTimezoneOffset.name, "getTimezoneOffset"); - -verifyNotEnumerable(Date.prototype.getTimezoneOffset, "name"); -verifyNotWritable(Date.prototype.getTimezoneOffset, "name"); -verifyConfigurable(Date.prototype.getTimezoneOffset, "name"); +verifyProperty(Date.prototype.getTimezoneOffset, "name", { + value: "getTimezoneOffset", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getTimezoneOffset/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getTimezoneOffset/not-a-constructor.js index cd1dcd6992..c79024050e 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getTimezoneOffset/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getTimezoneOffset/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getTimezoneOffset(); -}, '`let date = new Date(Date.now()); new date.getTimezoneOffset()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCDate/name.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCDate/name.js index 3968908ce4..1f8c30ec17 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getUTCDate/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCDate/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getUTCDate.name, "getUTCDate"); - -verifyNotEnumerable(Date.prototype.getUTCDate, "name"); -verifyNotWritable(Date.prototype.getUTCDate, "name"); -verifyConfigurable(Date.prototype.getUTCDate, "name"); +verifyProperty(Date.prototype.getUTCDate, "name", { + value: "getUTCDate", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCDate/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCDate/not-a-constructor.js index 0590ac9a6e..f49070911d 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getUTCDate/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCDate/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getUTCDate(); -}, '`let date = new Date(Date.now()); new date.getUTCDate()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCDay/name.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCDay/name.js index 280b83ed76..fabdfa6c3a 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getUTCDay/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCDay/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getUTCDay.name, "getUTCDay"); - -verifyNotEnumerable(Date.prototype.getUTCDay, "name"); -verifyNotWritable(Date.prototype.getUTCDay, "name"); -verifyConfigurable(Date.prototype.getUTCDay, "name"); +verifyProperty(Date.prototype.getUTCDay, "name", { + value: "getUTCDay", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCDay/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCDay/not-a-constructor.js index 42d0a20852..6ded993a4e 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getUTCDay/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCDay/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getUTCDay(); -}, '`let date = new Date(Date.now()); new date.getUTCDay()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCFullYear/name.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCFullYear/name.js index a12fcc0b98..a2f5dbd6d1 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getUTCFullYear/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCFullYear/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getUTCFullYear.name, "getUTCFullYear"); - -verifyNotEnumerable(Date.prototype.getUTCFullYear, "name"); -verifyNotWritable(Date.prototype.getUTCFullYear, "name"); -verifyConfigurable(Date.prototype.getUTCFullYear, "name"); +verifyProperty(Date.prototype.getUTCFullYear, "name", { + value: "getUTCFullYear", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCFullYear/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCFullYear/not-a-constructor.js index 6baf587e38..31deb328a9 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getUTCFullYear/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCFullYear/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getUTCFullYear(); -}, '`let date = new Date(Date.now()); new date.getUTCFullYear()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCHours/name.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCHours/name.js index d35e74baa5..7ac40b70ff 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getUTCHours/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCHours/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getUTCHours.name, "getUTCHours"); - -verifyNotEnumerable(Date.prototype.getUTCHours, "name"); -verifyNotWritable(Date.prototype.getUTCHours, "name"); -verifyConfigurable(Date.prototype.getUTCHours, "name"); +verifyProperty(Date.prototype.getUTCHours, "name", { + value: "getUTCHours", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCHours/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCHours/not-a-constructor.js index 60ed6e667f..08baa06108 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getUTCHours/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCHours/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getUTCHours(); -}, '`let date = new Date(Date.now()); new date.getUTCHours()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCMilliseconds/name.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMilliseconds/name.js index 1a723340a3..78a592b823 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getUTCMilliseconds/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMilliseconds/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getUTCMilliseconds.name, "getUTCMilliseconds"); - -verifyNotEnumerable(Date.prototype.getUTCMilliseconds, "name"); -verifyNotWritable(Date.prototype.getUTCMilliseconds, "name"); -verifyConfigurable(Date.prototype.getUTCMilliseconds, "name"); +verifyProperty(Date.prototype.getUTCMilliseconds, "name", { + value: "getUTCMilliseconds", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCMilliseconds/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMilliseconds/not-a-constructor.js index b9e17b9792..58584449b3 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getUTCMilliseconds/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMilliseconds/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getUTCMilliseconds(); -}, '`let date = new Date(Date.now()); new date.getUTCMilliseconds()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/name.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/name.js index 5fc1ac7b8d..150f731776 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getUTCMinutes.name, "getUTCMinutes"); - -verifyNotEnumerable(Date.prototype.getUTCMinutes, "name"); -verifyNotWritable(Date.prototype.getUTCMinutes, "name"); -verifyConfigurable(Date.prototype.getUTCMinutes, "name"); +verifyProperty(Date.prototype.getUTCMinutes, "name", { + value: "getUTCMinutes", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/not-a-constructor.js index be50d8d0e6..b8ae1dffa1 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMinutes/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getUTCMinutes(); -}, '`let date = new Date(Date.now()); new date.getUTCMinutes()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCMonth/name.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMonth/name.js index 796815dd91..854fc0a14f 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getUTCMonth/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMonth/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getUTCMonth.name, "getUTCMonth"); - -verifyNotEnumerable(Date.prototype.getUTCMonth, "name"); -verifyNotWritable(Date.prototype.getUTCMonth, "name"); -verifyConfigurable(Date.prototype.getUTCMonth, "name"); +verifyProperty(Date.prototype.getUTCMonth, "name", { + value: "getUTCMonth", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCMonth/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCMonth/not-a-constructor.js index 55428f88be..666a073fce 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getUTCMonth/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCMonth/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getUTCMonth(); -}, '`let date = new Date(Date.now()); new date.getUTCMonth()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCSeconds/name.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCSeconds/name.js index 11cdea38b7..674434b09a 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getUTCSeconds/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCSeconds/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.getUTCSeconds.name, "getUTCSeconds"); - -verifyNotEnumerable(Date.prototype.getUTCSeconds, "name"); -verifyNotWritable(Date.prototype.getUTCSeconds, "name"); -verifyConfigurable(Date.prototype.getUTCSeconds, "name"); +verifyProperty(Date.prototype.getUTCSeconds, "name", { + value: "getUTCSeconds", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/getUTCSeconds/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/getUTCSeconds/not-a-constructor.js index be8ed19fe1..8cc4c66c56 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/getUTCSeconds/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/getUTCSeconds/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.getUTCSeconds(); -}, '`let date = new Date(Date.now()); new date.getUTCSeconds()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setDate/name.js b/js/src/tests/test262/built-ins/Date/prototype/setDate/name.js index 15ba085ab7..0b0518bcf5 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setDate/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setDate/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.setDate.name, "setDate"); - -verifyNotEnumerable(Date.prototype.setDate, "name"); -verifyNotWritable(Date.prototype.setDate, "name"); -verifyConfigurable(Date.prototype.setDate, "name"); +verifyProperty(Date.prototype.setDate, "name", { + value: "setDate", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setDate/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setDate/not-a-constructor.js index cc4d2bca46..10ce410a35 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setDate/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setDate/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.setDate(); -}, '`let date = new Date(Date.now()); new date.setDate()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setFullYear/name.js b/js/src/tests/test262/built-ins/Date/prototype/setFullYear/name.js index 07255899ed..29e39d5e7c 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setFullYear/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setFullYear/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.setFullYear.name, "setFullYear"); - -verifyNotEnumerable(Date.prototype.setFullYear, "name"); -verifyNotWritable(Date.prototype.setFullYear, "name"); -verifyConfigurable(Date.prototype.setFullYear, "name"); +verifyProperty(Date.prototype.setFullYear, "name", { + value: "setFullYear", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setFullYear/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setFullYear/not-a-constructor.js index 99b1f387c3..18a21334b4 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setFullYear/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setFullYear/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.setFullYear(); -}, '`let date = new Date(Date.now()); new date.setFullYear()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setHours/name.js b/js/src/tests/test262/built-ins/Date/prototype/setHours/name.js index 9626594fc3..9f752c681a 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setHours/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setHours/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.setHours.name, "setHours"); - -verifyNotEnumerable(Date.prototype.setHours, "name"); -verifyNotWritable(Date.prototype.setHours, "name"); -verifyConfigurable(Date.prototype.setHours, "name"); +verifyProperty(Date.prototype.setHours, "name", { + value: "setHours", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setHours/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setHours/not-a-constructor.js index 767fe264d0..20348701c2 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setHours/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setHours/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.setHours(); -}, '`let date = new Date(Date.now()); new date.setHours()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setMilliseconds/name.js b/js/src/tests/test262/built-ins/Date/prototype/setMilliseconds/name.js index 3430c5e216..fb20207a6b 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setMilliseconds/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setMilliseconds/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.setMilliseconds.name, "setMilliseconds"); - -verifyNotEnumerable(Date.prototype.setMilliseconds, "name"); -verifyNotWritable(Date.prototype.setMilliseconds, "name"); -verifyConfigurable(Date.prototype.setMilliseconds, "name"); +verifyProperty(Date.prototype.setMilliseconds, "name", { + value: "setMilliseconds", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setMilliseconds/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setMilliseconds/not-a-constructor.js index 3282e1a901..e667918b7c 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setMilliseconds/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setMilliseconds/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.setMilliseconds(); -}, '`let date = new Date(Date.now()); new date.setMilliseconds()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setMinutes/name.js b/js/src/tests/test262/built-ins/Date/prototype/setMinutes/name.js index 5b177e2027..3a88966446 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setMinutes/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setMinutes/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.setMinutes.name, "setMinutes"); - -verifyNotEnumerable(Date.prototype.setMinutes, "name"); -verifyNotWritable(Date.prototype.setMinutes, "name"); -verifyConfigurable(Date.prototype.setMinutes, "name"); +verifyProperty(Date.prototype.setMinutes, "name", { + value: "setMinutes", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setMinutes/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setMinutes/not-a-constructor.js index c65d687fb9..c74f8aa05c 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setMinutes/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setMinutes/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.setMinutes(); -}, '`let date = new Date(Date.now()); new date.setMinutes()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setMonth/name.js b/js/src/tests/test262/built-ins/Date/prototype/setMonth/name.js index 9e28f33557..b537c6f3f9 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setMonth/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setMonth/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.setMonth.name, "setMonth"); - -verifyNotEnumerable(Date.prototype.setMonth, "name"); -verifyNotWritable(Date.prototype.setMonth, "name"); -verifyConfigurable(Date.prototype.setMonth, "name"); +verifyProperty(Date.prototype.setMonth, "name", { + value: "setMonth", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setMonth/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setMonth/not-a-constructor.js index ce51b8a701..f9d71f03a1 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setMonth/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setMonth/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.setMonth(); -}, '`let date = new Date(Date.now()); new date.setMonth()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setSeconds/name.js b/js/src/tests/test262/built-ins/Date/prototype/setSeconds/name.js index 1850428386..08020a855e 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setSeconds/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setSeconds/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.setSeconds.name, "setSeconds"); - -verifyNotEnumerable(Date.prototype.setSeconds, "name"); -verifyNotWritable(Date.prototype.setSeconds, "name"); -verifyConfigurable(Date.prototype.setSeconds, "name"); +verifyProperty(Date.prototype.setSeconds, "name", { + value: "setSeconds", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setSeconds/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setSeconds/not-a-constructor.js index 47cfa721dd..029042ae4e 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setSeconds/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setSeconds/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.setSeconds(); -}, '`let date = new Date(Date.now()); new date.setSeconds()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setTime/name.js b/js/src/tests/test262/built-ins/Date/prototype/setTime/name.js index b978b93ad5..dec4cd1c53 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setTime/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setTime/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.setTime.name, "setTime"); - -verifyNotEnumerable(Date.prototype.setTime, "name"); -verifyNotWritable(Date.prototype.setTime, "name"); -verifyConfigurable(Date.prototype.setTime, "name"); +verifyProperty(Date.prototype.setTime, "name", { + value: "setTime", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setTime/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setTime/not-a-constructor.js index 5bd2d83907..3679690bf7 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setTime/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setTime/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.setTime(); -}, '`let date = new Date(Date.now()); new date.setTime()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCDate/name.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCDate/name.js index 4608a57892..18daf453bf 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setUTCDate/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCDate/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.setUTCDate.name, "setUTCDate"); - -verifyNotEnumerable(Date.prototype.setUTCDate, "name"); -verifyNotWritable(Date.prototype.setUTCDate, "name"); -verifyConfigurable(Date.prototype.setUTCDate, "name"); +verifyProperty(Date.prototype.setUTCDate, "name", { + value: "setUTCDate", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCDate/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCDate/not-a-constructor.js index eb0e04f08c..b8046e3eeb 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setUTCDate/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCDate/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.setUTCDate(); -}, '`let date = new Date(Date.now()); new date.setUTCDate()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCFullYear/name.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCFullYear/name.js index 3f0c1ce4ed..d3b53eb5b0 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setUTCFullYear/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCFullYear/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.setUTCFullYear.name, "setUTCFullYear"); - -verifyNotEnumerable(Date.prototype.setUTCFullYear, "name"); -verifyNotWritable(Date.prototype.setUTCFullYear, "name"); -verifyConfigurable(Date.prototype.setUTCFullYear, "name"); +verifyProperty(Date.prototype.setUTCFullYear, "name", { + value: "setUTCFullYear", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCFullYear/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCFullYear/not-a-constructor.js index 06d291aa71..715c51f6c3 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setUTCFullYear/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCFullYear/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.setUTCFullYear(); -}, '`let date = new Date(Date.now()); new date.setUTCFullYear()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCHours/name.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCHours/name.js index 8335871c2c..1bbdd90e18 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setUTCHours/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCHours/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.setUTCHours.name, "setUTCHours"); - -verifyNotEnumerable(Date.prototype.setUTCHours, "name"); -verifyNotWritable(Date.prototype.setUTCHours, "name"); -verifyConfigurable(Date.prototype.setUTCHours, "name"); +verifyProperty(Date.prototype.setUTCHours, "name", { + value: "setUTCHours", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCHours/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCHours/not-a-constructor.js index a572e32b52..379bf379c6 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setUTCHours/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCHours/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.setUTCHours(); -}, '`let date = new Date(Date.now()); new date.setUTCHours()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/name.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/name.js index 65d0bd6f99..73ac13ce7d 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.setUTCMilliseconds.name, "setUTCMilliseconds"); - -verifyNotEnumerable(Date.prototype.setUTCMilliseconds, "name"); -verifyNotWritable(Date.prototype.setUTCMilliseconds, "name"); -verifyConfigurable(Date.prototype.setUTCMilliseconds, "name"); +verifyProperty(Date.prototype.setUTCMilliseconds, "name", { + value: "setUTCMilliseconds", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/not-a-constructor.js index a7e4cbcc7b..f2b345157a 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMilliseconds/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.setUTCMilliseconds(); -}, '`let date = new Date(Date.now()); new date.setUTCMilliseconds()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/name.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/name.js index db16d42c80..b8a686c993 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.setUTCMinutes.name, "setUTCMinutes"); - -verifyNotEnumerable(Date.prototype.setUTCMinutes, "name"); -verifyNotWritable(Date.prototype.setUTCMinutes, "name"); -verifyConfigurable(Date.prototype.setUTCMinutes, "name"); +verifyProperty(Date.prototype.setUTCMinutes, "name", { + value: "setUTCMinutes", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/not-a-constructor.js index 01f6a9293f..fd18c165b4 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMinutes/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.setUTCMinutes(); -}, '`let date = new Date(Date.now()); new date.setUTCMinutes()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/name.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/name.js index 70ca8822ea..31e7374ccb 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.setUTCMonth.name, "setUTCMonth"); - -verifyNotEnumerable(Date.prototype.setUTCMonth, "name"); -verifyNotWritable(Date.prototype.setUTCMonth, "name"); -verifyConfigurable(Date.prototype.setUTCMonth, "name"); +verifyProperty(Date.prototype.setUTCMonth, "name", { + value: "setUTCMonth", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/not-a-constructor.js index 977faba6d2..afc198eecf 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCMonth/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.setUTCMonth(); -}, '`let date = new Date(Date.now()); new date.setUTCMonth()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCSeconds/name.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCSeconds/name.js index b73874e84a..6748c4cdd1 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setUTCSeconds/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCSeconds/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.setUTCSeconds.name, "setUTCSeconds"); - -verifyNotEnumerable(Date.prototype.setUTCSeconds, "name"); -verifyNotWritable(Date.prototype.setUTCSeconds, "name"); -verifyConfigurable(Date.prototype.setUTCSeconds, "name"); +verifyProperty(Date.prototype.setUTCSeconds, "name", { + value: "setUTCSeconds", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/setUTCSeconds/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/setUTCSeconds/not-a-constructor.js index b6eebae507..df97189a3a 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/setUTCSeconds/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/setUTCSeconds/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.setUTCSeconds(); -}, '`let date = new Date(Date.now()); new date.setUTCSeconds()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toDateString/name.js b/js/src/tests/test262/built-ins/Date/prototype/toDateString/name.js index 3cd99649b7..d6c2ac0c85 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/toDateString/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/toDateString/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.toDateString.name, "toDateString"); - -verifyNotEnumerable(Date.prototype.toDateString, "name"); -verifyNotWritable(Date.prototype.toDateString, "name"); -verifyConfigurable(Date.prototype.toDateString, "name"); +verifyProperty(Date.prototype.toDateString, "name", { + value: "toDateString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toDateString/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/toDateString/not-a-constructor.js index b70807dc68..4e01ccd8d4 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/toDateString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/toDateString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.toDateString(); -}, '`let date = new Date(Date.now()); new date.toDateString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toISOString/name.js b/js/src/tests/test262/built-ins/Date/prototype/toISOString/name.js index 1abb089310..dfce76f478 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/toISOString/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/toISOString/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.toISOString.name, "toISOString"); - -verifyNotEnumerable(Date.prototype.toISOString, "name"); -verifyNotWritable(Date.prototype.toISOString, "name"); -verifyConfigurable(Date.prototype.toISOString, "name"); +verifyProperty(Date.prototype.toISOString, "name", { + value: "toISOString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toISOString/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/toISOString/not-a-constructor.js index a3dd9891ec..e0e18320f9 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/toISOString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/toISOString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.toISOString(); -}, '`let date = new Date(Date.now()); new date.toISOString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toJSON/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/toJSON/not-a-constructor.js index df5faff002..9616f636d7 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/toJSON/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/toJSON/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.toJSON(); -}, '`let date = new Date(Date.now()); new date.toJSON()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/name.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/name.js index 0f3981a565..b346684487 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.toLocaleDateString.name, "toLocaleDateString"); - -verifyNotEnumerable(Date.prototype.toLocaleDateString, "name"); -verifyNotWritable(Date.prototype.toLocaleDateString, "name"); -verifyConfigurable(Date.prototype.toLocaleDateString, "name"); +verifyProperty(Date.prototype.toLocaleDateString, "name", { + value: "toLocaleDateString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/not-a-constructor.js index 45b56d70ed..70f5a23b2f 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleDateString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.toLocaleDateString(); -}, '`let date = new Date(Date.now()); new date.toLocaleDateString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/name.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/name.js index 1c2d1ad584..0a23badf79 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.toLocaleString.name, "toLocaleString"); - -verifyNotEnumerable(Date.prototype.toLocaleString, "name"); -verifyNotWritable(Date.prototype.toLocaleString, "name"); -verifyConfigurable(Date.prototype.toLocaleString, "name"); +verifyProperty(Date.prototype.toLocaleString, "name", { + value: "toLocaleString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/not-a-constructor.js index 4af86cd1e6..ea251261e9 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.toLocaleString(); -}, '`let date = new Date(Date.now()); new date.toLocaleString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleTimeString/name.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleTimeString/name.js index 260baf8b5d..ad4e9237c4 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/toLocaleTimeString/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleTimeString/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.toLocaleTimeString.name, "toLocaleTimeString"); - -verifyNotEnumerable(Date.prototype.toLocaleTimeString, "name"); -verifyNotWritable(Date.prototype.toLocaleTimeString, "name"); -verifyConfigurable(Date.prototype.toLocaleTimeString, "name"); +verifyProperty(Date.prototype.toLocaleTimeString, "name", { + value: "toLocaleTimeString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toLocaleTimeString/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/toLocaleTimeString/not-a-constructor.js index 6f648bb789..3ed058cd57 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/toLocaleTimeString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/toLocaleTimeString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.toLocaleTimeString(); -}, '`let date = new Date(Date.now()); new date.toLocaleTimeString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toString/name.js b/js/src/tests/test262/built-ins/Date/prototype/toString/name.js index 9bfd383b55..d317a654de 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/toString/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/toString/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.toString.name, "toString"); - -verifyNotEnumerable(Date.prototype.toString, "name"); -verifyNotWritable(Date.prototype.toString, "name"); -verifyConfigurable(Date.prototype.toString, "name"); +verifyProperty(Date.prototype.toString, "name", { + value: "toString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toString/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/toString/not-a-constructor.js index 29da7f63b2..a08235eebc 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/toString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/toString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.toString(); -}, '`let date = new Date(Date.now()); new date.toString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toTimeString/name.js b/js/src/tests/test262/built-ins/Date/prototype/toTimeString/name.js index 4616efbad2..fe1a3a9efc 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/toTimeString/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/toTimeString/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.toTimeString.name, "toTimeString"); - -verifyNotEnumerable(Date.prototype.toTimeString, "name"); -verifyNotWritable(Date.prototype.toTimeString, "name"); -verifyConfigurable(Date.prototype.toTimeString, "name"); +verifyProperty(Date.prototype.toTimeString, "name", { + value: "toTimeString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toTimeString/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/toTimeString/not-a-constructor.js index 7191049f7c..d4a5c01932 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/toTimeString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/toTimeString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.toTimeString(); -}, '`let date = new Date(Date.now()); new date.toTimeString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toUTCString/name.js b/js/src/tests/test262/built-ins/Date/prototype/toUTCString/name.js index 96fb0dce00..33e1c0fffe 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/toUTCString/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/toUTCString/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.toUTCString.name, "toUTCString"); - -verifyNotEnumerable(Date.prototype.toUTCString, "name"); -verifyNotWritable(Date.prototype.toUTCString, "name"); -verifyConfigurable(Date.prototype.toUTCString, "name"); +verifyProperty(Date.prototype.toUTCString, "name", { + value: "toUTCString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/toUTCString/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/toUTCString/not-a-constructor.js index 7c944cd036..6d6088c60c 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/toUTCString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/toUTCString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.toUTCString(); -}, '`let date = new Date(Date.now()); new date.toUTCString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/valueOf/name.js b/js/src/tests/test262/built-ins/Date/prototype/valueOf/name.js index e1e16eb74b..04efdd6d3f 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/valueOf/name.js +++ b/js/src/tests/test262/built-ins/Date/prototype/valueOf/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Date.prototype.valueOf.name, "valueOf"); - -verifyNotEnumerable(Date.prototype.valueOf, "name"); -verifyNotWritable(Date.prototype.valueOf, "name"); -verifyConfigurable(Date.prototype.valueOf, "name"); +verifyProperty(Date.prototype.valueOf, "name", { + value: "valueOf", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/prototype/valueOf/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/prototype/valueOf/not-a-constructor.js index 5e333ff19e..ee2d0146ce 100644 --- a/js/src/tests/test262/built-ins/Date/prototype/valueOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Date/prototype/valueOf/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let date = new Date(Date.now()); new date.valueOf(); -}, '`let date = new Date(Date.now()); new date.valueOf()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Error/prototype/toString/length.js b/js/src/tests/test262/built-ins/Error/prototype/toString/length.js index 0f6d033b73..faad9af1be 100644 --- a/js/src/tests/test262/built-ins/Error/prototype/toString/length.js +++ b/js/src/tests/test262/built-ins/Error/prototype/toString/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Error.prototype.toString.length, 0); - -verifyNotEnumerable(Error.prototype.toString, "length"); -verifyNotWritable(Error.prototype.toString, "length"); -verifyConfigurable(Error.prototype.toString, "length"); +verifyProperty(Error.prototype.toString, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Error/prototype/toString/name.js b/js/src/tests/test262/built-ins/Error/prototype/toString/name.js index 8896e27dcf..23bdcd8c84 100644 --- a/js/src/tests/test262/built-ins/Error/prototype/toString/name.js +++ b/js/src/tests/test262/built-ins/Error/prototype/toString/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Error.prototype.toString.name, "toString"); - -verifyNotEnumerable(Error.prototype.toString, "name"); -verifyNotWritable(Error.prototype.toString, "name"); -verifyConfigurable(Error.prototype.toString, "name"); +verifyProperty(Error.prototype.toString, "name", { + value: "toString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Error/prototype/toString/not-a-constructor.js b/js/src/tests/test262/built-ins/Error/prototype/toString/not-a-constructor.js index 884c05e62e..c4eb05f6c7 100644 --- a/js/src/tests/test262/built-ins/Error/prototype/toString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Error/prototype/toString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Error.prototype.toString(); -}, '`new Error.prototype.toString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/FinalizationRegistry/prototype/cleanupSome/not-a-constructor.js b/js/src/tests/test262/built-ins/FinalizationRegistry/prototype/cleanupSome/not-a-constructor.js index 12c979cc12..edceeb8d6b 100644 --- a/js/src/tests/test262/built-ins/FinalizationRegistry/prototype/cleanupSome/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/FinalizationRegistry/prototype/cleanupSome/not-a-constructor.js @@ -30,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let fr = new FinalizationRegistry(() => {}); new fr.cleanupSome(() => {}); -}, '`let fr = new FinalizationRegistry(() => {}); new fr.cleanupSome(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/FinalizationRegistry/prototype/register/not-a-constructor.js b/js/src/tests/test262/built-ins/FinalizationRegistry/prototype/register/not-a-constructor.js index f2471782ab..60e16a1df6 100644 --- a/js/src/tests/test262/built-ins/FinalizationRegistry/prototype/register/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/FinalizationRegistry/prototype/register/not-a-constructor.js @@ -30,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let fr = new FinalizationRegistry(() => {}); new fr.register({}); -}, '`let fr = new FinalizationRegistry(() => {}); new fr.register({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/FinalizationRegistry/prototype/unregister/not-a-constructor.js b/js/src/tests/test262/built-ins/FinalizationRegistry/prototype/unregister/not-a-constructor.js index ea51595556..14ab4862c8 100644 --- a/js/src/tests/test262/built-ins/FinalizationRegistry/prototype/unregister/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/FinalizationRegistry/prototype/unregister/not-a-constructor.js @@ -30,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let fr = new FinalizationRegistry(() => {}); let token = {}; fr.register(token); new fr.unregister(token); -}, '`let fr = new FinalizationRegistry(() => {}); let token = {}; fr.register(token); new fr.unregister(token)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Function/prototype/Symbol.hasInstance/length.js b/js/src/tests/test262/built-ins/Function/prototype/Symbol.hasInstance/length.js index 7a482b0d73..dff2e7bb58 100644 --- a/js/src/tests/test262/built-ins/Function/prototype/Symbol.hasInstance/length.js +++ b/js/src/tests/test262/built-ins/Function/prototype/Symbol.hasInstance/length.js @@ -19,10 +19,11 @@ features: [Symbol.hasInstance] includes: [propertyHelper.js] ---*/ -assert.sameValue(Function.prototype[Symbol.hasInstance].length, 1); - -verifyNotEnumerable(Function.prototype[Symbol.hasInstance], 'length'); -verifyNotWritable(Function.prototype[Symbol.hasInstance], 'length'); -verifyConfigurable(Function.prototype[Symbol.hasInstance], 'length'); +verifyProperty(Function.prototype[Symbol.hasInstance], "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Function/prototype/Symbol.hasInstance/name.js b/js/src/tests/test262/built-ins/Function/prototype/Symbol.hasInstance/name.js index 13f5f41f9f..72ba2d6b34 100644 --- a/js/src/tests/test262/built-ins/Function/prototype/Symbol.hasInstance/name.js +++ b/js/src/tests/test262/built-ins/Function/prototype/Symbol.hasInstance/name.js @@ -10,12 +10,11 @@ features: [Symbol.hasInstance] includes: [propertyHelper.js] ---*/ -assert.sameValue( - Function.prototype[Symbol.hasInstance].name, '[Symbol.hasInstance]' -); - -verifyNotEnumerable(Function.prototype[Symbol.hasInstance], 'name'); -verifyNotWritable(Function.prototype[Symbol.hasInstance], 'name'); -verifyConfigurable(Function.prototype[Symbol.hasInstance], 'name'); +verifyProperty(Function.prototype[Symbol.hasInstance], "name", { + value: "[Symbol.hasInstance]", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Function/prototype/apply/name.js b/js/src/tests/test262/built-ins/Function/prototype/apply/name.js index 528cf8f58a..f12cde6de0 100644 --- a/js/src/tests/test262/built-ins/Function/prototype/apply/name.js +++ b/js/src/tests/test262/built-ins/Function/prototype/apply/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Function.prototype.apply.name, "apply"); - -verifyNotEnumerable(Function.prototype.apply, "name"); -verifyNotWritable(Function.prototype.apply, "name"); -verifyConfigurable(Function.prototype.apply, "name"); +verifyProperty(Function.prototype.apply, "name", { + value: "apply", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Function/prototype/apply/not-a-constructor.js b/js/src/tests/test262/built-ins/Function/prototype/apply/not-a-constructor.js index 43275e54f0..8adbf6bce4 100644 --- a/js/src/tests/test262/built-ins/Function/prototype/apply/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Function/prototype/apply/not-a-constructor.js @@ -29,10 +29,10 @@ assert.sameValue( assert.throws(TypeError, () => { new Function.prototype.apply; -}, '`new Function.prototype.apply` throws TypeError'); +}); assert.throws(TypeError, () => { new Function.prototype.apply(); -}, '`new Function.prototype.apply()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Function/prototype/bind/name.js b/js/src/tests/test262/built-ins/Function/prototype/bind/name.js index d9f70e68a4..634d4d95a7 100644 --- a/js/src/tests/test262/built-ins/Function/prototype/bind/name.js +++ b/js/src/tests/test262/built-ins/Function/prototype/bind/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Function.prototype.bind.name, "bind"); - -verifyNotEnumerable(Function.prototype.bind, "name"); -verifyNotWritable(Function.prototype.bind, "name"); -verifyConfigurable(Function.prototype.bind, "name"); +verifyProperty(Function.prototype.bind, "name", { + value: "bind", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Function/prototype/bind/not-a-constructor.js b/js/src/tests/test262/built-ins/Function/prototype/bind/not-a-constructor.js index 22f63d1ade..556e2e474a 100644 --- a/js/src/tests/test262/built-ins/Function/prototype/bind/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Function/prototype/bind/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Function.prototype.bind(); -}, '`new Function.prototype.bind()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Function/prototype/call/name.js b/js/src/tests/test262/built-ins/Function/prototype/call/name.js index d919573ff9..7f121d7235 100644 --- a/js/src/tests/test262/built-ins/Function/prototype/call/name.js +++ b/js/src/tests/test262/built-ins/Function/prototype/call/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Function.prototype.call.name, "call"); - -verifyNotEnumerable(Function.prototype.call, "name"); -verifyNotWritable(Function.prototype.call, "name"); -verifyConfigurable(Function.prototype.call, "name"); +verifyProperty(Function.prototype.call, "name", { + value: "call", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Function/prototype/call/not-a-constructor.js b/js/src/tests/test262/built-ins/Function/prototype/call/not-a-constructor.js index 1ae179235e..7e90f7fee7 100644 --- a/js/src/tests/test262/built-ins/Function/prototype/call/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Function/prototype/call/not-a-constructor.js @@ -29,11 +29,11 @@ assert.sameValue( assert.throws(TypeError, () => { new Function.prototype.call(); -}, '`new Function.prototype.call()` throws TypeError'); +}); assert.throws(TypeError, () => { new Function.prototype.call; -}, '`new Function.prototype.call` throws TypeError'); +}); var call = Function.prototype.call; assert.throws(TypeError, () => { diff --git a/js/src/tests/test262/built-ins/Function/prototype/name.js b/js/src/tests/test262/built-ins/Function/prototype/name.js index 653145db42..0a0d150fe7 100644 --- a/js/src/tests/test262/built-ins/Function/prototype/name.js +++ b/js/src/tests/test262/built-ins/Function/prototype/name.js @@ -16,9 +16,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Function.prototype.name, ''); -verifyNotEnumerable(Function.prototype, 'name'); -verifyNotWritable(Function.prototype, 'name'); -verifyConfigurable(Function.prototype, 'name'); +verifyProperty(Function.prototype, "name", { + value: "", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Function/prototype/toString/name.js b/js/src/tests/test262/built-ins/Function/prototype/toString/name.js index dc6751fd68..c16ded664e 100644 --- a/js/src/tests/test262/built-ins/Function/prototype/toString/name.js +++ b/js/src/tests/test262/built-ins/Function/prototype/toString/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Function.prototype.toString.name, "toString"); - -verifyNotEnumerable(Function.prototype.toString, "name"); -verifyNotWritable(Function.prototype.toString, "name"); -verifyConfigurable(Function.prototype.toString, "name"); +verifyProperty(Function.prototype.toString, "name", { + value: "toString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Function/prototype/toString/not-a-constructor.js b/js/src/tests/test262/built-ins/Function/prototype/toString/not-a-constructor.js index b13c0c51a2..6384ad81df 100644 --- a/js/src/tests/test262/built-ins/Function/prototype/toString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Function/prototype/toString/not-a-constructor.js @@ -29,11 +29,11 @@ assert.sameValue( assert.throws(TypeError, () => { new Function.prototype.toString(); -}, '`new Function.prototype.toString()` throws TypeError'); +}); var toString = Function.prototype.toString; assert.throws(TypeError, () => { new toString; -}, '`new toString` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/GeneratorFunction/length.js b/js/src/tests/test262/built-ins/GeneratorFunction/length.js index 578af8be55..6da929bd7e 100644 --- a/js/src/tests/test262/built-ins/GeneratorFunction/length.js +++ b/js/src/tests/test262/built-ins/GeneratorFunction/length.js @@ -11,10 +11,11 @@ features: [generators] var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; -assert.sameValue(GeneratorFunction.length, 1); - -verifyNotEnumerable(GeneratorFunction, 'length'); -verifyNotWritable(GeneratorFunction, 'length'); -verifyConfigurable(GeneratorFunction, 'length'); +verifyProperty(GeneratorFunction, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/GeneratorFunction/name.js b/js/src/tests/test262/built-ins/GeneratorFunction/name.js index 3025416d2c..de3491513c 100644 --- a/js/src/tests/test262/built-ins/GeneratorFunction/name.js +++ b/js/src/tests/test262/built-ins/GeneratorFunction/name.js @@ -21,10 +21,11 @@ features: [generators] var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; -assert.sameValue(GeneratorFunction.name, 'GeneratorFunction'); - -verifyNotEnumerable(GeneratorFunction, 'name'); -verifyNotWritable(GeneratorFunction, 'name'); -verifyConfigurable(GeneratorFunction, 'name'); +verifyProperty(GeneratorFunction, "name", { + value: "GeneratorFunction", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/GeneratorPrototype/next/length.js b/js/src/tests/test262/built-ins/GeneratorPrototype/next/length.js index d4bbe4aaad..630d5cde07 100644 --- a/js/src/tests/test262/built-ins/GeneratorPrototype/next/length.js +++ b/js/src/tests/test262/built-ins/GeneratorPrototype/next/length.js @@ -26,10 +26,11 @@ features: [generators] function* g() {} var GeneratorPrototype = Object.getPrototypeOf(g).prototype; -assert.sameValue(GeneratorPrototype.next.length, 1); - -verifyNotEnumerable(GeneratorPrototype.next, "length"); -verifyNotWritable(GeneratorPrototype.next, "length"); -verifyConfigurable(GeneratorPrototype.next, "length"); +verifyProperty(GeneratorPrototype.next, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/GeneratorPrototype/next/name.js b/js/src/tests/test262/built-ins/GeneratorPrototype/next/name.js index e52239af1a..f29ac96536 100644 --- a/js/src/tests/test262/built-ins/GeneratorPrototype/next/name.js +++ b/js/src/tests/test262/built-ins/GeneratorPrototype/next/name.js @@ -23,10 +23,11 @@ features: [generators] function* g() {} var GeneratorPrototype = Object.getPrototypeOf(g).prototype; -assert.sameValue(GeneratorPrototype.next.name, "next"); - -verifyNotEnumerable(GeneratorPrototype.next, "name"); -verifyNotWritable(GeneratorPrototype.next, "name"); -verifyConfigurable(GeneratorPrototype.next, "name"); +verifyProperty(GeneratorPrototype.next, "name", { + value: "next", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/GeneratorPrototype/next/not-a-constructor.js b/js/src/tests/test262/built-ins/GeneratorPrototype/next/not-a-constructor.js index 49865588f8..3a8fd1b22f 100644 --- a/js/src/tests/test262/built-ins/GeneratorPrototype/next/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/GeneratorPrototype/next/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { function* g() {} let iterator = g(); new iterator.next(); -}, '`function* g() {} let iterator = g(); new iterator.next()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/GeneratorPrototype/return/length.js b/js/src/tests/test262/built-ins/GeneratorPrototype/return/length.js index a3f8f38369..6fa35a482a 100644 --- a/js/src/tests/test262/built-ins/GeneratorPrototype/return/length.js +++ b/js/src/tests/test262/built-ins/GeneratorPrototype/return/length.js @@ -26,10 +26,11 @@ features: [generators] function* g() {} var GeneratorPrototype = Object.getPrototypeOf(g).prototype; -assert.sameValue(GeneratorPrototype.return.length, 1); - -verifyNotEnumerable(GeneratorPrototype.return, "length"); -verifyNotWritable(GeneratorPrototype.return, "length"); -verifyConfigurable(GeneratorPrototype.return, "length"); +verifyProperty(GeneratorPrototype.return, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/GeneratorPrototype/return/name.js b/js/src/tests/test262/built-ins/GeneratorPrototype/return/name.js index e1b4512522..dfb90b17ba 100644 --- a/js/src/tests/test262/built-ins/GeneratorPrototype/return/name.js +++ b/js/src/tests/test262/built-ins/GeneratorPrototype/return/name.js @@ -23,10 +23,11 @@ features: [generators] function* g() {} var GeneratorPrototype = Object.getPrototypeOf(g).prototype; -assert.sameValue(GeneratorPrototype.return.name, "return"); - -verifyNotEnumerable(GeneratorPrototype.return, "name"); -verifyNotWritable(GeneratorPrototype.return, "name"); -verifyConfigurable(GeneratorPrototype.return, "name"); +verifyProperty(GeneratorPrototype.return, "name", { + value: "return", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/GeneratorPrototype/return/not-a-constructor.js b/js/src/tests/test262/built-ins/GeneratorPrototype/return/not-a-constructor.js index 4c0f2b56b8..424ee0bc22 100644 --- a/js/src/tests/test262/built-ins/GeneratorPrototype/return/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/GeneratorPrototype/return/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { function* g() {} let iterator = g(); new iterator.return(); -}, '`function* g() {} let iterator = g(); new iterator.return()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/GeneratorPrototype/throw/length.js b/js/src/tests/test262/built-ins/GeneratorPrototype/throw/length.js index 75c2f6b2a3..6a933bb835 100644 --- a/js/src/tests/test262/built-ins/GeneratorPrototype/throw/length.js +++ b/js/src/tests/test262/built-ins/GeneratorPrototype/throw/length.js @@ -26,10 +26,11 @@ features: [generators] function* g() {} var GeneratorPrototype = Object.getPrototypeOf(g).prototype; -assert.sameValue(GeneratorPrototype.throw.length, 1); - -verifyNotEnumerable(GeneratorPrototype.throw, "length"); -verifyNotWritable(GeneratorPrototype.throw, "length"); -verifyConfigurable(GeneratorPrototype.throw, "length"); +verifyProperty(GeneratorPrototype.throw, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/GeneratorPrototype/throw/name.js b/js/src/tests/test262/built-ins/GeneratorPrototype/throw/name.js index d167bbc1cc..93bc41696d 100644 --- a/js/src/tests/test262/built-ins/GeneratorPrototype/throw/name.js +++ b/js/src/tests/test262/built-ins/GeneratorPrototype/throw/name.js @@ -23,10 +23,11 @@ features: [generators] function* g() {} var GeneratorPrototype = Object.getPrototypeOf(g).prototype; -assert.sameValue(GeneratorPrototype.throw.name, "throw"); - -verifyNotEnumerable(GeneratorPrototype.throw, "name"); -verifyNotWritable(GeneratorPrototype.throw, "name"); -verifyConfigurable(GeneratorPrototype.throw, "name"); +verifyProperty(GeneratorPrototype.throw, "name", { + value: "throw", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/GeneratorPrototype/throw/not-a-constructor.js b/js/src/tests/test262/built-ins/GeneratorPrototype/throw/not-a-constructor.js index d8d39a4db5..e7702e6f5d 100644 --- a/js/src/tests/test262/built-ins/GeneratorPrototype/throw/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/GeneratorPrototype/throw/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { function* g() {} let expected = new Test262Error(); let iterator = g();try {new iterator.throw(expected);} catch (e) {if (e !== expected) {throw e;}} -}, '`function* g() {} let expected = new Test262Error(); let iterator = g();try {new iterator.throw(expected);} catch (e) {if (e !== expected) {throw e;}}` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/JSON/parse/not-a-constructor.js b/js/src/tests/test262/built-ins/JSON/parse/not-a-constructor.js index d46040d8a3..c91310802a 100644 --- a/js/src/tests/test262/built-ins/JSON/parse/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/JSON/parse/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(JSON.parse), false, 'isConstructor(JSON.parse) mu assert.throws(TypeError, () => { new JSON.parse('{}'); -}, '`new JSON.parse(\'{}\')` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/JSON/stringify/not-a-constructor.js b/js/src/tests/test262/built-ins/JSON/stringify/not-a-constructor.js index 2458cdaf4a..41d024649f 100644 --- a/js/src/tests/test262/built-ins/JSON/stringify/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/JSON/stringify/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(JSON.stringify), false, 'isConstructor(JSON.strin assert.throws(TypeError, () => { new JSON.stringify({}); -}, '`new JSON.stringify({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/Symbol.species/length.js b/js/src/tests/test262/built-ins/Map/Symbol.species/length.js index d606baeca6..e731ed261b 100644 --- a/js/src/tests/test262/built-ins/Map/Symbol.species/length.js +++ b/js/src/tests/test262/built-ins/Map/Symbol.species/length.js @@ -25,10 +25,11 @@ features: [Symbol.species] var desc = Object.getOwnPropertyDescriptor(Map, 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/Map/groupBy/string.js b/js/src/tests/test262/built-ins/Map/groupBy/string.js new file mode 100644 index 0000000000..15a2410c5c --- /dev/null +++ b/js/src/tests/test262/built-ins/Map/groupBy/string.js @@ -0,0 +1,24 @@ +// Copyright (c) 2023 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-map.groupby +description: Map.groupBy works for string items +info: | + Map.groupBy ( items, callbackfn ) + ... +includes: [compareArray.js] +features: [array-grouping, Map] +---*/ + +const string = '🥰💩🙏😈'; + +const map = Map.groupBy(string, function (char) { + return char < '🙏' ? 'before' : 'after'; +}); + +assert.compareArray(Array.from(map.keys()), ['after', 'before']); +assert.compareArray(map.get('before'), ['💩', '😈']); +assert.compareArray(map.get('after'), ['🥰', '🙏']); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/length.js b/js/src/tests/test262/built-ins/Map/length.js index c63939508b..5beb5cfe52 100644 --- a/js/src/tests/test262/built-ins/Map/length.js +++ b/js/src/tests/test262/built-ins/Map/length.js @@ -10,10 +10,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Map.length, 0, 'The value of Map.length is 0'); - -verifyNotEnumerable(Map, 'length'); -verifyNotWritable(Map, 'length'); -verifyConfigurable(Map, 'length'); +verifyProperty(Map, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/name.js b/js/src/tests/test262/built-ins/Map/name.js index 4ff6542786..7960aeb7bf 100644 --- a/js/src/tests/test262/built-ins/Map/name.js +++ b/js/src/tests/test262/built-ins/Map/name.js @@ -11,10 +11,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Map.name, 'Map', 'The value of Map.name is "Map"'); - -verifyNotEnumerable(Map, 'name'); -verifyNotWritable(Map, 'name'); -verifyConfigurable(Map, 'name'); +verifyProperty(Map, "name", { + value: "Map", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/Symbol.iterator/not-a-constructor.js b/js/src/tests/test262/built-ins/Map/prototype/Symbol.iterator/not-a-constructor.js index 9a8bb37858..1dc8d266ce 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/Symbol.iterator/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Map/prototype/Symbol.iterator/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let m = new Map(); new m[Symbol.iterator](); -}, '`let m = new Map(); new m[Symbol.iterator]()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/clear/length.js b/js/src/tests/test262/built-ins/Map/prototype/clear/length.js index 7cc8f3126f..a6511ad387 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/clear/length.js +++ b/js/src/tests/test262/built-ins/Map/prototype/clear/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.clear.length, 0, - 'The value of `Map.prototype.clear.length` is `0`' -); - -verifyNotEnumerable(Map.prototype.clear, 'length'); -verifyNotWritable(Map.prototype.clear, 'length'); -verifyConfigurable(Map.prototype.clear, 'length'); +verifyProperty(Map.prototype.clear, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/clear/name.js b/js/src/tests/test262/built-ins/Map/prototype/clear/name.js index 0bef8b8fe7..eb35f09627 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/clear/name.js +++ b/js/src/tests/test262/built-ins/Map/prototype/clear/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.clear.name, 'clear', - 'The value of `Map.prototype.clear.name` is `"clear"`' -); - -verifyNotEnumerable(Map.prototype.clear, 'name'); -verifyNotWritable(Map.prototype.clear, 'name'); -verifyConfigurable(Map.prototype.clear, 'name'); +verifyProperty(Map.prototype.clear, "name", { + value: "clear", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/clear/not-a-constructor.js b/js/src/tests/test262/built-ins/Map/prototype/clear/not-a-constructor.js index 9567b58b7b..651643d1f4 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/clear/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Map/prototype/clear/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Map.prototype.clear), false, 'isConstructor(Map.p assert.throws(TypeError, () => { let m = new Map(); new m.clear(); -}, '`let m = new Map(); new m.clear()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/delete/length.js b/js/src/tests/test262/built-ins/Map/prototype/delete/length.js index 2be05ee2b1..27c629003a 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/delete/length.js +++ b/js/src/tests/test262/built-ins/Map/prototype/delete/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.delete.length, 1, - 'The value of `Map.prototype.delete.length` is `1`' -); - -verifyNotEnumerable(Map.prototype.delete, 'length'); -verifyNotWritable(Map.prototype.delete, 'length'); -verifyConfigurable(Map.prototype.delete, 'length'); +verifyProperty(Map.prototype.delete, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/delete/name.js b/js/src/tests/test262/built-ins/Map/prototype/delete/name.js index dcacf4f3ee..95ca61a4ef 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/delete/name.js +++ b/js/src/tests/test262/built-ins/Map/prototype/delete/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.delete.name, 'delete', - 'The value of `Map.prototype.delete.name` is `"delete"`' -); - -verifyNotEnumerable(Map.prototype.delete, 'name'); -verifyNotWritable(Map.prototype.delete, 'name'); -verifyConfigurable(Map.prototype.delete, 'name'); +verifyProperty(Map.prototype.delete, "name", { + value: "delete", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/delete/not-a-constructor.js b/js/src/tests/test262/built-ins/Map/prototype/delete/not-a-constructor.js index fb43d0a430..3cc5490f94 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/delete/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Map/prototype/delete/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Map.prototype.delete), false, 'isConstructor(Map. assert.throws(TypeError, () => { let m = new Map(); new m.delete(); -}, '`let m = new Map(); new m.delete()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/entries/length.js b/js/src/tests/test262/built-ins/Map/prototype/entries/length.js index 593e918133..e71b580b0a 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/entries/length.js +++ b/js/src/tests/test262/built-ins/Map/prototype/entries/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.entries.length, 0, - 'The value of `Map.prototype.entries.length` is `0`' -); - -verifyNotEnumerable(Map.prototype.entries, 'length'); -verifyNotWritable(Map.prototype.entries, 'length'); -verifyConfigurable(Map.prototype.entries, 'length'); +verifyProperty(Map.prototype.entries, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/entries/name.js b/js/src/tests/test262/built-ins/Map/prototype/entries/name.js index 533b2fa97e..c9f8960a93 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/entries/name.js +++ b/js/src/tests/test262/built-ins/Map/prototype/entries/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.entries.name, 'entries', - 'The value of `Map.prototype.entries.name` is `"entries"`' -); - -verifyNotEnumerable(Map.prototype.entries, 'name'); -verifyNotWritable(Map.prototype.entries, 'name'); -verifyConfigurable(Map.prototype.entries, 'name'); +verifyProperty(Map.prototype.entries, "name", { + value: "entries", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/entries/not-a-constructor.js b/js/src/tests/test262/built-ins/Map/prototype/entries/not-a-constructor.js index 087ce39b98..e296e9d23a 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/entries/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Map/prototype/entries/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let m = new Map(); new m.entries(); -}, '`let m = new Map(); new m.entries()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/forEach/length.js b/js/src/tests/test262/built-ins/Map/prototype/forEach/length.js index d0e0c95dc8..18d0cef5fe 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/forEach/length.js +++ b/js/src/tests/test262/built-ins/Map/prototype/forEach/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.forEach.length, 1, - 'The value of `Map.prototype.forEach.length` is `1`' -); - -verifyNotEnumerable(Map.prototype.forEach, 'length'); -verifyNotWritable(Map.prototype.forEach, 'length'); -verifyConfigurable(Map.prototype.forEach, 'length'); +verifyProperty(Map.prototype.forEach, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/forEach/name.js b/js/src/tests/test262/built-ins/Map/prototype/forEach/name.js index ea6f8c57fd..26a5e70fb6 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/forEach/name.js +++ b/js/src/tests/test262/built-ins/Map/prototype/forEach/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.forEach.name, 'forEach', - 'The value of `Map.prototype.forEach.name` is `"forEach"`' -); - -verifyNotEnumerable(Map.prototype.forEach, 'name'); -verifyNotWritable(Map.prototype.forEach, 'name'); -verifyConfigurable(Map.prototype.forEach, 'name'); +verifyProperty(Map.prototype.forEach, "name", { + value: "forEach", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/forEach/not-a-constructor.js b/js/src/tests/test262/built-ins/Map/prototype/forEach/not-a-constructor.js index 0a113f9d68..22b601eb64 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/forEach/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Map/prototype/forEach/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let m = new Map(); new m.forEach(); -}, '`let m = new Map(); new m.forEach()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/get/length.js b/js/src/tests/test262/built-ins/Map/prototype/get/length.js index 4d6e66ffcb..e08afe8d05 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/get/length.js +++ b/js/src/tests/test262/built-ins/Map/prototype/get/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.get.length, 1, - 'The value of `Map.prototype.get.length` is `1`' -); - -verifyNotEnumerable(Map.prototype.get, 'length'); -verifyNotWritable(Map.prototype.get, 'length'); -verifyConfigurable(Map.prototype.get, 'length'); +verifyProperty(Map.prototype.get, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/get/name.js b/js/src/tests/test262/built-ins/Map/prototype/get/name.js index ef63a260ee..9e1fd2773e 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/get/name.js +++ b/js/src/tests/test262/built-ins/Map/prototype/get/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.get.name, 'get', - 'The value of `Map.prototype.get.name` is `"get"`' -); - -verifyNotEnumerable(Map.prototype.get, 'name'); -verifyNotWritable(Map.prototype.get, 'name'); -verifyConfigurable(Map.prototype.get, 'name'); +verifyProperty(Map.prototype.get, "name", { + value: "get", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/get/not-a-constructor.js b/js/src/tests/test262/built-ins/Map/prototype/get/not-a-constructor.js index 9bc9b965e2..89a5b51a99 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/get/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Map/prototype/get/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Map.prototype.get), false, 'isConstructor(Map.pro assert.throws(TypeError, () => { let m = new Map(); new m.get(); -}, '`let m = new Map(); new m.get()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/has/length.js b/js/src/tests/test262/built-ins/Map/prototype/has/length.js index d5e9b5b48e..3326625b1f 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/has/length.js +++ b/js/src/tests/test262/built-ins/Map/prototype/has/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.has.length, 1, - 'The value of `Map.prototype.has.length` is `1`' -); - -verifyNotEnumerable(Map.prototype.has, 'length'); -verifyNotWritable(Map.prototype.has, 'length'); -verifyConfigurable(Map.prototype.has, 'length'); +verifyProperty(Map.prototype.has, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/has/name.js b/js/src/tests/test262/built-ins/Map/prototype/has/name.js index 82e1dc3f01..5b406a0d68 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/has/name.js +++ b/js/src/tests/test262/built-ins/Map/prototype/has/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.has.name, 'has', - 'The value of `Map.prototype.has.name` is `"has"`' -); - -verifyNotEnumerable(Map.prototype.has, 'name'); -verifyNotWritable(Map.prototype.has, 'name'); -verifyConfigurable(Map.prototype.has, 'name'); +verifyProperty(Map.prototype.has, "name", { + value: "has", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/has/not-a-constructor.js b/js/src/tests/test262/built-ins/Map/prototype/has/not-a-constructor.js index 6f1d7d9253..1c5b82eb6a 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/has/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Map/prototype/has/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Map.prototype.has), false, 'isConstructor(Map.pro assert.throws(TypeError, () => { let m = new Map(); new m.has(); -}, '`let m = new Map(); new m.has()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/keys/length.js b/js/src/tests/test262/built-ins/Map/prototype/keys/length.js index 6a5c19fd96..48ff475b45 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/keys/length.js +++ b/js/src/tests/test262/built-ins/Map/prototype/keys/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.keys.length, 0, - 'The value of `Map.prototype.keys.length` is `0`' -); - -verifyNotEnumerable(Map.prototype.keys, 'length'); -verifyNotWritable(Map.prototype.keys, 'length'); -verifyConfigurable(Map.prototype.keys, 'length'); +verifyProperty(Map.prototype.keys, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/keys/name.js b/js/src/tests/test262/built-ins/Map/prototype/keys/name.js index ce3aa46661..98926ff056 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/keys/name.js +++ b/js/src/tests/test262/built-ins/Map/prototype/keys/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.keys.name, 'keys', - 'The value of `Map.prototype.keys.name` is `"keys"`' -); - -verifyNotEnumerable(Map.prototype.keys, 'name'); -verifyNotWritable(Map.prototype.keys, 'name'); -verifyConfigurable(Map.prototype.keys, 'name'); +verifyProperty(Map.prototype.keys, "name", { + value: "keys", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/keys/not-a-constructor.js b/js/src/tests/test262/built-ins/Map/prototype/keys/not-a-constructor.js index be9835b84e..f1a6403627 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/keys/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Map/prototype/keys/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Map.prototype.keys), false, 'isConstructor(Map.pr assert.throws(TypeError, () => { let m = new Map(); new m.keys(); -}, '`let m = new Map(); new m.keys()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/set/length.js b/js/src/tests/test262/built-ins/Map/prototype/set/length.js index 939b633c34..5039937eda 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/set/length.js +++ b/js/src/tests/test262/built-ins/Map/prototype/set/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.set.length, 2, - 'The value of `Map.prototype.set.length` is `2`' -); - -verifyNotEnumerable(Map.prototype.set, 'length'); -verifyNotWritable(Map.prototype.set, 'length'); -verifyConfigurable(Map.prototype.set, 'length'); +verifyProperty(Map.prototype.set, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/set/name.js b/js/src/tests/test262/built-ins/Map/prototype/set/name.js index 7c0b83f696..d326a6a3da 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/set/name.js +++ b/js/src/tests/test262/built-ins/Map/prototype/set/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.set.name, 'set', - 'The value of `Map.prototype.set.name` is `"set"`' -); - -verifyNotEnumerable(Map.prototype.set, 'name'); -verifyNotWritable(Map.prototype.set, 'name'); -verifyConfigurable(Map.prototype.set, 'name'); +verifyProperty(Map.prototype.set, "name", { + value: "set", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/set/not-a-constructor.js b/js/src/tests/test262/built-ins/Map/prototype/set/not-a-constructor.js index 2880254c25..0b5dbb5e42 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/set/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Map/prototype/set/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Map.prototype.set), false, 'isConstructor(Map.pro assert.throws(TypeError, () => { let m = new Map(); new m.set(); -}, '`let m = new Map(); new m.set()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/size/length.js b/js/src/tests/test262/built-ins/Map/prototype/size/length.js index b3812e1ec6..2d234c649b 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/size/length.js +++ b/js/src/tests/test262/built-ins/Map/prototype/size/length.js @@ -13,13 +13,11 @@ includes: [propertyHelper.js] var descriptor = Object.getOwnPropertyDescriptor(Map.prototype, 'size'); -assert.sameValue( - descriptor.get.length, 0, - 'The value of `Map.prototype.size.length` is `0`' -); - -verifyNotEnumerable(descriptor.get, 'length'); -verifyNotWritable(descriptor.get, 'length'); -verifyConfigurable(descriptor.get, 'length'); +verifyProperty(descriptor.get, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/size/name.js b/js/src/tests/test262/built-ins/Map/prototype/size/name.js index 596e1a23c5..a594d7561b 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/size/name.js +++ b/js/src/tests/test262/built-ins/Map/prototype/size/name.js @@ -17,13 +17,11 @@ includes: [propertyHelper.js] var descriptor = Object.getOwnPropertyDescriptor(Map.prototype, 'size'); -assert.sameValue(descriptor.get.name, - 'get size', - 'The value of `descriptor.get.name` is `get size`' -); - -verifyNotEnumerable(descriptor.get, 'name'); -verifyNotWritable(descriptor.get, 'name'); -verifyConfigurable(descriptor.get, 'name'); +verifyProperty(descriptor.get, "name", { + value: "get size", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/values/length.js b/js/src/tests/test262/built-ins/Map/prototype/values/length.js index 304cdd7983..e647192bd8 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/values/length.js +++ b/js/src/tests/test262/built-ins/Map/prototype/values/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.values.length, 0, - 'The value of `Map.prototype.values.length` is `0`' -); - -verifyNotEnumerable(Map.prototype.values, 'length'); -verifyNotWritable(Map.prototype.values, 'length'); -verifyConfigurable(Map.prototype.values, 'length'); +verifyProperty(Map.prototype.values, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/values/name.js b/js/src/tests/test262/built-ins/Map/prototype/values/name.js index 03827d01f3..c07ffcdcdb 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/values/name.js +++ b/js/src/tests/test262/built-ins/Map/prototype/values/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Map.prototype.values.name, 'values', - 'The value of `Map.prototype.values.name` is `"values"`' -); - -verifyNotEnumerable(Map.prototype.values, 'name'); -verifyNotWritable(Map.prototype.values, 'name'); -verifyConfigurable(Map.prototype.values, 'name'); +verifyProperty(Map.prototype.values, "name", { + value: "values", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Map/prototype/values/not-a-constructor.js b/js/src/tests/test262/built-ins/Map/prototype/values/not-a-constructor.js index 0fd6e656d2..9677e75064 100644 --- a/js/src/tests/test262/built-ins/Map/prototype/values/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Map/prototype/values/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Map.prototype.values), false, 'isConstructor(Map. assert.throws(TypeError, () => { let m = new Map(); new m.values(); -}, '`let m = new Map(); new m.values()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/MapIteratorPrototype/next/length.js b/js/src/tests/test262/built-ins/MapIteratorPrototype/next/length.js index 7617371899..bb50cc1d4c 100644 --- a/js/src/tests/test262/built-ins/MapIteratorPrototype/next/length.js +++ b/js/src/tests/test262/built-ins/MapIteratorPrototype/next/length.js @@ -24,10 +24,11 @@ includes: [propertyHelper.js] var MapIteratorProto = Object.getPrototypeOf(new Map().values()); -assert.sameValue(MapIteratorProto.next.length, 0); - -verifyNotEnumerable(MapIteratorProto.next, "length"); -verifyNotWritable(MapIteratorProto.next, "length"); -verifyConfigurable(MapIteratorProto.next, "length"); +verifyProperty(MapIteratorProto.next, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/MapIteratorPrototype/next/name.js b/js/src/tests/test262/built-ins/MapIteratorPrototype/next/name.js index 5666f8ecc8..d8b1c3192d 100644 --- a/js/src/tests/test262/built-ins/MapIteratorPrototype/next/name.js +++ b/js/src/tests/test262/built-ins/MapIteratorPrototype/next/name.js @@ -21,10 +21,11 @@ includes: [propertyHelper.js] var MapIteratorProto = Object.getPrototypeOf(new Map().values()); -assert.sameValue(MapIteratorProto.next.name, "next"); - -verifyNotEnumerable(MapIteratorProto.next, "name"); -verifyNotWritable(MapIteratorProto.next, "name"); -verifyConfigurable(MapIteratorProto.next, "name"); +verifyProperty(MapIteratorProto.next, "name", { + value: "next", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/abs/length.js b/js/src/tests/test262/built-ins/Math/abs/length.js index 2d031962ae..978f566e95 100644 --- a/js/src/tests/test262/built-ins/Math/abs/length.js +++ b/js/src/tests/test262/built-ins/Math/abs/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.abs.length, 1); - -verifyNotEnumerable(Math.abs, "length"); -verifyNotWritable(Math.abs, "length"); -verifyConfigurable(Math.abs, "length"); +verifyProperty(Math.abs, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/abs/name.js b/js/src/tests/test262/built-ins/Math/abs/name.js index 640f07b811..e95eb98e95 100644 --- a/js/src/tests/test262/built-ins/Math/abs/name.js +++ b/js/src/tests/test262/built-ins/Math/abs/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.abs.name, "abs"); - -verifyNotEnumerable(Math.abs, "name"); -verifyNotWritable(Math.abs, "name"); -verifyConfigurable(Math.abs, "name"); +verifyProperty(Math.abs, "name", { + value: "abs", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/abs/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/abs/not-a-constructor.js index 3fc474119f..abe5fb0acf 100644 --- a/js/src/tests/test262/built-ins/Math/abs/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/abs/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.abs), false, 'isConstructor(Math.abs) must r assert.throws(TypeError, () => { new Math.abs(); -}, '`new Math.abs()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/acos/length.js b/js/src/tests/test262/built-ins/Math/acos/length.js index 0d1fca6e4a..3785de0c0d 100644 --- a/js/src/tests/test262/built-ins/Math/acos/length.js +++ b/js/src/tests/test262/built-ins/Math/acos/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.acos.length, 1); - -verifyNotEnumerable(Math.acos, "length"); -verifyNotWritable(Math.acos, "length"); -verifyConfigurable(Math.acos, "length"); +verifyProperty(Math.acos, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/acos/name.js b/js/src/tests/test262/built-ins/Math/acos/name.js index d441d92d10..1e8059d1eb 100644 --- a/js/src/tests/test262/built-ins/Math/acos/name.js +++ b/js/src/tests/test262/built-ins/Math/acos/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.acos.name, "acos"); - -verifyNotEnumerable(Math.acos, "name"); -verifyNotWritable(Math.acos, "name"); -verifyConfigurable(Math.acos, "name"); +verifyProperty(Math.acos, "name", { + value: "acos", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/acos/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/acos/not-a-constructor.js index 659f497ee4..8d9ef0724b 100644 --- a/js/src/tests/test262/built-ins/Math/acos/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/acos/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.acos), false, 'isConstructor(Math.acos) must assert.throws(TypeError, () => { new Math.acos(); -}, '`new Math.acos()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/acosh/length.js b/js/src/tests/test262/built-ins/Math/acosh/length.js index 10b7e3c234..f24d80e857 100644 --- a/js/src/tests/test262/built-ins/Math/acosh/length.js +++ b/js/src/tests/test262/built-ins/Math/acosh/length.js @@ -18,10 +18,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.acosh.length, 1); - -verifyNotEnumerable(Math.acosh, "length"); -verifyNotWritable(Math.acosh, "length"); -verifyConfigurable(Math.acosh, "length"); +verifyProperty(Math.acosh, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/acosh/name.js b/js/src/tests/test262/built-ins/Math/acosh/name.js index 5ff5df412f..6fce1df3a7 100644 --- a/js/src/tests/test262/built-ins/Math/acosh/name.js +++ b/js/src/tests/test262/built-ins/Math/acosh/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.acosh.name, "acosh"); - -verifyNotEnumerable(Math.acosh, "name"); -verifyNotWritable(Math.acosh, "name"); -verifyConfigurable(Math.acosh, "name"); +verifyProperty(Math.acosh, "name", { + value: "acosh", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/acosh/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/acosh/not-a-constructor.js index b9866a9eb4..3ea47b872e 100644 --- a/js/src/tests/test262/built-ins/Math/acosh/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/acosh/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.acosh), false, 'isConstructor(Math.acosh) mu assert.throws(TypeError, () => { new Math.acosh(); -}, '`new Math.acosh()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/asin/length.js b/js/src/tests/test262/built-ins/Math/asin/length.js index 40ddb05dea..f9287e3728 100644 --- a/js/src/tests/test262/built-ins/Math/asin/length.js +++ b/js/src/tests/test262/built-ins/Math/asin/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.asin.length, 1); - -verifyNotEnumerable(Math.asin, "length"); -verifyNotWritable(Math.asin, "length"); -verifyConfigurable(Math.asin, "length"); +verifyProperty(Math.asin, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/asin/name.js b/js/src/tests/test262/built-ins/Math/asin/name.js index 2d63be0e06..aa051f2a4b 100644 --- a/js/src/tests/test262/built-ins/Math/asin/name.js +++ b/js/src/tests/test262/built-ins/Math/asin/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.asin.name, "asin"); - -verifyNotEnumerable(Math.asin, "name"); -verifyNotWritable(Math.asin, "name"); -verifyConfigurable(Math.asin, "name"); +verifyProperty(Math.asin, "name", { + value: "asin", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/asin/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/asin/not-a-constructor.js index adcadf0892..c2393843e5 100644 --- a/js/src/tests/test262/built-ins/Math/asin/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/asin/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.asin), false, 'isConstructor(Math.asin) must assert.throws(TypeError, () => { new Math.asin(); -}, '`new Math.asin()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/asinh/length.js b/js/src/tests/test262/built-ins/Math/asinh/length.js index 7dcd44f621..56a557c07f 100644 --- a/js/src/tests/test262/built-ins/Math/asinh/length.js +++ b/js/src/tests/test262/built-ins/Math/asinh/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.asinh.length, 1); - -verifyNotEnumerable(Math.asinh, "length"); -verifyNotWritable(Math.asinh, "length"); -verifyConfigurable(Math.asinh, "length"); +verifyProperty(Math.asinh, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/asinh/name.js b/js/src/tests/test262/built-ins/Math/asinh/name.js index 252117b048..fa9bd41b00 100644 --- a/js/src/tests/test262/built-ins/Math/asinh/name.js +++ b/js/src/tests/test262/built-ins/Math/asinh/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.asinh.name, "asinh"); - -verifyNotEnumerable(Math.asinh, "name"); -verifyNotWritable(Math.asinh, "name"); -verifyConfigurable(Math.asinh, "name"); +verifyProperty(Math.asinh, "name", { + value: "asinh", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/asinh/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/asinh/not-a-constructor.js index bfb53cc7ec..97f90884e6 100644 --- a/js/src/tests/test262/built-ins/Math/asinh/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/asinh/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.asinh), false, 'isConstructor(Math.asinh) mu assert.throws(TypeError, () => { new Math.asinh(); -}, '`new Math.asinh()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/atan/length.js b/js/src/tests/test262/built-ins/Math/atan/length.js index e2a3cfc5ad..e3e97785f3 100644 --- a/js/src/tests/test262/built-ins/Math/atan/length.js +++ b/js/src/tests/test262/built-ins/Math/atan/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.atan.length, 1); - -verifyNotEnumerable(Math.atan, "length"); -verifyNotWritable(Math.atan, "length"); -verifyConfigurable(Math.atan, "length"); +verifyProperty(Math.atan, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/atan/name.js b/js/src/tests/test262/built-ins/Math/atan/name.js index 56009ad6fe..a389cc1be3 100644 --- a/js/src/tests/test262/built-ins/Math/atan/name.js +++ b/js/src/tests/test262/built-ins/Math/atan/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.atan.name, "atan"); - -verifyNotEnumerable(Math.atan, "name"); -verifyNotWritable(Math.atan, "name"); -verifyConfigurable(Math.atan, "name"); +verifyProperty(Math.atan, "name", { + value: "atan", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/atan/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/atan/not-a-constructor.js index 0b00568ba9..13ca4783c9 100644 --- a/js/src/tests/test262/built-ins/Math/atan/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/atan/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.atan), false, 'isConstructor(Math.atan) must assert.throws(TypeError, () => { new Math.atan(); -}, '`new Math.atan()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/atan2/length.js b/js/src/tests/test262/built-ins/Math/atan2/length.js index 8255c76783..308f1434b8 100644 --- a/js/src/tests/test262/built-ins/Math/atan2/length.js +++ b/js/src/tests/test262/built-ins/Math/atan2/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.atan2.length, 2); - -verifyNotEnumerable(Math.atan2, "length"); -verifyNotWritable(Math.atan2, "length"); -verifyConfigurable(Math.atan2, "length"); +verifyProperty(Math.atan2, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/atan2/name.js b/js/src/tests/test262/built-ins/Math/atan2/name.js index fef201b98d..b7ddd1bd23 100644 --- a/js/src/tests/test262/built-ins/Math/atan2/name.js +++ b/js/src/tests/test262/built-ins/Math/atan2/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.atan2.name, "atan2"); - -verifyNotEnumerable(Math.atan2, "name"); -verifyNotWritable(Math.atan2, "name"); -verifyConfigurable(Math.atan2, "name"); +verifyProperty(Math.atan2, "name", { + value: "atan2", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/atan2/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/atan2/not-a-constructor.js index 3b8989dd32..554b7e886f 100644 --- a/js/src/tests/test262/built-ins/Math/atan2/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/atan2/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.atan2), false, 'isConstructor(Math.atan2) mu assert.throws(TypeError, () => { new Math.atan2(); -}, '`new Math.atan2()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/atanh/length.js b/js/src/tests/test262/built-ins/Math/atanh/length.js index 7836a19735..df99c46c57 100644 --- a/js/src/tests/test262/built-ins/Math/atanh/length.js +++ b/js/src/tests/test262/built-ins/Math/atanh/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.atanh.length, 1); - -verifyNotEnumerable(Math.atanh, "length"); -verifyNotWritable(Math.atanh, "length"); -verifyConfigurable(Math.atanh, "length"); +verifyProperty(Math.atanh, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/atanh/name.js b/js/src/tests/test262/built-ins/Math/atanh/name.js index f62a0884df..d215638765 100644 --- a/js/src/tests/test262/built-ins/Math/atanh/name.js +++ b/js/src/tests/test262/built-ins/Math/atanh/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.atanh.name, "atanh"); - -verifyNotEnumerable(Math.atanh, "name"); -verifyNotWritable(Math.atanh, "name"); -verifyConfigurable(Math.atanh, "name"); +verifyProperty(Math.atanh, "name", { + value: "atanh", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/atanh/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/atanh/not-a-constructor.js index 1dd566de55..cd2a34d93d 100644 --- a/js/src/tests/test262/built-ins/Math/atanh/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/atanh/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.atanh), false, 'isConstructor(Math.atanh) mu assert.throws(TypeError, () => { new Math.atanh(); -}, '`new Math.atanh()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/cbrt/length.js b/js/src/tests/test262/built-ins/Math/cbrt/length.js index 254fc702d8..e0bc1c181e 100644 --- a/js/src/tests/test262/built-ins/Math/cbrt/length.js +++ b/js/src/tests/test262/built-ins/Math/cbrt/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.cbrt.length, 1); - -verifyNotEnumerable(Math.cbrt, "length"); -verifyNotWritable(Math.cbrt, "length"); -verifyConfigurable(Math.cbrt, "length"); +verifyProperty(Math.cbrt, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/cbrt/name.js b/js/src/tests/test262/built-ins/Math/cbrt/name.js index d6262036b4..bb0f003077 100644 --- a/js/src/tests/test262/built-ins/Math/cbrt/name.js +++ b/js/src/tests/test262/built-ins/Math/cbrt/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.cbrt.name, "cbrt"); - -verifyNotEnumerable(Math.cbrt, "name"); -verifyNotWritable(Math.cbrt, "name"); -verifyConfigurable(Math.cbrt, "name"); +verifyProperty(Math.cbrt, "name", { + value: "cbrt", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/cbrt/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/cbrt/not-a-constructor.js index 39b62b8f1c..2999fd05e2 100644 --- a/js/src/tests/test262/built-ins/Math/cbrt/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/cbrt/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.cbrt), false, 'isConstructor(Math.cbrt) must assert.throws(TypeError, () => { new Math.cbrt(); -}, '`new Math.cbrt()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/ceil/length.js b/js/src/tests/test262/built-ins/Math/ceil/length.js index c8717de985..a1b84541d0 100644 --- a/js/src/tests/test262/built-ins/Math/ceil/length.js +++ b/js/src/tests/test262/built-ins/Math/ceil/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.ceil.length, 1); - -verifyNotEnumerable(Math.ceil, "length"); -verifyNotWritable(Math.ceil, "length"); -verifyConfigurable(Math.ceil, "length"); +verifyProperty(Math.ceil, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/ceil/name.js b/js/src/tests/test262/built-ins/Math/ceil/name.js index df08f67866..5425e70f51 100644 --- a/js/src/tests/test262/built-ins/Math/ceil/name.js +++ b/js/src/tests/test262/built-ins/Math/ceil/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.ceil.name, "ceil"); - -verifyNotEnumerable(Math.ceil, "name"); -verifyNotWritable(Math.ceil, "name"); -verifyConfigurable(Math.ceil, "name"); +verifyProperty(Math.ceil, "name", { + value: "ceil", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/ceil/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/ceil/not-a-constructor.js index 8e2861138f..34468e9cf3 100644 --- a/js/src/tests/test262/built-ins/Math/ceil/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/ceil/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.ceil), false, 'isConstructor(Math.ceil) must assert.throws(TypeError, () => { new Math.ceil(); -}, '`new Math.ceil()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/clz32/length.js b/js/src/tests/test262/built-ins/Math/clz32/length.js index 038975b13d..b139a9f06d 100644 --- a/js/src/tests/test262/built-ins/Math/clz32/length.js +++ b/js/src/tests/test262/built-ins/Math/clz32/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.clz32.length, 1); - -verifyNotEnumerable(Math.clz32, "length"); -verifyNotWritable(Math.clz32, "length"); -verifyConfigurable(Math.clz32, "length"); +verifyProperty(Math.clz32, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/clz32/name.js b/js/src/tests/test262/built-ins/Math/clz32/name.js index 2862f87439..0ba3af0460 100644 --- a/js/src/tests/test262/built-ins/Math/clz32/name.js +++ b/js/src/tests/test262/built-ins/Math/clz32/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.clz32.name, "clz32"); - -verifyNotEnumerable(Math.clz32, "name"); -verifyNotWritable(Math.clz32, "name"); -verifyConfigurable(Math.clz32, "name"); +verifyProperty(Math.clz32, "name", { + value: "clz32", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/clz32/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/clz32/not-a-constructor.js index 2bff88114f..c1a38ec793 100644 --- a/js/src/tests/test262/built-ins/Math/clz32/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/clz32/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.clz32), false, 'isConstructor(Math.clz32) mu assert.throws(TypeError, () => { new Math.clz32(); -}, '`new Math.clz32()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/cos/length.js b/js/src/tests/test262/built-ins/Math/cos/length.js index b41d87ef73..b7c1feb4ab 100644 --- a/js/src/tests/test262/built-ins/Math/cos/length.js +++ b/js/src/tests/test262/built-ins/Math/cos/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.cos.length, 1); - -verifyNotEnumerable(Math.cos, "length"); -verifyNotWritable(Math.cos, "length"); -verifyConfigurable(Math.cos, "length"); +verifyProperty(Math.cos, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/cos/name.js b/js/src/tests/test262/built-ins/Math/cos/name.js index 88be1490d8..291819a099 100644 --- a/js/src/tests/test262/built-ins/Math/cos/name.js +++ b/js/src/tests/test262/built-ins/Math/cos/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.cos.name, "cos"); - -verifyNotEnumerable(Math.cos, "name"); -verifyNotWritable(Math.cos, "name"); -verifyConfigurable(Math.cos, "name"); +verifyProperty(Math.cos, "name", { + value: "cos", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/cos/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/cos/not-a-constructor.js index e86a689ccb..e680ae9ade 100644 --- a/js/src/tests/test262/built-ins/Math/cos/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/cos/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.cos), false, 'isConstructor(Math.cos) must r assert.throws(TypeError, () => { new Math.cos(); -}, '`new Math.cos()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/cosh/length.js b/js/src/tests/test262/built-ins/Math/cosh/length.js index 6c64935887..42d849b37c 100644 --- a/js/src/tests/test262/built-ins/Math/cosh/length.js +++ b/js/src/tests/test262/built-ins/Math/cosh/length.js @@ -18,10 +18,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.cosh.length, 1); - -verifyNotEnumerable(Math.cosh, "length"); -verifyNotWritable(Math.cosh, "length"); -verifyConfigurable(Math.cosh, "length"); +verifyProperty(Math.cosh, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/cosh/name.js b/js/src/tests/test262/built-ins/Math/cosh/name.js index 161ed02e3a..1358dd428a 100644 --- a/js/src/tests/test262/built-ins/Math/cosh/name.js +++ b/js/src/tests/test262/built-ins/Math/cosh/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.cosh.name, "cosh"); - -verifyNotEnumerable(Math.cosh, "name"); -verifyNotWritable(Math.cosh, "name"); -verifyConfigurable(Math.cosh, "name"); +verifyProperty(Math.cosh, "name", { + value: "cosh", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/cosh/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/cosh/not-a-constructor.js index 8cda77d866..43e7b739c3 100644 --- a/js/src/tests/test262/built-ins/Math/cosh/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/cosh/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.cosh), false, 'isConstructor(Math.cosh) must assert.throws(TypeError, () => { new Math.cosh(); -}, '`new Math.cosh()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/exp/length.js b/js/src/tests/test262/built-ins/Math/exp/length.js index 1f90dbf228..06e2d7e267 100644 --- a/js/src/tests/test262/built-ins/Math/exp/length.js +++ b/js/src/tests/test262/built-ins/Math/exp/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.exp.length, 1); - -verifyNotEnumerable(Math.exp, "length"); -verifyNotWritable(Math.exp, "length"); -verifyConfigurable(Math.exp, "length"); +verifyProperty(Math.exp, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/exp/name.js b/js/src/tests/test262/built-ins/Math/exp/name.js index 9f0ec90ebb..10dface3a7 100644 --- a/js/src/tests/test262/built-ins/Math/exp/name.js +++ b/js/src/tests/test262/built-ins/Math/exp/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.exp.name, "exp"); - -verifyNotEnumerable(Math.exp, "name"); -verifyNotWritable(Math.exp, "name"); -verifyConfigurable(Math.exp, "name"); +verifyProperty(Math.exp, "name", { + value: "exp", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/exp/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/exp/not-a-constructor.js index 9d956e7bcb..ea30924ae8 100644 --- a/js/src/tests/test262/built-ins/Math/exp/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/exp/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.exp), false, 'isConstructor(Math.exp) must r assert.throws(TypeError, () => { new Math.exp(); -}, '`new Math.exp()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/expm1/length.js b/js/src/tests/test262/built-ins/Math/expm1/length.js index ead3c57638..2b58d8cf01 100644 --- a/js/src/tests/test262/built-ins/Math/expm1/length.js +++ b/js/src/tests/test262/built-ins/Math/expm1/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.expm1.length, 1); - -verifyNotEnumerable(Math.expm1, "length"); -verifyNotWritable(Math.expm1, "length"); -verifyConfigurable(Math.expm1, "length"); +verifyProperty(Math.expm1, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/expm1/name.js b/js/src/tests/test262/built-ins/Math/expm1/name.js index 698bdc19c0..5c1e831913 100644 --- a/js/src/tests/test262/built-ins/Math/expm1/name.js +++ b/js/src/tests/test262/built-ins/Math/expm1/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.expm1.name, "expm1"); - -verifyNotEnumerable(Math.expm1, "name"); -verifyNotWritable(Math.expm1, "name"); -verifyConfigurable(Math.expm1, "name"); +verifyProperty(Math.expm1, "name", { + value: "expm1", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/expm1/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/expm1/not-a-constructor.js index d0b9a18935..4ce17e5172 100644 --- a/js/src/tests/test262/built-ins/Math/expm1/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/expm1/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.expm1), false, 'isConstructor(Math.expm1) mu assert.throws(TypeError, () => { new Math.expm1(); -}, '`new Math.expm1()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/f16round/browser.js b/js/src/tests/test262/built-ins/Math/f16round/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/Math/f16round/length.js b/js/src/tests/test262/built-ins/Math/f16round/length.js new file mode 100644 index 0000000000..06aa21a352 --- /dev/null +++ b/js/src/tests/test262/built-ins/Math/f16round/length.js @@ -0,0 +1,20 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-math.f16round +description: > + Math.f16round.length is 1 +features: [Float16Array] +includes: [propertyHelper.js] +---*/ + +verifyProperty(Math.f16round, 'length', { + value: 1, + enumerable: false, + writable: false, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/f16round/name.js b/js/src/tests/test262/built-ins/Math/f16round/name.js new file mode 100644 index 0000000000..6e6167e469 --- /dev/null +++ b/js/src/tests/test262/built-ins/Math/f16round/name.js @@ -0,0 +1,20 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-math.f16round +description: > + Math.f16round.name is "f16round" +features: [Float16Array] +includes: [propertyHelper.js] +---*/ + +verifyProperty(Math.f16round, 'name', { + value: 'f16round', + enumerable: false, + writable: false, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/f16round/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/f16round/not-a-constructor.js new file mode 100644 index 0000000000..1dcb13eb89 --- /dev/null +++ b/js/src/tests/test262/built-ins/Math/f16round/not-a-constructor.js @@ -0,0 +1,19 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Math.f16round does not implement [[Construct]], is not new-able +includes: [isConstructor.js] +features: [Float16Array, Reflect.construct] +---*/ + +assert(!isConstructor(Math.f16round), "Math.f16round is not a constructor"); + +assert.throws(TypeError, function () { + new Math.fround(); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/f16round/prop-desc.js b/js/src/tests/test262/built-ins/Math/f16round/prop-desc.js new file mode 100644 index 0000000000..970532b3b8 --- /dev/null +++ b/js/src/tests/test262/built-ins/Math/f16round/prop-desc.js @@ -0,0 +1,17 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-math.f16round +description: > + "f16round" property of Math +features: [Float16Array] +includes: [propertyHelper.js] +---*/ + +verifyNotEnumerable(Math, "f16round"); +verifyWritable(Math, "f16round"); +verifyConfigurable(Math, "f16round"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/f16round/shell.js b/js/src/tests/test262/built-ins/Math/f16round/shell.js new file mode 100644 index 0000000000..d71430014e --- /dev/null +++ b/js/src/tests/test262/built-ins/Math/f16round/shell.js @@ -0,0 +1,680 @@ +// GENERATED, DO NOT EDIT +// file: byteConversionValues.js +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Provide a list for original and expected values for different byte + conversions. + This helper is mostly used on tests for TypedArray and DataView, and each + array from the expected values must match the original values array on every + index containing its original value. +defines: [byteConversionValues] +---*/ +var byteConversionValues = { + values: [ + 127, // 2 ** 7 - 1 + 128, // 2 ** 7 + 32767, // 2 ** 15 - 1 + 32768, // 2 ** 15 + 2147483647, // 2 ** 31 - 1 + 2147483648, // 2 ** 31 + 255, // 2 ** 8 - 1 + 256, // 2 ** 8 + 65535, // 2 ** 16 - 1 + 65536, // 2 ** 16 + 4294967295, // 2 ** 32 - 1 + 4294967296, // 2 ** 32 + 9007199254740991, // 2 ** 53 - 1 + 9007199254740992, // 2 ** 53 + 1.1, + 0.1, + 0.5, + 0.50000001, + 0.6, + 0.7, + undefined, + -1, + -0, + -0.1, + -1.1, + NaN, + -127, // - ( 2 ** 7 - 1 ) + -128, // - ( 2 ** 7 ) + -32767, // - ( 2 ** 15 - 1 ) + -32768, // - ( 2 ** 15 ) + -2147483647, // - ( 2 ** 31 - 1 ) + -2147483648, // - ( 2 ** 31 ) + -255, // - ( 2 ** 8 - 1 ) + -256, // - ( 2 ** 8 ) + -65535, // - ( 2 ** 16 - 1 ) + -65536, // - ( 2 ** 16 ) + -4294967295, // - ( 2 ** 32 - 1 ) + -4294967296, // - ( 2 ** 32 ) + Infinity, + -Infinity, + 0, + 2049, // an integer which rounds down under ties-to-even when cast to float16 + 2051, // an integer which rounds up under ties-to-even when cast to float16 + 0.00006103515625, // smallest normal float16 + 0.00006097555160522461, // largest subnormal float16 + 5.960464477539063e-8, // smallest float16 + 2.9802322387695312e-8, // largest double which rounds to 0 when cast to float16 + 2.980232238769532e-8, // smallest double which does not round to 0 when cast to float16 + 8.940696716308594e-8, // a double which rounds up to a subnormal under ties-to-even when cast to float16 + 1.4901161193847656e-7, // a double which rounds down to a subnormal under ties-to-even when cast to float16 + 1.490116119384766e-7, // the next double above the one on the previous line one + 65504, // max finite float16 + 65520, // smallest double which rounds to infinity when cast to float16 + 65519.99999999999, // largest double which does not round to infinity when cast to float16 + 0.000061005353927612305, // smallest double which rounds to a non-subnormal when cast to float16 + 0.0000610053539276123 // largest double which rounds to a subnormal when cast to float16 + ], + + expected: { + Int8: [ + 127, // 127 + -128, // 128 + -1, // 32767 + 0, // 32768 + -1, // 2147483647 + 0, // 2147483648 + -1, // 255 + 0, // 256 + -1, // 65535 + 0, // 65536 + -1, // 4294967295 + 0, // 4294967296 + -1, // 9007199254740991 + 0, // 9007199254740992 + 1, // 1.1 + 0, // 0.1 + 0, // 0.5 + 0, // 0.50000001, + 0, // 0.6 + 0, // 0.7 + 0, // undefined + -1, // -1 + 0, // -0 + 0, // -0.1 + -1, // -1.1 + 0, // NaN + -127, // -127 + -128, // -128 + 1, // -32767 + 0, // -32768 + 1, // -2147483647 + 0, // -2147483648 + 1, // -255 + 0, // -256 + 1, // -65535 + 0, // -65536 + 1, // -4294967295 + 0, // -4294967296 + 0, // Infinity + 0, // -Infinity + 0, // 0 + 1, // 2049 + 3, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + -32, // 65504 + -16, // 65520 + -17, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 + ], + Uint8: [ + 127, // 127 + 128, // 128 + 255, // 32767 + 0, // 32768 + 255, // 2147483647 + 0, // 2147483648 + 255, // 255 + 0, // 256 + 255, // 65535 + 0, // 65536 + 255, // 4294967295 + 0, // 4294967296 + 255, // 9007199254740991 + 0, // 9007199254740992 + 1, // 1.1 + 0, // 0.1 + 0, // 0.5 + 0, // 0.50000001, + 0, // 0.6 + 0, // 0.7 + 0, // undefined + 255, // -1 + 0, // -0 + 0, // -0.1 + 255, // -1.1 + 0, // NaN + 129, // -127 + 128, // -128 + 1, // -32767 + 0, // -32768 + 1, // -2147483647 + 0, // -2147483648 + 1, // -255 + 0, // -256 + 1, // -65535 + 0, // -65536 + 1, // -4294967295 + 0, // -4294967296 + 0, // Infinity + 0, // -Infinity + 0, // 0 + 1, // 2049 + 3, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 224, // 65504 + 240, // 65520 + 239, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 + ], + Uint8Clamped: [ + 127, // 127 + 128, // 128 + 255, // 32767 + 255, // 32768 + 255, // 2147483647 + 255, // 2147483648 + 255, // 255 + 255, // 256 + 255, // 65535 + 255, // 65536 + 255, // 4294967295 + 255, // 4294967296 + 255, // 9007199254740991 + 255, // 9007199254740992 + 1, // 1.1, + 0, // 0.1 + 0, // 0.5 + 1, // 0.50000001, + 1, // 0.6 + 1, // 0.7 + 0, // undefined + 0, // -1 + 0, // -0 + 0, // -0.1 + 0, // -1.1 + 0, // NaN + 0, // -127 + 0, // -128 + 0, // -32767 + 0, // -32768 + 0, // -2147483647 + 0, // -2147483648 + 0, // -255 + 0, // -256 + 0, // -65535 + 0, // -65536 + 0, // -4294967295 + 0, // -4294967296 + 255, // Infinity + 0, // -Infinity + 0, // 0 + 255, // 2049 + 255, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 255, // 65504 + 255, // 65520 + 255, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 + ], + Int16: [ + 127, // 127 + 128, // 128 + 32767, // 32767 + -32768, // 32768 + -1, // 2147483647 + 0, // 2147483648 + 255, // 255 + 256, // 256 + -1, // 65535 + 0, // 65536 + -1, // 4294967295 + 0, // 4294967296 + -1, // 9007199254740991 + 0, // 9007199254740992 + 1, // 1.1 + 0, // 0.1 + 0, // 0.5 + 0, // 0.50000001, + 0, // 0.6 + 0, // 0.7 + 0, // undefined + -1, // -1 + 0, // -0 + 0, // -0.1 + -1, // -1.1 + 0, // NaN + -127, // -127 + -128, // -128 + -32767, // -32767 + -32768, // -32768 + 1, // -2147483647 + 0, // -2147483648 + -255, // -255 + -256, // -256 + 1, // -65535 + 0, // -65536 + 1, // -4294967295 + 0, // -4294967296 + 0, // Infinity + 0, // -Infinity + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + -32, // 65504 + -16, // 65520 + -17, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 + ], + Uint16: [ + 127, // 127 + 128, // 128 + 32767, // 32767 + 32768, // 32768 + 65535, // 2147483647 + 0, // 2147483648 + 255, // 255 + 256, // 256 + 65535, // 65535 + 0, // 65536 + 65535, // 4294967295 + 0, // 4294967296 + 65535, // 9007199254740991 + 0, // 9007199254740992 + 1, // 1.1 + 0, // 0.1 + 0, // 0.5 + 0, // 0.50000001, + 0, // 0.6 + 0, // 0.7 + 0, // undefined + 65535, // -1 + 0, // -0 + 0, // -0.1 + 65535, // -1.1 + 0, // NaN + 65409, // -127 + 65408, // -128 + 32769, // -32767 + 32768, // -32768 + 1, // -2147483647 + 0, // -2147483648 + 65281, // -255 + 65280, // -256 + 1, // -65535 + 0, // -65536 + 1, // -4294967295 + 0, // -4294967296 + 0, // Infinity + 0, // -Infinity + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 + ], + Int32: [ + 127, // 127 + 128, // 128 + 32767, // 32767 + 32768, // 32768 + 2147483647, // 2147483647 + -2147483648, // 2147483648 + 255, // 255 + 256, // 256 + 65535, // 65535 + 65536, // 65536 + -1, // 4294967295 + 0, // 4294967296 + -1, // 9007199254740991 + 0, // 9007199254740992 + 1, // 1.1 + 0, // 0.1 + 0, // 0.5 + 0, // 0.50000001, + 0, // 0.6 + 0, // 0.7 + 0, // undefined + -1, // -1 + 0, // -0 + 0, // -0.1 + -1, // -1.1 + 0, // NaN + -127, // -127 + -128, // -128 + -32767, // -32767 + -32768, // -32768 + -2147483647, // -2147483647 + -2147483648, // -2147483648 + -255, // -255 + -256, // -256 + -65535, // -65535 + -65536, // -65536 + 1, // -4294967295 + 0, // -4294967296 + 0, // Infinity + 0, // -Infinity + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 + ], + Uint32: [ + 127, // 127 + 128, // 128 + 32767, // 32767 + 32768, // 32768 + 2147483647, // 2147483647 + 2147483648, // 2147483648 + 255, // 255 + 256, // 256 + 65535, // 65535 + 65536, // 65536 + 4294967295, // 4294967295 + 0, // 4294967296 + 4294967295, // 9007199254740991 + 0, // 9007199254740992 + 1, // 1.1 + 0, // 0.1 + 0, // 0.5 + 0, // 0.50000001, + 0, // 0.6 + 0, // 0.7 + 0, // undefined + 4294967295, // -1 + 0, // -0 + 0, // -0.1 + 4294967295, // -1.1 + 0, // NaN + 4294967169, // -127 + 4294967168, // -128 + 4294934529, // -32767 + 4294934528, // -32768 + 2147483649, // -2147483647 + 2147483648, // -2147483648 + 4294967041, // -255 + 4294967040, // -256 + 4294901761, // -65535 + 4294901760, // -65536 + 1, // -4294967295 + 0, // -4294967296 + 0, // Infinity + 0, // -Infinity + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 + ], + Float16: [ + 127, // 127 + 128, // 128 + 32768, // 32767 + 32768, // 32768 + Infinity, // 2147483647 + Infinity, // 2147483648 + 255, // 255 + 256, // 256 + Infinity, // 65535 + Infinity, // 65536 + Infinity, // 4294967295 + Infinity, // 4294967296 + Infinity, // 9007199254740991 + Infinity, // 9007199254740992 + 1.099609375, // 1.1 + 0.0999755859375, // 0.1 + 0.5, // 0.5 + 0.5, // 0.50000001, + 0.60009765625, // 0.6 + 0.7001953125, // 0.7 + NaN, // undefined + -1, // -1 + -0, // -0 + -0.0999755859375, // -0.1 + -1.099609375, // -1.1 + NaN, // NaN + -127, // -127 + -128, // -128 + -32768, // -32767 + -32768, // -32768 + -Infinity, // -2147483647 + -Infinity, // -2147483648 + -255, // -255 + -256, // -256 + -Infinity, // -65535 + -Infinity, // -65536 + -Infinity, // -4294967295 + -Infinity, // -4294967296 + Infinity, // Infinity + -Infinity, // -Infinity + 0, // 0 + 2048, // 2049 + 2052, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 5.960464477539063e-8, // 2.980232238769532e-8 + 1.1920928955078125e-7, // 8.940696716308594e-8 + 1.1920928955078125e-7, // 1.4901161193847656e-7 + 1.7881393432617188e-7, // 1.490116119384766e-7 + 65504, // 65504 + Infinity, // 65520 + 65504, // 65519.99999999999 + 0.00006103515625, // 0.000061005353927612305 + 0.00006097555160522461 // 0.0000610053539276123 + ], + Float32: [ + 127, // 127 + 128, // 128 + 32767, // 32767 + 32768, // 32768 + 2147483648, // 2147483647 + 2147483648, // 2147483648 + 255, // 255 + 256, // 256 + 65535, // 65535 + 65536, // 65536 + 4294967296, // 4294967295 + 4294967296, // 4294967296 + 9007199254740992, // 9007199254740991 + 9007199254740992, // 9007199254740992 + 1.100000023841858, // 1.1 + 0.10000000149011612, // 0.1 + 0.5, // 0.5 + 0.5, // 0.50000001, + 0.6000000238418579, // 0.6 + 0.699999988079071, // 0.7 + NaN, // undefined + -1, // -1 + -0, // -0 + -0.10000000149011612, // -0.1 + -1.100000023841858, // -1.1 + NaN, // NaN + -127, // -127 + -128, // -128 + -32767, // -32767 + -32768, // -32768 + -2147483648, // -2147483647 + -2147483648, // -2147483648 + -255, // -255 + -256, // -256 + -65535, // -65535 + -65536, // -65536 + -4294967296, // -4294967295 + -4294967296, // -4294967296 + Infinity, // Infinity + -Infinity, // -Infinity + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 2.9802322387695312e-8, // 2.9802322387695312e-8 + 2.9802322387695312e-8, // 2.980232238769532e-8 + 8.940696716308594e-8, // 8.940696716308594e-8 + 1.4901161193847656e-7, // 1.4901161193847656e-7 + 1.4901161193847656e-7, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65520, // 65519.99999999999 + 0.000061005353927612305, // 0.000061005353927612305 + 0.000061005353927612305 // 0.0000610053539276123 + ], + Float64: [ + 127, // 127 + 128, // 128 + 32767, // 32767 + 32768, // 32768 + 2147483647, // 2147483647 + 2147483648, // 2147483648 + 255, // 255 + 256, // 256 + 65535, // 65535 + 65536, // 65536 + 4294967295, // 4294967295 + 4294967296, // 4294967296 + 9007199254740991, // 9007199254740991 + 9007199254740992, // 9007199254740992 + 1.1, // 1.1 + 0.1, // 0.1 + 0.5, // 0.5 + 0.50000001, // 0.50000001, + 0.6, // 0.6 + 0.7, // 0.7 + NaN, // undefined + -1, // -1 + -0, // -0 + -0.1, // -0.1 + -1.1, // -1.1 + NaN, // NaN + -127, // -127 + -128, // -128 + -32767, // -32767 + -32768, // -32768 + -2147483647, // -2147483647 + -2147483648, // -2147483648 + -255, // -255 + -256, // -256 + -65535, // -65535 + -65536, // -65536 + -4294967295, // -4294967295 + -4294967296, // -4294967296 + Infinity, // Infinity + -Infinity, // -Infinity + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 2.9802322387695312e-8, // 2.9802322387695312e-8 + 2.980232238769532e-8, // 2.980232238769532e-8 + 8.940696716308594e-8, // 8.940696716308594e-8 + 1.4901161193847656e-7, // 1.4901161193847656e-7 + 1.490116119384766e-7, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519.99999999999, // 65519.99999999999 + 0.000061005353927612305, // 0.000061005353927612305 + 0.0000610053539276123 // 0.0000610053539276123 + ] + } +}; + +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/built-ins/Math/f16round/value-conversion.js b/js/src/tests/test262/built-ins/Math/f16round/value-conversion.js new file mode 100644 index 0000000000..2e6ebae58b --- /dev/null +++ b/js/src/tests/test262/built-ins/Math/f16round/value-conversion.js @@ -0,0 +1,28 @@ +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('Float16Array')||!xulRuntime.shell) -- Float16Array is not enabled unconditionally, requires shell-options +// Copyright (C) 2024 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-math.f16round +description: > + Convert to binary16 format and than to binary64 format +features: [Float16Array] +includes: [byteConversionValues.js] +---*/ + +var values = byteConversionValues.values; +var expectedValues = byteConversionValues.expected.Float16; + +values.forEach(function(value, i) { + var expected = expectedValues[i]; + + var result = Math.f16round(value); + + assert.sameValue( + result, + expected, + "value: " + value + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/floor/length.js b/js/src/tests/test262/built-ins/Math/floor/length.js index ee66afc021..7e456dc19c 100644 --- a/js/src/tests/test262/built-ins/Math/floor/length.js +++ b/js/src/tests/test262/built-ins/Math/floor/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.floor.length, 1); - -verifyNotEnumerable(Math.floor, "length"); -verifyNotWritable(Math.floor, "length"); -verifyConfigurable(Math.floor, "length"); +verifyProperty(Math.floor, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/floor/name.js b/js/src/tests/test262/built-ins/Math/floor/name.js index 4b08a81688..00f09e16eb 100644 --- a/js/src/tests/test262/built-ins/Math/floor/name.js +++ b/js/src/tests/test262/built-ins/Math/floor/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.floor.name, "floor"); - -verifyNotEnumerable(Math.floor, "name"); -verifyNotWritable(Math.floor, "name"); -verifyConfigurable(Math.floor, "name"); +verifyProperty(Math.floor, "name", { + value: "floor", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/floor/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/floor/not-a-constructor.js index 140a726d16..e69c5d7c4a 100644 --- a/js/src/tests/test262/built-ins/Math/floor/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/floor/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.floor), false, 'isConstructor(Math.floor) mu assert.throws(TypeError, () => { new Math.floor(); -}, '`new Math.floor()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/fround/length.js b/js/src/tests/test262/built-ins/Math/fround/length.js index 56190466ae..7020d5354e 100644 --- a/js/src/tests/test262/built-ins/Math/fround/length.js +++ b/js/src/tests/test262/built-ins/Math/fround/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.fround.length, 1); - -verifyNotEnumerable(Math.fround, "length"); -verifyNotWritable(Math.fround, "length"); -verifyConfigurable(Math.fround, "length"); +verifyProperty(Math.fround, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/fround/name.js b/js/src/tests/test262/built-ins/Math/fround/name.js index c1f5ac6270..4385f3cb77 100644 --- a/js/src/tests/test262/built-ins/Math/fround/name.js +++ b/js/src/tests/test262/built-ins/Math/fround/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.fround.name, "fround"); - -verifyNotEnumerable(Math.fround, "name"); -verifyNotWritable(Math.fround, "name"); -verifyConfigurable(Math.fround, "name"); +verifyProperty(Math.fround, "name", { + value: "fround", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/fround/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/fround/not-a-constructor.js index d82e346651..029a31f66e 100644 --- a/js/src/tests/test262/built-ins/Math/fround/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/fround/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.fround), false, 'isConstructor(Math.fround) assert.throws(TypeError, () => { new Math.fround(); -}, '`new Math.fround()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/hypot/length.js b/js/src/tests/test262/built-ins/Math/hypot/length.js index 9800debc1a..7a29ac886f 100644 --- a/js/src/tests/test262/built-ins/Math/hypot/length.js +++ b/js/src/tests/test262/built-ins/Math/hypot/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.hypot.length, 2); - -verifyNotEnumerable(Math.hypot, "length"); -verifyNotWritable(Math.hypot, "length"); -verifyConfigurable(Math.hypot, "length"); +verifyProperty(Math.hypot, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/hypot/name.js b/js/src/tests/test262/built-ins/Math/hypot/name.js index 46d395ca06..51224f04e0 100644 --- a/js/src/tests/test262/built-ins/Math/hypot/name.js +++ b/js/src/tests/test262/built-ins/Math/hypot/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.hypot.name, "hypot"); - -verifyNotEnumerable(Math.hypot, "name"); -verifyNotWritable(Math.hypot, "name"); -verifyConfigurable(Math.hypot, "name"); +verifyProperty(Math.hypot, "name", { + value: "hypot", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/hypot/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/hypot/not-a-constructor.js index 21ff4ba634..7e75ae29ea 100644 --- a/js/src/tests/test262/built-ins/Math/hypot/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/hypot/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.hypot), false, 'isConstructor(Math.hypot) mu assert.throws(TypeError, () => { new Math.hypot(); -}, '`new Math.hypot()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/imul/length.js b/js/src/tests/test262/built-ins/Math/imul/length.js index e457fa6151..67dd3a89b8 100644 --- a/js/src/tests/test262/built-ins/Math/imul/length.js +++ b/js/src/tests/test262/built-ins/Math/imul/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.imul.length, 2); - -verifyNotEnumerable(Math.imul, "length"); -verifyNotWritable(Math.imul, "length"); -verifyConfigurable(Math.imul, "length"); +verifyProperty(Math.imul, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/imul/name.js b/js/src/tests/test262/built-ins/Math/imul/name.js index 46ed5dde63..8549eaa2fe 100644 --- a/js/src/tests/test262/built-ins/Math/imul/name.js +++ b/js/src/tests/test262/built-ins/Math/imul/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.imul.name, "imul"); - -verifyNotEnumerable(Math.imul, "name"); -verifyNotWritable(Math.imul, "name"); -verifyConfigurable(Math.imul, "name"); +verifyProperty(Math.imul, "name", { + value: "imul", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/imul/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/imul/not-a-constructor.js index 000f83ab72..ab5492a6f7 100644 --- a/js/src/tests/test262/built-ins/Math/imul/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/imul/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.imul), false, 'isConstructor(Math.imul) must assert.throws(TypeError, () => { new Math.imul(); -}, '`new Math.imul()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/log/length.js b/js/src/tests/test262/built-ins/Math/log/length.js index e23e758bff..b25b3f7771 100644 --- a/js/src/tests/test262/built-ins/Math/log/length.js +++ b/js/src/tests/test262/built-ins/Math/log/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.log.length, 1); - -verifyNotEnumerable(Math.log, "length"); -verifyNotWritable(Math.log, "length"); -verifyConfigurable(Math.log, "length"); +verifyProperty(Math.log, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/log/name.js b/js/src/tests/test262/built-ins/Math/log/name.js index 35009aa9d3..9822c1d027 100644 --- a/js/src/tests/test262/built-ins/Math/log/name.js +++ b/js/src/tests/test262/built-ins/Math/log/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.log.name, "log"); - -verifyNotEnumerable(Math.log, "name"); -verifyNotWritable(Math.log, "name"); -verifyConfigurable(Math.log, "name"); +verifyProperty(Math.log, "name", { + value: "log", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/log/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/log/not-a-constructor.js index 2fe1ae7ee6..a0849c7b30 100644 --- a/js/src/tests/test262/built-ins/Math/log/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/log/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.log), false, 'isConstructor(Math.log) must r assert.throws(TypeError, () => { new Math.log(); -}, '`new Math.log()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/log10/length.js b/js/src/tests/test262/built-ins/Math/log10/length.js index 679d3f0b62..b7a2e430ee 100644 --- a/js/src/tests/test262/built-ins/Math/log10/length.js +++ b/js/src/tests/test262/built-ins/Math/log10/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.log10.length, 1); - -verifyNotEnumerable(Math.log10, "length"); -verifyNotWritable(Math.log10, "length"); -verifyConfigurable(Math.log10, "length"); +verifyProperty(Math.log10, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/log10/name.js b/js/src/tests/test262/built-ins/Math/log10/name.js index a41195533b..b717455f0e 100644 --- a/js/src/tests/test262/built-ins/Math/log10/name.js +++ b/js/src/tests/test262/built-ins/Math/log10/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.log10.name, "log10"); - -verifyNotEnumerable(Math.log10, "name"); -verifyNotWritable(Math.log10, "name"); -verifyConfigurable(Math.log10, "name"); +verifyProperty(Math.log10, "name", { + value: "log10", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/log10/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/log10/not-a-constructor.js index aacc516ebf..9422c777f0 100644 --- a/js/src/tests/test262/built-ins/Math/log10/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/log10/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.log10), false, 'isConstructor(Math.log10) mu assert.throws(TypeError, () => { new Math.log10(); -}, '`new Math.log10()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/log1p/length.js b/js/src/tests/test262/built-ins/Math/log1p/length.js index 40327f636c..51dbc6d86f 100644 --- a/js/src/tests/test262/built-ins/Math/log1p/length.js +++ b/js/src/tests/test262/built-ins/Math/log1p/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.log1p.length, 1); - -verifyNotEnumerable(Math.log1p, "length"); -verifyNotWritable(Math.log1p, "length"); -verifyConfigurable(Math.log1p, "length"); +verifyProperty(Math.log1p, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/log1p/name.js b/js/src/tests/test262/built-ins/Math/log1p/name.js index 9287af89ed..de9e469c0a 100644 --- a/js/src/tests/test262/built-ins/Math/log1p/name.js +++ b/js/src/tests/test262/built-ins/Math/log1p/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.log1p.name, "log1p"); - -verifyNotEnumerable(Math.log1p, "name"); -verifyNotWritable(Math.log1p, "name"); -verifyConfigurable(Math.log1p, "name"); +verifyProperty(Math.log1p, "name", { + value: "log1p", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/log1p/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/log1p/not-a-constructor.js index f89122aac0..fd3e9d10d8 100644 --- a/js/src/tests/test262/built-ins/Math/log1p/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/log1p/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.log1p), false, 'isConstructor(Math.log1p) mu assert.throws(TypeError, () => { new Math.log1p(); -}, '`new Math.log1p()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/log2/length.js b/js/src/tests/test262/built-ins/Math/log2/length.js index 4763011f45..0ba4c00ece 100644 --- a/js/src/tests/test262/built-ins/Math/log2/length.js +++ b/js/src/tests/test262/built-ins/Math/log2/length.js @@ -21,10 +21,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.log2.length, 1); - -verifyNotEnumerable(Math.log2, "length"); -verifyNotWritable(Math.log2, "length"); -verifyConfigurable(Math.log2, "length"); +verifyProperty(Math.log2, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/log2/name.js b/js/src/tests/test262/built-ins/Math/log2/name.js index 33af36ac29..1c2adc899f 100644 --- a/js/src/tests/test262/built-ins/Math/log2/name.js +++ b/js/src/tests/test262/built-ins/Math/log2/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.log2.name, "log2"); - -verifyNotEnumerable(Math.log2, "name"); -verifyNotWritable(Math.log2, "name"); -verifyConfigurable(Math.log2, "name"); +verifyProperty(Math.log2, "name", { + value: "log2", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/log2/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/log2/not-a-constructor.js index 1a40c155c9..6e28337931 100644 --- a/js/src/tests/test262/built-ins/Math/log2/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/log2/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.log2), false, 'isConstructor(Math.log2) must assert.throws(TypeError, () => { new Math.log2(); -}, '`new Math.log2()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/max/length.js b/js/src/tests/test262/built-ins/Math/max/length.js index a985231596..bd0ca09841 100644 --- a/js/src/tests/test262/built-ins/Math/max/length.js +++ b/js/src/tests/test262/built-ins/Math/max/length.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.max.length, 2); - -verifyNotEnumerable(Math.max, "length"); -verifyNotWritable(Math.max, "length"); -verifyConfigurable(Math.max, "length"); +verifyProperty(Math.max, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/max/name.js b/js/src/tests/test262/built-ins/Math/max/name.js index 2078d602bb..c989c92d5c 100644 --- a/js/src/tests/test262/built-ins/Math/max/name.js +++ b/js/src/tests/test262/built-ins/Math/max/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.max.name, "max"); - -verifyNotEnumerable(Math.max, "name"); -verifyNotWritable(Math.max, "name"); -verifyConfigurable(Math.max, "name"); +verifyProperty(Math.max, "name", { + value: "max", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/max/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/max/not-a-constructor.js index 36e92c627c..4215e7f87a 100644 --- a/js/src/tests/test262/built-ins/Math/max/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/max/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.max), false, 'isConstructor(Math.max) must r assert.throws(TypeError, () => { new Math.max(); -}, '`new Math.max()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/min/length.js b/js/src/tests/test262/built-ins/Math/min/length.js index 65706dd110..262d9ee601 100644 --- a/js/src/tests/test262/built-ins/Math/min/length.js +++ b/js/src/tests/test262/built-ins/Math/min/length.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.min.length, 2); - -verifyNotEnumerable(Math.min, "length"); -verifyNotWritable(Math.min, "length"); -verifyConfigurable(Math.min, "length"); +verifyProperty(Math.min, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/min/name.js b/js/src/tests/test262/built-ins/Math/min/name.js index 2fc9c3d206..27cfaa9fc7 100644 --- a/js/src/tests/test262/built-ins/Math/min/name.js +++ b/js/src/tests/test262/built-ins/Math/min/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.min.name, "min"); - -verifyNotEnumerable(Math.min, "name"); -verifyNotWritable(Math.min, "name"); -verifyConfigurable(Math.min, "name"); +verifyProperty(Math.min, "name", { + value: "min", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/min/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/min/not-a-constructor.js index 24fca032af..7c0d13c7d3 100644 --- a/js/src/tests/test262/built-ins/Math/min/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/min/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.min), false, 'isConstructor(Math.min) must r assert.throws(TypeError, () => { new Math.min(); -}, '`new Math.min()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/pow/length.js b/js/src/tests/test262/built-ins/Math/pow/length.js index 0ac918c8fb..a5023e7f7c 100644 --- a/js/src/tests/test262/built-ins/Math/pow/length.js +++ b/js/src/tests/test262/built-ins/Math/pow/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.pow.length, 2); - -verifyNotEnumerable(Math.pow, "length"); -verifyNotWritable(Math.pow, "length"); -verifyConfigurable(Math.pow, "length"); +verifyProperty(Math.pow, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/pow/name.js b/js/src/tests/test262/built-ins/Math/pow/name.js index c0caa2c9ad..894ad33926 100644 --- a/js/src/tests/test262/built-ins/Math/pow/name.js +++ b/js/src/tests/test262/built-ins/Math/pow/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.pow.name, "pow"); - -verifyNotEnumerable(Math.pow, "name"); -verifyNotWritable(Math.pow, "name"); -verifyConfigurable(Math.pow, "name"); +verifyProperty(Math.pow, "name", { + value: "pow", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/pow/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/pow/not-a-constructor.js index 00ba4261fc..48510fd0ca 100644 --- a/js/src/tests/test262/built-ins/Math/pow/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/pow/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.pow), false, 'isConstructor(Math.pow) must r assert.throws(TypeError, () => { new Math.pow(); -}, '`new Math.pow()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/random/length.js b/js/src/tests/test262/built-ins/Math/random/length.js index 21c8e5304f..ef8d3ae4d7 100644 --- a/js/src/tests/test262/built-ins/Math/random/length.js +++ b/js/src/tests/test262/built-ins/Math/random/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.random.length, 0); - -verifyNotEnumerable(Math.random, "length"); -verifyNotWritable(Math.random, "length"); -verifyConfigurable(Math.random, "length"); +verifyProperty(Math.random, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/random/name.js b/js/src/tests/test262/built-ins/Math/random/name.js index a6f983e5bc..ebf19e54fd 100644 --- a/js/src/tests/test262/built-ins/Math/random/name.js +++ b/js/src/tests/test262/built-ins/Math/random/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.random.name, "random"); - -verifyNotEnumerable(Math.random, "name"); -verifyNotWritable(Math.random, "name"); -verifyConfigurable(Math.random, "name"); +verifyProperty(Math.random, "name", { + value: "random", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/random/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/random/not-a-constructor.js index 8160a93744..274e66fe72 100644 --- a/js/src/tests/test262/built-ins/Math/random/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/random/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.random), false, 'isConstructor(Math.random) assert.throws(TypeError, () => { new Math.random(); -}, '`new Math.random()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/round/length.js b/js/src/tests/test262/built-ins/Math/round/length.js index 262c1ddebf..469492aa55 100644 --- a/js/src/tests/test262/built-ins/Math/round/length.js +++ b/js/src/tests/test262/built-ins/Math/round/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.round.length, 1); - -verifyNotEnumerable(Math.round, "length"); -verifyNotWritable(Math.round, "length"); -verifyConfigurable(Math.round, "length"); +verifyProperty(Math.round, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/round/name.js b/js/src/tests/test262/built-ins/Math/round/name.js index d1e21d7be4..5b6877e93e 100644 --- a/js/src/tests/test262/built-ins/Math/round/name.js +++ b/js/src/tests/test262/built-ins/Math/round/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.round.name, "round"); - -verifyNotEnumerable(Math.round, "name"); -verifyNotWritable(Math.round, "name"); -verifyConfigurable(Math.round, "name"); +verifyProperty(Math.round, "name", { + value: "round", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/round/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/round/not-a-constructor.js index 45996875c4..9fbb4b5551 100644 --- a/js/src/tests/test262/built-ins/Math/round/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/round/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.round), false, 'isConstructor(Math.round) mu assert.throws(TypeError, () => { new Math.round(); -}, '`new Math.round()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/sign/length.js b/js/src/tests/test262/built-ins/Math/sign/length.js index 2d172bfaaa..f9beec1cec 100644 --- a/js/src/tests/test262/built-ins/Math/sign/length.js +++ b/js/src/tests/test262/built-ins/Math/sign/length.js @@ -18,10 +18,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.sign.length, 1); - -verifyNotEnumerable(Math.sign, "length"); -verifyNotWritable(Math.sign, "length"); -verifyConfigurable(Math.sign, "length"); +verifyProperty(Math.sign, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/sign/name.js b/js/src/tests/test262/built-ins/Math/sign/name.js index f706d18562..40aa1cc520 100644 --- a/js/src/tests/test262/built-ins/Math/sign/name.js +++ b/js/src/tests/test262/built-ins/Math/sign/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.sign.name, "sign"); - -verifyNotEnumerable(Math.sign, "name"); -verifyNotWritable(Math.sign, "name"); -verifyConfigurable(Math.sign, "name"); +verifyProperty(Math.sign, "name", { + value: "sign", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/sign/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/sign/not-a-constructor.js index 73a8f9f7d9..767ea490d7 100644 --- a/js/src/tests/test262/built-ins/Math/sign/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/sign/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.sign), false, 'isConstructor(Math.sign) must assert.throws(TypeError, () => { new Math.sign(); -}, '`new Math.sign()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/sin/length.js b/js/src/tests/test262/built-ins/Math/sin/length.js index 887df3bb9d..13e8ad33da 100644 --- a/js/src/tests/test262/built-ins/Math/sin/length.js +++ b/js/src/tests/test262/built-ins/Math/sin/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.sin.length, 1); - -verifyNotEnumerable(Math.sin, "length"); -verifyNotWritable(Math.sin, "length"); -verifyConfigurable(Math.sin, "length"); +verifyProperty(Math.sin, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/sin/name.js b/js/src/tests/test262/built-ins/Math/sin/name.js index af0bb7c8a9..d782c0811d 100644 --- a/js/src/tests/test262/built-ins/Math/sin/name.js +++ b/js/src/tests/test262/built-ins/Math/sin/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.sin.name, "sin"); - -verifyNotEnumerable(Math.sin, "name"); -verifyNotWritable(Math.sin, "name"); -verifyConfigurable(Math.sin, "name"); +verifyProperty(Math.sin, "name", { + value: "sin", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/sin/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/sin/not-a-constructor.js index fec296dc85..f894c39841 100644 --- a/js/src/tests/test262/built-ins/Math/sin/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/sin/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.sin), false, 'isConstructor(Math.sin) must r assert.throws(TypeError, () => { new Math.sin(); -}, '`new Math.sin()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/sinh/length.js b/js/src/tests/test262/built-ins/Math/sinh/length.js index 5071e9cc11..4da8f31e8f 100644 --- a/js/src/tests/test262/built-ins/Math/sinh/length.js +++ b/js/src/tests/test262/built-ins/Math/sinh/length.js @@ -18,10 +18,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.sinh.length, 1); - -verifyNotEnumerable(Math.sinh, "length"); -verifyNotWritable(Math.sinh, "length"); -verifyConfigurable(Math.sinh, "length"); +verifyProperty(Math.sinh, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/sinh/name.js b/js/src/tests/test262/built-ins/Math/sinh/name.js index b2bb918e69..2561b33ef6 100644 --- a/js/src/tests/test262/built-ins/Math/sinh/name.js +++ b/js/src/tests/test262/built-ins/Math/sinh/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.sinh.name, "sinh"); - -verifyNotEnumerable(Math.sinh, "name"); -verifyNotWritable(Math.sinh, "name"); -verifyConfigurable(Math.sinh, "name"); +verifyProperty(Math.sinh, "name", { + value: "sinh", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/sinh/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/sinh/not-a-constructor.js index 9a5ff08bf7..cd892411b4 100644 --- a/js/src/tests/test262/built-ins/Math/sinh/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/sinh/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.sinh), false, 'isConstructor(Math.sinh) must assert.throws(TypeError, () => { new Math.sinh(); -}, '`new Math.sinh()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/sqrt/length.js b/js/src/tests/test262/built-ins/Math/sqrt/length.js index 566bbf47b5..ebc36e2be8 100644 --- a/js/src/tests/test262/built-ins/Math/sqrt/length.js +++ b/js/src/tests/test262/built-ins/Math/sqrt/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.sqrt.length, 1); - -verifyNotEnumerable(Math.sqrt, "length"); -verifyNotWritable(Math.sqrt, "length"); -verifyConfigurable(Math.sqrt, "length"); +verifyProperty(Math.sqrt, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/sqrt/name.js b/js/src/tests/test262/built-ins/Math/sqrt/name.js index 0cca2fc7af..5278d51fd5 100644 --- a/js/src/tests/test262/built-ins/Math/sqrt/name.js +++ b/js/src/tests/test262/built-ins/Math/sqrt/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.sqrt.name, "sqrt"); - -verifyNotEnumerable(Math.sqrt, "name"); -verifyNotWritable(Math.sqrt, "name"); -verifyConfigurable(Math.sqrt, "name"); +verifyProperty(Math.sqrt, "name", { + value: "sqrt", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/sqrt/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/sqrt/not-a-constructor.js index e40a2f5d55..599020a14b 100644 --- a/js/src/tests/test262/built-ins/Math/sqrt/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/sqrt/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.sqrt), false, 'isConstructor(Math.sqrt) must assert.throws(TypeError, () => { new Math.sqrt(); -}, '`new Math.sqrt()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/tan/length.js b/js/src/tests/test262/built-ins/Math/tan/length.js index 0915527693..7a21afa332 100644 --- a/js/src/tests/test262/built-ins/Math/tan/length.js +++ b/js/src/tests/test262/built-ins/Math/tan/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.tan.length, 1); - -verifyNotEnumerable(Math.tan, "length"); -verifyNotWritable(Math.tan, "length"); -verifyConfigurable(Math.tan, "length"); +verifyProperty(Math.tan, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/tan/name.js b/js/src/tests/test262/built-ins/Math/tan/name.js index e1f3e188d2..25bed1b1e1 100644 --- a/js/src/tests/test262/built-ins/Math/tan/name.js +++ b/js/src/tests/test262/built-ins/Math/tan/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.tan.name, "tan"); - -verifyNotEnumerable(Math.tan, "name"); -verifyNotWritable(Math.tan, "name"); -verifyConfigurable(Math.tan, "name"); +verifyProperty(Math.tan, "name", { + value: "tan", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/tan/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/tan/not-a-constructor.js index ea79382a35..f57677cac0 100644 --- a/js/src/tests/test262/built-ins/Math/tan/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/tan/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.tan), false, 'isConstructor(Math.tan) must r assert.throws(TypeError, () => { new Math.tan(); -}, '`new Math.tan()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/tanh/length.js b/js/src/tests/test262/built-ins/Math/tanh/length.js index 7af2c89df5..da3e9f2cd4 100644 --- a/js/src/tests/test262/built-ins/Math/tanh/length.js +++ b/js/src/tests/test262/built-ins/Math/tanh/length.js @@ -18,10 +18,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.tanh.length, 1); - -verifyNotEnumerable(Math.tanh, "length"); -verifyNotWritable(Math.tanh, "length"); -verifyConfigurable(Math.tanh, "length"); +verifyProperty(Math.tanh, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/tanh/name.js b/js/src/tests/test262/built-ins/Math/tanh/name.js index af77bcfae0..9108cd0980 100644 --- a/js/src/tests/test262/built-ins/Math/tanh/name.js +++ b/js/src/tests/test262/built-ins/Math/tanh/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.tanh.name, "tanh"); - -verifyNotEnumerable(Math.tanh, "name"); -verifyNotWritable(Math.tanh, "name"); -verifyConfigurable(Math.tanh, "name"); +verifyProperty(Math.tanh, "name", { + value: "tanh", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/tanh/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/tanh/not-a-constructor.js index 7f4914d650..80b8d74407 100644 --- a/js/src/tests/test262/built-ins/Math/tanh/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/tanh/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.tanh), false, 'isConstructor(Math.tanh) must assert.throws(TypeError, () => { new Math.tanh(); -}, '`new Math.tanh()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/trunc/length.js b/js/src/tests/test262/built-ins/Math/trunc/length.js index 593f893d82..0c716e41c9 100644 --- a/js/src/tests/test262/built-ins/Math/trunc/length.js +++ b/js/src/tests/test262/built-ins/Math/trunc/length.js @@ -18,10 +18,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.trunc.length, 1); - -verifyNotEnumerable(Math.trunc, "length"); -verifyNotWritable(Math.trunc, "length"); -verifyConfigurable(Math.trunc, "length"); +verifyProperty(Math.trunc, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/trunc/name.js b/js/src/tests/test262/built-ins/Math/trunc/name.js index 25f8a0cc3c..c351b444f3 100644 --- a/js/src/tests/test262/built-ins/Math/trunc/name.js +++ b/js/src/tests/test262/built-ins/Math/trunc/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Math.trunc.name, "trunc"); - -verifyNotEnumerable(Math.trunc, "name"); -verifyNotWritable(Math.trunc, "name"); -verifyConfigurable(Math.trunc, "name"); +verifyProperty(Math.trunc, "name", { + value: "trunc", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/trunc/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/trunc/not-a-constructor.js index 1a55c671b4..3c928d695c 100644 --- a/js/src/tests/test262/built-ins/Math/trunc/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Math/trunc/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Math.trunc), false, 'isConstructor(Math.trunc) mu assert.throws(TypeError, () => { new Math.trunc(); -}, '`new Math.trunc()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/EvalError/length.js b/js/src/tests/test262/built-ins/NativeErrors/EvalError/length.js index 4e6a6863d0..dec081fb67 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/EvalError/length.js +++ b/js/src/tests/test262/built-ins/NativeErrors/EvalError/length.js @@ -25,10 +25,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(EvalError.length, 1); - -verifyNotEnumerable(EvalError, "length"); -verifyNotWritable(EvalError, "length"); -verifyConfigurable(EvalError, "length"); +verifyProperty(EvalError, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/EvalError/name.js b/js/src/tests/test262/built-ins/NativeErrors/EvalError/name.js index d36e58bf73..66806a0cc2 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/EvalError/name.js +++ b/js/src/tests/test262/built-ins/NativeErrors/EvalError/name.js @@ -17,10 +17,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(EvalError.name, "EvalError"); - -verifyNotEnumerable(EvalError, "name"); -verifyNotWritable(EvalError, "name"); -verifyConfigurable(EvalError, "name"); +verifyProperty(EvalError, "name", { + value: "EvalError", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/EvalError/prototype/name.js b/js/src/tests/test262/built-ins/NativeErrors/EvalError/prototype/name.js index 7075febda1..2f26093788 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/EvalError/prototype/name.js +++ b/js/src/tests/test262/built-ins/NativeErrors/EvalError/prototype/name.js @@ -17,10 +17,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(EvalError.prototype.name, "EvalError"); - -verifyNotEnumerable(EvalError.prototype, "name"); -verifyWritable(EvalError.prototype, "name"); -verifyConfigurable(EvalError.prototype, "name"); +verifyProperty(EvalError.prototype, "name", { + value: "EvalError", + writable: true, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/RangeError/length.js b/js/src/tests/test262/built-ins/NativeErrors/RangeError/length.js index ce9f6d7f13..93ea9f0f51 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/RangeError/length.js +++ b/js/src/tests/test262/built-ins/NativeErrors/RangeError/length.js @@ -25,10 +25,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(RangeError.length, 1); - -verifyNotEnumerable(RangeError, "length"); -verifyNotWritable(RangeError, "length"); -verifyConfigurable(RangeError, "length"); +verifyProperty(RangeError, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/RangeError/name.js b/js/src/tests/test262/built-ins/NativeErrors/RangeError/name.js index 621b07684c..5e78532fd4 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/RangeError/name.js +++ b/js/src/tests/test262/built-ins/NativeErrors/RangeError/name.js @@ -17,10 +17,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(RangeError.name, "RangeError"); - -verifyNotEnumerable(RangeError, "name"); -verifyNotWritable(RangeError, "name"); -verifyConfigurable(RangeError, "name"); +verifyProperty(RangeError, "name", { + value: "RangeError", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/RangeError/prototype/name.js b/js/src/tests/test262/built-ins/NativeErrors/RangeError/prototype/name.js index 24d76f4949..1aa3f5ddc4 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/RangeError/prototype/name.js +++ b/js/src/tests/test262/built-ins/NativeErrors/RangeError/prototype/name.js @@ -17,10 +17,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(RangeError.prototype.name, "RangeError"); - -verifyNotEnumerable(RangeError.prototype, "name"); -verifyWritable(RangeError.prototype, "name"); -verifyConfigurable(RangeError.prototype, "name"); +verifyProperty(RangeError.prototype, "name", { + value: "RangeError", + writable: true, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/ReferenceError/length.js b/js/src/tests/test262/built-ins/NativeErrors/ReferenceError/length.js index 5a3f07d497..53554565a8 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/ReferenceError/length.js +++ b/js/src/tests/test262/built-ins/NativeErrors/ReferenceError/length.js @@ -25,10 +25,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(ReferenceError.length, 1); - -verifyNotEnumerable(ReferenceError, "length"); -verifyNotWritable(ReferenceError, "length"); -verifyConfigurable(ReferenceError, "length"); +verifyProperty(ReferenceError, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/ReferenceError/name.js b/js/src/tests/test262/built-ins/NativeErrors/ReferenceError/name.js index 66b0a39351..3ae0c668bb 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/ReferenceError/name.js +++ b/js/src/tests/test262/built-ins/NativeErrors/ReferenceError/name.js @@ -17,10 +17,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(ReferenceError.name, "ReferenceError"); - -verifyNotEnumerable(ReferenceError, "name"); -verifyNotWritable(ReferenceError, "name"); -verifyConfigurable(ReferenceError, "name"); +verifyProperty(ReferenceError, "name", { + value: "ReferenceError", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/ReferenceError/prototype/name.js b/js/src/tests/test262/built-ins/NativeErrors/ReferenceError/prototype/name.js index 563ec73485..5dd7915880 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/ReferenceError/prototype/name.js +++ b/js/src/tests/test262/built-ins/NativeErrors/ReferenceError/prototype/name.js @@ -17,10 +17,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(ReferenceError.prototype.name, "ReferenceError"); - -verifyNotEnumerable(ReferenceError.prototype, "name"); -verifyWritable(ReferenceError.prototype, "name"); -verifyConfigurable(ReferenceError.prototype, "name"); +verifyProperty(ReferenceError.prototype, "name", { + value: "ReferenceError", + writable: true, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/SyntaxError/length.js b/js/src/tests/test262/built-ins/NativeErrors/SyntaxError/length.js index 555a5c1529..af34ff86fd 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/SyntaxError/length.js +++ b/js/src/tests/test262/built-ins/NativeErrors/SyntaxError/length.js @@ -25,10 +25,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(SyntaxError.length, 1); - -verifyNotEnumerable(SyntaxError, "length"); -verifyNotWritable(SyntaxError, "length"); -verifyConfigurable(SyntaxError, "length"); +verifyProperty(SyntaxError, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/SyntaxError/name.js b/js/src/tests/test262/built-ins/NativeErrors/SyntaxError/name.js index f70899d0fc..d252a6408f 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/SyntaxError/name.js +++ b/js/src/tests/test262/built-ins/NativeErrors/SyntaxError/name.js @@ -17,10 +17,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(SyntaxError.name, "SyntaxError"); - -verifyNotEnumerable(SyntaxError, "name"); -verifyNotWritable(SyntaxError, "name"); -verifyConfigurable(SyntaxError, "name"); +verifyProperty(SyntaxError, "name", { + value: "SyntaxError", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/SyntaxError/prototype/name.js b/js/src/tests/test262/built-ins/NativeErrors/SyntaxError/prototype/name.js index 8f80d797ba..9cd63f7ecd 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/SyntaxError/prototype/name.js +++ b/js/src/tests/test262/built-ins/NativeErrors/SyntaxError/prototype/name.js @@ -17,10 +17,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(SyntaxError.prototype.name, "SyntaxError"); - -verifyNotEnumerable(SyntaxError.prototype, "name"); -verifyWritable(SyntaxError.prototype, "name"); -verifyConfigurable(SyntaxError.prototype, "name"); +verifyProperty(SyntaxError.prototype, "name", { + value: "SyntaxError", + writable: true, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/TypeError/length.js b/js/src/tests/test262/built-ins/NativeErrors/TypeError/length.js index c84b02708e..f4ca973dac 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/TypeError/length.js +++ b/js/src/tests/test262/built-ins/NativeErrors/TypeError/length.js @@ -25,10 +25,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(TypeError.length, 1); - -verifyNotEnumerable(TypeError, "length"); -verifyNotWritable(TypeError, "length"); -verifyConfigurable(TypeError, "length"); +verifyProperty(TypeError, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/TypeError/name.js b/js/src/tests/test262/built-ins/NativeErrors/TypeError/name.js index ede2f73af9..8af9b919b1 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/TypeError/name.js +++ b/js/src/tests/test262/built-ins/NativeErrors/TypeError/name.js @@ -17,10 +17,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(TypeError.name, "TypeError"); - -verifyNotEnumerable(TypeError, "name"); -verifyNotWritable(TypeError, "name"); -verifyConfigurable(TypeError, "name"); +verifyProperty(TypeError, "name", { + value: "TypeError", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/TypeError/prototype/name.js b/js/src/tests/test262/built-ins/NativeErrors/TypeError/prototype/name.js index c0c0531ff2..04d94af79a 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/TypeError/prototype/name.js +++ b/js/src/tests/test262/built-ins/NativeErrors/TypeError/prototype/name.js @@ -17,10 +17,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(TypeError.prototype.name, "TypeError"); - -verifyNotEnumerable(TypeError.prototype, "name"); -verifyWritable(TypeError.prototype, "name"); -verifyConfigurable(TypeError.prototype, "name"); +verifyProperty(TypeError.prototype, "name", { + value: "TypeError", + writable: true, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/URIError/length.js b/js/src/tests/test262/built-ins/NativeErrors/URIError/length.js index 5f645e5ecd..1ec6826200 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/URIError/length.js +++ b/js/src/tests/test262/built-ins/NativeErrors/URIError/length.js @@ -25,10 +25,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(URIError.length, 1); - -verifyNotEnumerable(URIError, "length"); -verifyNotWritable(URIError, "length"); -verifyConfigurable(URIError, "length"); +verifyProperty(URIError, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/URIError/name.js b/js/src/tests/test262/built-ins/NativeErrors/URIError/name.js index ef912a466b..4c247f0c96 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/URIError/name.js +++ b/js/src/tests/test262/built-ins/NativeErrors/URIError/name.js @@ -17,10 +17,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(URIError.name, "URIError"); - -verifyNotEnumerable(URIError, "name"); -verifyNotWritable(URIError, "name"); -verifyConfigurable(URIError, "name"); +verifyProperty(URIError, "name", { + value: "URIError", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/NativeErrors/URIError/prototype/name.js b/js/src/tests/test262/built-ins/NativeErrors/URIError/prototype/name.js index 3a8b5a369e..f1d24483c4 100644 --- a/js/src/tests/test262/built-ins/NativeErrors/URIError/prototype/name.js +++ b/js/src/tests/test262/built-ins/NativeErrors/URIError/prototype/name.js @@ -17,10 +17,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(URIError.prototype.name, "URIError"); - -verifyNotEnumerable(URIError.prototype, "name"); -verifyWritable(URIError.prototype, "name"); -verifyConfigurable(URIError.prototype, "name"); +verifyProperty(URIError.prototype, "name", { + value: "URIError", + writable: true, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/isFinite/length.js b/js/src/tests/test262/built-ins/Number/isFinite/length.js index 474fcb877f..f2130d61f8 100644 --- a/js/src/tests/test262/built-ins/Number/isFinite/length.js +++ b/js/src/tests/test262/built-ins/Number/isFinite/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.isFinite.length, 1); - -verifyNotEnumerable(Number.isFinite, "length"); -verifyNotWritable(Number.isFinite, "length"); -verifyConfigurable(Number.isFinite, "length"); +verifyProperty(Number.isFinite, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/isFinite/name.js b/js/src/tests/test262/built-ins/Number/isFinite/name.js index 61abe6571a..ce0c2b2e11 100644 --- a/js/src/tests/test262/built-ins/Number/isFinite/name.js +++ b/js/src/tests/test262/built-ins/Number/isFinite/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.isFinite.name, "isFinite"); - -verifyNotEnumerable(Number.isFinite, "name"); -verifyNotWritable(Number.isFinite, "name"); -verifyConfigurable(Number.isFinite, "name"); +verifyProperty(Number.isFinite, "name", { + value: "isFinite", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/isFinite/not-a-constructor.js b/js/src/tests/test262/built-ins/Number/isFinite/not-a-constructor.js index 4e42a62e9b..6a97ffb93d 100644 --- a/js/src/tests/test262/built-ins/Number/isFinite/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Number/isFinite/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Number.isFinite), false, 'isConstructor(Number.is assert.throws(TypeError, () => { new Number.isFinite(); -}, '`new Number.isFinite()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/isInteger/length.js b/js/src/tests/test262/built-ins/Number/isInteger/length.js index 99bd2d168f..216ee2960a 100644 --- a/js/src/tests/test262/built-ins/Number/isInteger/length.js +++ b/js/src/tests/test262/built-ins/Number/isInteger/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.isInteger.length, 1); - -verifyNotEnumerable(Number.isInteger, "length"); -verifyNotWritable(Number.isInteger, "length"); -verifyConfigurable(Number.isInteger, "length"); +verifyProperty(Number.isInteger, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/isInteger/name.js b/js/src/tests/test262/built-ins/Number/isInteger/name.js index 224c94dba9..755e55d2eb 100644 --- a/js/src/tests/test262/built-ins/Number/isInteger/name.js +++ b/js/src/tests/test262/built-ins/Number/isInteger/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.isInteger.name, "isInteger"); - -verifyNotEnumerable(Number.isInteger, "name"); -verifyNotWritable(Number.isInteger, "name"); -verifyConfigurable(Number.isInteger, "name"); +verifyProperty(Number.isInteger, "name", { + value: "isInteger", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/isInteger/not-a-constructor.js b/js/src/tests/test262/built-ins/Number/isInteger/not-a-constructor.js index 2dad2e9df7..9c06c58ad3 100644 --- a/js/src/tests/test262/built-ins/Number/isInteger/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Number/isInteger/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Number.isInteger), false, 'isConstructor(Number.i assert.throws(TypeError, () => { new Number.isInteger(); -}, '`new Number.isInteger()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/isNaN/length.js b/js/src/tests/test262/built-ins/Number/isNaN/length.js index 302e20edf9..b196887226 100644 --- a/js/src/tests/test262/built-ins/Number/isNaN/length.js +++ b/js/src/tests/test262/built-ins/Number/isNaN/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.isNaN.length, 1); - -verifyNotEnumerable(Number.isNaN, "length"); -verifyNotWritable(Number.isNaN, "length"); -verifyConfigurable(Number.isNaN, "length"); +verifyProperty(Number.isNaN, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/isNaN/name.js b/js/src/tests/test262/built-ins/Number/isNaN/name.js index 4d97acdf97..caeb19ed3c 100644 --- a/js/src/tests/test262/built-ins/Number/isNaN/name.js +++ b/js/src/tests/test262/built-ins/Number/isNaN/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.isNaN.name, "isNaN"); - -verifyNotEnumerable(Number.isNaN, "name"); -verifyNotWritable(Number.isNaN, "name"); -verifyConfigurable(Number.isNaN, "name"); +verifyProperty(Number.isNaN, "name", { + value: "isNaN", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/isNaN/not-a-constructor.js b/js/src/tests/test262/built-ins/Number/isNaN/not-a-constructor.js index 482812547c..abca3f5a2e 100644 --- a/js/src/tests/test262/built-ins/Number/isNaN/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Number/isNaN/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Number.isNaN), false, 'isConstructor(Number.isNaN assert.throws(TypeError, () => { new Number.isNaN(); -}, '`new Number.isNaN()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/isSafeInteger/length.js b/js/src/tests/test262/built-ins/Number/isSafeInteger/length.js index bcc7e6a770..10c28bd884 100644 --- a/js/src/tests/test262/built-ins/Number/isSafeInteger/length.js +++ b/js/src/tests/test262/built-ins/Number/isSafeInteger/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.isSafeInteger.length, 1); - -verifyNotEnumerable(Number.isSafeInteger, "length"); -verifyNotWritable(Number.isSafeInteger, "length"); -verifyConfigurable(Number.isSafeInteger, "length"); +verifyProperty(Number.isSafeInteger, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/isSafeInteger/name.js b/js/src/tests/test262/built-ins/Number/isSafeInteger/name.js index 3844d43e13..0e892691df 100644 --- a/js/src/tests/test262/built-ins/Number/isSafeInteger/name.js +++ b/js/src/tests/test262/built-ins/Number/isSafeInteger/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.isSafeInteger.name, "isSafeInteger"); - -verifyNotEnumerable(Number.isSafeInteger, "name"); -verifyNotWritable(Number.isSafeInteger, "name"); -verifyConfigurable(Number.isSafeInteger, "name"); +verifyProperty(Number.isSafeInteger, "name", { + value: "isSafeInteger", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/isSafeInteger/not-a-constructor.js b/js/src/tests/test262/built-ins/Number/isSafeInteger/not-a-constructor.js index dca11c9cd3..d1d73d7d26 100644 --- a/js/src/tests/test262/built-ins/Number/isSafeInteger/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Number/isSafeInteger/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Number.isSafeInteger), false, 'isConstructor(Numb assert.throws(TypeError, () => { new Number.isSafeInteger(); -}, '`new Number.isSafeInteger()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/parseFloat/not-a-constructor.js b/js/src/tests/test262/built-ins/Number/parseFloat/not-a-constructor.js index b660870fa8..e35b21f6f0 100644 --- a/js/src/tests/test262/built-ins/Number/parseFloat/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Number/parseFloat/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Number.parseFloat), false, 'isConstructor(Number. assert.throws(TypeError, () => { new Number.parseFloat(); -}, '`new Number.parseFloat()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/parseInt/not-a-constructor.js b/js/src/tests/test262/built-ins/Number/parseInt/not-a-constructor.js index 871e87adea..105aff520d 100644 --- a/js/src/tests/test262/built-ins/Number/parseInt/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Number/parseInt/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Number.parseInt), false, 'isConstructor(Number.pa assert.throws(TypeError, () => { new Number.parseInt(); -}, '`new Number.parseInt()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/toExponential/length.js b/js/src/tests/test262/built-ins/Number/prototype/toExponential/length.js index 0c146d1500..2215b836a2 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/toExponential/length.js +++ b/js/src/tests/test262/built-ins/Number/prototype/toExponential/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.prototype.toExponential.length, 1); - -verifyNotEnumerable(Number.prototype.toExponential, "length"); -verifyNotWritable(Number.prototype.toExponential, "length"); -verifyConfigurable(Number.prototype.toExponential, "length"); +verifyProperty(Number.prototype.toExponential, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/toExponential/name.js b/js/src/tests/test262/built-ins/Number/prototype/toExponential/name.js index a92b59ba75..b7ab8380c0 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/toExponential/name.js +++ b/js/src/tests/test262/built-ins/Number/prototype/toExponential/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.prototype.toExponential.name, "toExponential"); - -verifyNotEnumerable(Number.prototype.toExponential, "name"); -verifyNotWritable(Number.prototype.toExponential, "name"); -verifyConfigurable(Number.prototype.toExponential, "name"); +verifyProperty(Number.prototype.toExponential, "name", { + value: "toExponential", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/toExponential/not-a-constructor.js b/js/src/tests/test262/built-ins/Number/prototype/toExponential/not-a-constructor.js index bbf60fe972..6df8f0e848 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/toExponential/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Number/prototype/toExponential/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Number.prototype.toExponential(); -}, '`new Number.prototype.toExponential()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/toFixed/length.js b/js/src/tests/test262/built-ins/Number/prototype/toFixed/length.js index 241a60ad57..4451f57b62 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/toFixed/length.js +++ b/js/src/tests/test262/built-ins/Number/prototype/toFixed/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.prototype.toFixed.length, 1); - -verifyNotEnumerable(Number.prototype.toFixed, "length"); -verifyNotWritable(Number.prototype.toFixed, "length"); -verifyConfigurable(Number.prototype.toFixed, "length"); +verifyProperty(Number.prototype.toFixed, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/toFixed/name.js b/js/src/tests/test262/built-ins/Number/prototype/toFixed/name.js index 49a7dbd1a5..3037d36cdb 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/toFixed/name.js +++ b/js/src/tests/test262/built-ins/Number/prototype/toFixed/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.prototype.toFixed.name, "toFixed"); - -verifyNotEnumerable(Number.prototype.toFixed, "name"); -verifyNotWritable(Number.prototype.toFixed, "name"); -verifyConfigurable(Number.prototype.toFixed, "name"); +verifyProperty(Number.prototype.toFixed, "name", { + value: "toFixed", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/toFixed/not-a-constructor.js b/js/src/tests/test262/built-ins/Number/prototype/toFixed/not-a-constructor.js index 639cedbd85..bf196b8639 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/toFixed/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Number/prototype/toFixed/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Number.prototype.toFixed(); -}, '`new Number.prototype.toFixed()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/toLocaleString/length.js b/js/src/tests/test262/built-ins/Number/prototype/toLocaleString/length.js index 0692c33edd..b2cefae1af 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/toLocaleString/length.js +++ b/js/src/tests/test262/built-ins/Number/prototype/toLocaleString/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.prototype.toLocaleString.length, 0); - -verifyNotEnumerable(Number.prototype.toLocaleString, "length"); -verifyNotWritable(Number.prototype.toLocaleString, "length"); -verifyConfigurable(Number.prototype.toLocaleString, "length"); +verifyProperty(Number.prototype.toLocaleString, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/toLocaleString/name.js b/js/src/tests/test262/built-ins/Number/prototype/toLocaleString/name.js index 35f6b9a62b..9f6cfa7f26 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/toLocaleString/name.js +++ b/js/src/tests/test262/built-ins/Number/prototype/toLocaleString/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.prototype.toLocaleString.name, "toLocaleString"); - -verifyNotEnumerable(Number.prototype.toLocaleString, "name"); -verifyNotWritable(Number.prototype.toLocaleString, "name"); -verifyConfigurable(Number.prototype.toLocaleString, "name"); +verifyProperty(Number.prototype.toLocaleString, "name", { + value: "toLocaleString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/toLocaleString/not-a-constructor.js b/js/src/tests/test262/built-ins/Number/prototype/toLocaleString/not-a-constructor.js index d694532dcf..51ed09a33c 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/toLocaleString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Number/prototype/toLocaleString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Number.prototype.toLocaleString(); -}, '`new Number.prototype.toLocaleString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/toPrecision/length.js b/js/src/tests/test262/built-ins/Number/prototype/toPrecision/length.js index a5cecd54d3..d0b018aedb 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/toPrecision/length.js +++ b/js/src/tests/test262/built-ins/Number/prototype/toPrecision/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.prototype.toPrecision.length, 1); - -verifyNotEnumerable(Number.prototype.toPrecision, "length"); -verifyNotWritable(Number.prototype.toPrecision, "length"); -verifyConfigurable(Number.prototype.toPrecision, "length"); +verifyProperty(Number.prototype.toPrecision, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/toPrecision/name.js b/js/src/tests/test262/built-ins/Number/prototype/toPrecision/name.js index 946c5ad308..61096abd77 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/toPrecision/name.js +++ b/js/src/tests/test262/built-ins/Number/prototype/toPrecision/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.prototype.toPrecision.name, "toPrecision"); - -verifyNotEnumerable(Number.prototype.toPrecision, "name"); -verifyNotWritable(Number.prototype.toPrecision, "name"); -verifyConfigurable(Number.prototype.toPrecision, "name"); +verifyProperty(Number.prototype.toPrecision, "name", { + value: "toPrecision", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/toPrecision/not-a-constructor.js b/js/src/tests/test262/built-ins/Number/prototype/toPrecision/not-a-constructor.js index 5424e12b7e..bcb3e378b7 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/toPrecision/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Number/prototype/toPrecision/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Number.prototype.toPrecision(); -}, '`new Number.prototype.toPrecision()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/toString/length.js b/js/src/tests/test262/built-ins/Number/prototype/toString/length.js index 0c57733f13..9d158f0677 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/toString/length.js +++ b/js/src/tests/test262/built-ins/Number/prototype/toString/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.prototype.toString.length, 1); - -verifyNotEnumerable(Number.prototype.toString, "length"); -verifyNotWritable(Number.prototype.toString, "length"); -verifyConfigurable(Number.prototype.toString, "length"); +verifyProperty(Number.prototype.toString, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/toString/name.js b/js/src/tests/test262/built-ins/Number/prototype/toString/name.js index 5072c7993b..2d6a750ca4 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/toString/name.js +++ b/js/src/tests/test262/built-ins/Number/prototype/toString/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.prototype.toString.name, "toString"); - -verifyNotEnumerable(Number.prototype.toString, "name"); -verifyNotWritable(Number.prototype.toString, "name"); -verifyConfigurable(Number.prototype.toString, "name"); +verifyProperty(Number.prototype.toString, "name", { + value: "toString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/toString/not-a-constructor.js b/js/src/tests/test262/built-ins/Number/prototype/toString/not-a-constructor.js index e7f1f2ae77..9e5d5bb81d 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/toString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Number/prototype/toString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Number.prototype.toString(); -}, '`new Number.prototype.toString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/valueOf/length.js b/js/src/tests/test262/built-ins/Number/prototype/valueOf/length.js index 65a31127ff..57f56a4d2e 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/valueOf/length.js +++ b/js/src/tests/test262/built-ins/Number/prototype/valueOf/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.prototype.valueOf.length, 0); - -verifyNotEnumerable(Number.prototype.valueOf, "length"); -verifyNotWritable(Number.prototype.valueOf, "length"); -verifyConfigurable(Number.prototype.valueOf, "length"); +verifyProperty(Number.prototype.valueOf, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/valueOf/name.js b/js/src/tests/test262/built-ins/Number/prototype/valueOf/name.js index 8c1830f5fd..83e8a70334 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/valueOf/name.js +++ b/js/src/tests/test262/built-ins/Number/prototype/valueOf/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.prototype.valueOf.name, "valueOf"); - -verifyNotEnumerable(Number.prototype.valueOf, "name"); -verifyNotWritable(Number.prototype.valueOf, "name"); -verifyConfigurable(Number.prototype.valueOf, "name"); +verifyProperty(Number.prototype.valueOf, "name", { + value: "valueOf", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Number/prototype/valueOf/not-a-constructor.js b/js/src/tests/test262/built-ins/Number/prototype/valueOf/not-a-constructor.js index 5037924ce3..ff11f64c20 100644 --- a/js/src/tests/test262/built-ins/Number/prototype/valueOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Number/prototype/valueOf/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Number.prototype.valueOf(); -}, '`new Number.prototype.valueOf()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/assign/assign-descriptor.js b/js/src/tests/test262/built-ins/Object/assign/assign-descriptor.js index 5ee1c8216e..29f23b7b63 100644 --- a/js/src/tests/test262/built-ins/Object/assign/assign-descriptor.js +++ b/js/src/tests/test262/built-ins/Object/assign/assign-descriptor.js @@ -7,8 +7,10 @@ includes: [propertyHelper.js] es6id: 19.1.2.1 ---*/ -verifyWritable(Object, "assign"); -verifyNotEnumerable(Object, "assign"); -verifyConfigurable(Object, "assign"); +verifyProperty(Object, "assign", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/assign/assign-length.js b/js/src/tests/test262/built-ins/Object/assign/assign-length.js index bcfe2e2eda..600508b7b0 100644 --- a/js/src/tests/test262/built-ins/Object/assign/assign-length.js +++ b/js/src/tests/test262/built-ins/Object/assign/assign-length.js @@ -15,12 +15,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Object.assign.length, 2, "The length property of the assign method should be 2." -); - -verifyNotEnumerable(Object.assign, 'length'); -verifyNotWritable(Object.assign, 'length'); -verifyConfigurable(Object.assign, 'length'); +verifyProperty(Object.assign, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/assign/name.js b/js/src/tests/test262/built-ins/Object/assign/name.js index bab32445c2..c67ef4b8e0 100644 --- a/js/src/tests/test262/built-ins/Object/assign/name.js +++ b/js/src/tests/test262/built-ins/Object/assign/name.js @@ -19,14 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Object.assign.name, - 'assign', - 'The value of `Object.assign.name` is `"assign"`' -); - -verifyNotEnumerable(Object.assign, 'name'); -verifyNotWritable(Object.assign, 'name'); -verifyConfigurable(Object.assign, 'name'); +verifyProperty(Object.assign, "name", { + value: "assign", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/assign/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/assign/not-a-constructor.js index 3c66a4c64a..b94cd4b8e6 100644 --- a/js/src/tests/test262/built-ins/Object/assign/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/assign/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Object.assign), false, 'isConstructor(Object.assi assert.throws(TypeError, () => { new Object.assign({}); -}, '`new Object.assign({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-100.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-100.js index ed3a1d5d13..a0c715b273 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-100.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-100.js @@ -15,7 +15,8 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop"), "expected newObj to have 'prop'"); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-101.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-101.js index f325ce5059..4f2cd35373 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-101.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-101.js @@ -15,7 +15,8 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-103.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-103.js index 4da2d10566..811c119bc2 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-103.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-103.js @@ -26,7 +26,8 @@ var newObj = Object.create({}, { prop: descObj }); -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-104.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-104.js index b76ea8de8b..b5e01360a6 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-104.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-104.js @@ -29,7 +29,8 @@ var newObj = Object.create({}, { prop: descObj }); -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-107.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-107.js index 867a3f4e8c..8cdc1a6017 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-107.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-107.js @@ -28,7 +28,8 @@ var newObj = Object.create({}, { prop: descObj }); -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-108.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-108.js index 14d9da3a70..bab1b7a16b 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-108.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-108.js @@ -31,7 +31,8 @@ var newObj = Object.create({}, { prop: descObj }); -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-109.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-109.js index 8a38c3975e..20bf5a59cb 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-109.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-109.js @@ -19,7 +19,8 @@ var newObj = Object.create({}, { prop: descObj }); -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-110.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-110.js index 9ac2bcea84..60d6fdc53a 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-110.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-110.js @@ -29,7 +29,8 @@ var newObj = Object.create({}, { prop: descObj }); -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-111.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-111.js index e979fe76d7..0b46894531 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-111.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-111.js @@ -24,7 +24,8 @@ var newObj = Object.create({}, { prop: descObj }); -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-125.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-125.js index 17eef5947c..8687b5e1d0 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-125.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-125.js @@ -15,8 +15,8 @@ var newObj = Object.create({}, { } }); - -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-126.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-126.js index 489b57cf3e..42d3dddcee 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-126.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-126.js @@ -15,7 +15,8 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-128.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-128.js index 77cb2171ae..4e1669e5d4 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-128.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-128.js @@ -15,7 +15,8 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-129.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-129.js index 1cf82338ee..e16ee5219a 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-129.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-129.js @@ -15,7 +15,8 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-130.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-130.js index 30855dd7c6..2e8b5ebe33 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-130.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-130.js @@ -15,8 +15,8 @@ var newObj = Object.create({}, { } }); - -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-131.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-131.js index a27ff05e7e..6e86080eb6 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-131.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-131.js @@ -15,7 +15,8 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-132.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-132.js index 0f59a2aa10..00f9ef0d31 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-132.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-132.js @@ -15,7 +15,8 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-135.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-135.js index d6aef6ae19..a74ecda218 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-135.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-135.js @@ -15,7 +15,8 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-179.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-179.js index ceb1884864..e5df5e0c3d 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-179.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-179.js @@ -15,7 +15,9 @@ var newObj = Object.create({}, { } }); -assert.sameValue(newObj.prop, 100); -verifyNotWritable(newObj, "prop"); +verifyProperty(newObj, "prop", { + value: 100, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-188.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-188.js index 91d8c80a52..3d7c3d84f5 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-188.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-188.js @@ -22,7 +22,9 @@ var newObj = Object.create({}, { prop: descObj }); -assert.sameValue(newObj.prop, 100); -verifyNotWritable(newObj, "prop"); +verifyProperty(newObj, "prop", { + value: 100, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-189.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-189.js index 13f8a80bd2..a50b416503 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-189.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-189.js @@ -31,8 +31,9 @@ var newObj = Object.create({}, { prop: descObj }); -assert(newObj.hasOwnProperty("prop")) -assert.sameValue(typeof(newObj.prop), "undefined"); -verifyNotWritable(newObj, "prop"); +verifyProperty(newObj, "prop", { + value: undefined, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-190.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-190.js index 039dd3b032..28f3dfd9ff 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-190.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-190.js @@ -27,7 +27,9 @@ var newObj = Object.create({}, { prop: descObj }); -assert.sameValue(newObj.prop, 100); -verifyNotWritable(newObj, "prop"); +verifyProperty(newObj, "prop", { + value: 100, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-204.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-204.js index 17993ba415..c965df9186 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-204.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-204.js @@ -15,8 +15,9 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop")); -assert.sameValue(typeof newObj.prop, "undefined"); -verifyNotWritable(newObj, "prop"); +verifyProperty(newObj, "prop", { + value: undefined, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-205.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-205.js index 7e414aa5dd..960a0263ef 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-205.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-205.js @@ -15,8 +15,9 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop")); -assert.sameValue(typeof newObj.prop, "undefined"); -verifyNotWritable(newObj, "prop"); +verifyProperty(newObj, "prop", { + value: undefined, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-207.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-207.js index 40513388d8..c1b7043ec6 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-207.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-207.js @@ -15,8 +15,9 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop")); -assert.sameValue(typeof newObj.prop, "undefined"); -verifyNotWritable(newObj, "prop"); +verifyProperty(newObj, "prop", { + value: undefined, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-208.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-208.js index 864af6abf5..0e67c30cb8 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-208.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-208.js @@ -15,8 +15,9 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop")); -assert.sameValue(typeof newObj.prop, "undefined"); -verifyNotWritable(newObj, "prop"); +verifyProperty(newObj, "prop", { + value: undefined, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-209.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-209.js index 057ad51efe..135391d72e 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-209.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-209.js @@ -15,8 +15,9 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop")); -assert.sameValue(typeof newObj.prop, "undefined"); -verifyNotWritable(newObj, "prop"); +verifyProperty(newObj, "prop", { + value: undefined, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-210.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-210.js index d6ff45fb8c..6ec80189af 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-210.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-210.js @@ -15,8 +15,9 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop")) -assert.sameValue(typeof newObj.prop, "undefined"); -verifyNotWritable(newObj, "prop"); +verifyProperty(newObj, "prop", { + value: undefined, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-211.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-211.js index 84a03d23c3..bf6d20941e 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-211.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-211.js @@ -15,8 +15,9 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop")); -assert.sameValue(typeof newObj.prop, "undefined") -verifyNotWritable(newObj, "prop"); +verifyProperty(newObj, "prop", { + value: undefined, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-214.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-214.js index 209db64dda..e80e422d9d 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-214.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-214.js @@ -17,8 +17,9 @@ var newObj = Object.create({}, { prop: descObj }); -assert(newObj.hasOwnProperty("prop")) -assert.sameValue(typeof newObj.prop, "undefined"); -verifyNotWritable(newObj, "prop"); +verifyProperty(newObj, "prop", { + value: undefined, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-307.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-307.js index 02d1a9e465..0f969ae43b 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-307.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-307.js @@ -17,7 +17,8 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop")); -verifyNotWritable(newObj, "prop"); +verifyProperty(newObj, "prop", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-309.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-309.js index 41f48bb638..2977950c78 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-309.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-309.js @@ -18,7 +18,8 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-311.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-311.js index 169e7a69b9..a8c67f0b15 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-311.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-311.js @@ -7,6 +7,7 @@ description: > Object.create - [[Set]] is set as undefined if it is absent in accessor descriptor of one property in 'Properties' (8.12.9 step 4.b) +includes: [propertyHelper.js] ---*/ var newObj = Object.create({}, { @@ -27,21 +28,12 @@ if (newObj.prop === "verifyCreate") { verifyGet = true; } -var verifyEnumerable = false; -for (var p in newObj) { - if (p === "prop") { - verifyEnumerable = true; - } -} - -var verifyConfigurable = false; -var hasProperty = newObj.hasOwnProperty("prop"); -delete newObj.prop; -verifyConfigurable = !newObj.hasOwnProperty("prop") && hasProperty; - assert(verifySet, 'verifySet !== true'); assert(verifyGet, 'verifyGet !== true'); -assert(verifyEnumerable, 'verifyEnumerable !== true'); -assert(verifyConfigurable, 'verifyConfigurable !== true'); + +verifyProperty(newObj, "prop", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-313.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-313.js index b3b0299d4e..988d79ae82 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-313.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-313.js @@ -18,7 +18,8 @@ var newObj = Object.create({}, { } }); -assert(newObj.hasOwnProperty("prop")); -verifyNotConfigurable(newObj, "prop"); +verifyProperty(newObj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-315.js b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-315.js index 2c381680ce..5474af39cb 100644 --- a/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-315.js +++ b/js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-315.js @@ -34,20 +34,20 @@ newObj = Object.create({}, { } }); -verifyEqualTo(newObj, "foo1", 200); - -verifyWritable(newObj, "foo1"); - -verifyEnumerable(newObj, "foo1"); - -verifyConfigurable(newObj, "foo1"); +verifyProperty(newObj, "foo1", { + value: 200, + writable: true, + enumerable: true, + configurable: true, +}); verifyEqualTo(newObj, "foo2", getFunc()); verifyWritable(newObj, "foo2", "setVerifyHelpProp"); -verifyEnumerable(newObj, "foo2"); - -verifyConfigurable(newObj, "foo2"); +verifyProperty(newObj, "foo2", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/name.js b/js/src/tests/test262/built-ins/Object/create/name.js index 63cfe5f126..3555fac0ab 100644 --- a/js/src/tests/test262/built-ins/Object/create/name.js +++ b/js/src/tests/test262/built-ins/Object/create/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.create.name, "create"); - -verifyNotEnumerable(Object.create, "name"); -verifyNotWritable(Object.create, "name"); -verifyConfigurable(Object.create, "name"); +verifyProperty(Object.create, "name", { + value: "create", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/create/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/create/not-a-constructor.js index 00efa6dc33..86e898b19a 100644 --- a/js/src/tests/test262/built-ins/Object/create/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/create/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Object.create), false, 'isConstructor(Object.crea assert.throws(TypeError, () => { new Object.create(null); -}, '`new Object.create(null)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-138.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-138.js index 1ca3793d7b..65fada01d7 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-138.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-138.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-139.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-139.js index f73e256111..a0522ec731 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-139.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-139.js @@ -17,6 +17,8 @@ Object.defineProperties(obj, { } }); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-140.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-140.js index 5e059a4a76..bc0aaee31f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-140.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-140.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-141.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-141.js index da71de2a5e..9be76bcecf 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-141.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-141.js @@ -24,7 +24,8 @@ Object.defineProperties(obj, { property: descObj }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-142.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-142.js index 226a32e614..7f68e3a3d3 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-142.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-142.js @@ -27,7 +27,8 @@ Object.defineProperties(obj, { property: descObj }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-143.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-143.js index 0336ed473b..e22d52d4f8 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-143.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-143.js @@ -35,7 +35,8 @@ Object.defineProperties(obj, { property: descObj }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-144.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-144.js index 1fc7a18431..db1f2541fd 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-144.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-144.js @@ -23,7 +23,8 @@ Object.defineProperties(obj, { property: descObj }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-146.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-146.js index 4cd423d4aa..c1bfdc8238 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-146.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-146.js @@ -31,7 +31,8 @@ Object.defineProperties(obj, { property: descObj }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-147.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-147.js index 8d1b4a1b50..a6a0dc8021 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-147.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-147.js @@ -35,7 +35,8 @@ Object.defineProperties(obj, { property: descObj }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-148.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-148.js index 63cb98e814..393b64d1bf 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-148.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-148.js @@ -21,7 +21,8 @@ Object.defineProperties(obj, { property: descObj }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-149.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-149.js index 1c2556cbc8..069f8267ce 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-149.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-149.js @@ -33,7 +33,8 @@ Object.defineProperties(obj, { property: descObj }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-150.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-150.js index 4c4b1717dc..dd4c0627c2 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-150.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-150.js @@ -27,7 +27,8 @@ Object.defineProperties(obj, { property: descObj }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-151.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-151.js index 65c386d29e..52b27802bb 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-151.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-151.js @@ -22,7 +22,8 @@ Object.defineProperties(obj, { property: func }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-152.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-152.js index 8c48fb76e7..9f41fd0f16 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-152.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-152.js @@ -20,7 +20,8 @@ Object.defineProperties(obj, { property: arr }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-153.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-153.js index bb53c4479c..8350b76d13 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-153.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-153.js @@ -20,7 +20,8 @@ Object.defineProperties(obj, { property: str }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-154.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-154.js index 9169fecaa5..f525efe3bc 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-154.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-154.js @@ -20,7 +20,8 @@ Object.defineProperties(obj, { property: descObj }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-155.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-155.js index 9e00beb444..4c9fc79514 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-155.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-155.js @@ -20,7 +20,8 @@ Object.defineProperties(obj, { property: descObj }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-156.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-156.js index 2ecb58c0ff..32f35ad65a 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-156.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-156.js @@ -19,7 +19,8 @@ Object.defineProperties(obj, { property: Math }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-157.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-157.js index f59bf901cf..2f8b893640 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-157.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-157.js @@ -20,7 +20,8 @@ Object.defineProperties(obj, { property: descObj }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-158.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-158.js index 3dfaede9c5..d496fb8c3f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-158.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-158.js @@ -20,7 +20,8 @@ Object.defineProperties(obj, { property: descObj }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-159.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-159.js index 8aa6779cc4..0caea972f3 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-159.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-159.js @@ -18,7 +18,8 @@ Object.defineProperties(obj, { property: JSON }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-160.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-160.js index 5b32ddb731..4c25c2e3f8 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-160.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-160.js @@ -20,7 +20,8 @@ Object.defineProperties(obj, { property: descObj }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-161.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-161.js index 1b952cf469..b716822825 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-161.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-161.js @@ -19,8 +19,9 @@ var func = function(a, b) { property: arguments }); - assert(obj.hasOwnProperty("property")); - verifyNotWritable(obj, "property"); + verifyProperty(obj, "property", { + writable: false, + }); }; func(); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-163.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-163.js index 16940fe042..0592cacc01 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-163.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-163.js @@ -19,7 +19,8 @@ Object.defineProperties(obj, { property: this }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-164.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-164.js index 46ee75a0b4..e02de2a1c8 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-164.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-164.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-165.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-165.js index 4c84d6a35f..88f2995544 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-165.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-165.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-167.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-167.js index 93001e24f6..edcadba7ad 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-167.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-167.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-168.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-168.js index 59e2d01fe4..e7e798f730 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-168.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-168.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-169.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-169.js index 1482e22d29..b0f1b30c4a 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-169.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-169.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-170.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-170.js index 44fcd2d56f..8027fce780 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-170.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-170.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-171.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-171.js index 5a4d2a2dda..b77bbe2b3d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-171.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-171.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-174.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-174.js index d018248861..dbadab16b2 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-174.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-174.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-60.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-60.js index a213b737e8..3764293f9b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-60.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-60.js @@ -16,7 +16,8 @@ Object.defineProperties(obj, { prop: {} }); -assert(obj.hasOwnProperty("prop")); -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-63.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-63.js index 3564a3c259..fcf969e5eb 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-63.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-63.js @@ -28,7 +28,8 @@ Object.defineProperties(obj, { prop: descObj }); -assert(obj.hasOwnProperty("prop")); -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-64.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-64.js index 895a3897ef..f3dd14d728 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-64.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-64.js @@ -31,7 +31,8 @@ Object.defineProperties(obj, { prop: descObj }); -assert(obj.hasOwnProperty("prop")); -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-67.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-67.js index b9abacb080..513a5bdd5f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-67.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-67.js @@ -30,7 +30,8 @@ Object.defineProperties(obj, { prop: descObj }); -assert(obj.hasOwnProperty("prop")); -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-68.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-68.js index bc74560e09..53d33da07e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-68.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-68.js @@ -33,8 +33,8 @@ Object.defineProperties(obj, { prop: descObj }); -assert(obj.hasOwnProperty("prop")); -verifyNotConfigurable(obj, "prop"); -assert(obj.hasOwnProperty("prop")); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-69.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-69.js index baa2e16a9c..d2f6ee592e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-69.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-69.js @@ -20,7 +20,8 @@ Object.defineProperties(obj, { prop: descObj }); -assert(obj.hasOwnProperty("prop")); -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-70.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-70.js index ef2e2468f2..5a354476bb 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-70.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-70.js @@ -31,7 +31,8 @@ Object.defineProperties(obj, { prop: descObj }); -assert(obj.hasOwnProperty("prop")); -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-71.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-71.js index b0915952d0..a610b091ca 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-71.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-71.js @@ -25,7 +25,8 @@ Object.defineProperties(obj, { prop: descObj }); -assert(obj.hasOwnProperty("prop")); -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-85.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-85.js index 4417c630c6..94c392693d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-85.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-85.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-86.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-86.js index 2745ab8dc5..a856931390 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-86.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-86.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-88.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-88.js index 461bc8e7eb..c7f4adced9 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-88.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-88.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-89.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-89.js index 79c808f491..be36e00228 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-89.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-89.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-90.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-90.js index 198d61ea03..ccb64939b7 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-90.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-90.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-91.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-91.js index 701fe1df53..40b32a4e38 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-91.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-91.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-92.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-92.js index b7997b1714..cda32f5710 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-92.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-92.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-95.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-95.js index db02d8a4c9..277eea621a 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-95.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-5-b-95.js @@ -17,7 +17,8 @@ Object.defineProperties(obj, { } }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-100.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-100.js index 47bc46e287..dfe8e37455 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-100.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-100.js @@ -25,12 +25,12 @@ Object.defineProperties(obj, { configurable: false } }); -verifyEqualTo(obj, "foo", 200); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 200, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-101.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-101.js index 462fb436d4..a0292d8c7f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-101.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-101.js @@ -41,8 +41,9 @@ verifyEqualTo(obj, "foo", get_func2()); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-102.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-102.js index a52e3b7580..6691b4e82e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-102.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-102.js @@ -34,8 +34,9 @@ Object.defineProperties(obj, { }); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-103.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-103.js index 69239b2647..6963afe790 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-103.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-103.js @@ -36,8 +36,9 @@ verifyEqualTo(obj, "foo", get_func()); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-104.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-104.js index 9723898ac6..75e893ec15 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-104.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-104.js @@ -41,8 +41,9 @@ verifyEqualTo(obj, "foo", get_func()); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-105.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-105.js index e8557c7375..5e04bee2d5 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-105.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-105.js @@ -6,6 +6,7 @@ es5id: 15.2.3.7-6-a-105 description: > Object.defineProperties - 'P' is accessor property, P.[[Set]] is present and properties.[[Set]] is undefined (8.12.9 step 12) +includes: [propertyHelper.js] ---*/ var obj = {}; @@ -31,7 +32,6 @@ Object.defineProperties(obj, { } }); -var hasProperty = obj.hasOwnProperty("property"); var verifyGet = false; verifyGet = (obj.property === 10); @@ -39,21 +39,13 @@ var verifySet = false; var desc = Object.getOwnPropertyDescriptor(obj, "property"); verifySet = (typeof desc.set === 'undefined'); -var verifyEnumerable = false; -for (var p in obj) { - if (p === "property") { - verifyEnumerable = true; - } -} - -var verifyConfigurable = false; -delete obj.property; -verifyConfigurable = obj.hasOwnProperty("property"); +verifyProperty(obj, "property", { + enumerable: true, + configurable: true, +}); -assert(hasProperty, 'hasProperty !== true'); assert(verifyGet, 'verifyGet !== true'); assert(verifySet, 'verifySet !== true'); -assert(verifyEnumerable, 'verifyEnumerable !== true'); -assert.sameValue(verifyConfigurable, false, 'verifyConfigurable'); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-106.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-106.js index 67cf09ee28..fff80e4e60 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-106.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-106.js @@ -36,8 +36,9 @@ verifyEqualTo(obj, "foo", get_func()); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-107.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-107.js index 87f7990aaa..95f6f95731 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-107.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-107.js @@ -36,8 +36,9 @@ verifyEqualTo(obj, "foo", get_func()); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyNotEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-108.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-108.js index cf434bfbd8..63f1b17621 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-108.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-108.js @@ -36,8 +36,9 @@ verifyEqualTo(obj, "foo", get_func()); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-109.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-109.js index 021bf58825..ccce309d3b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-109.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-109.js @@ -44,8 +44,9 @@ verifyEqualTo(obj, "foo", get_func2()); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-110.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-110.js index 1dca6bcb2f..71a658e156 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-110.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-110.js @@ -36,19 +36,21 @@ var properties = { }; Object.defineProperties(obj, properties); -verifyEqualTo(obj, "foo1", 200); -verifyWritable(obj, "foo1"); +verifyProperty(obj, "foo1", { + value: 200, + writable: true, + enumerable: true, + configurable: true, +}); -verifyEnumerable(obj, "foo1"); - -verifyConfigurable(obj, "foo1"); verifyEqualTo(obj, "foo2", get_func()); verifyWritable(obj, "foo2", "setVerifyHelpProp"); -verifyEnumerable(obj, "foo2"); - -verifyConfigurable(obj, "foo2"); +verifyProperty(obj, "foo2", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-114-b.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-114-b.js index dd6222e964..fe50a5bf47 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-114-b.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-114-b.js @@ -24,8 +24,9 @@ verifyEqualTo(arr, "length", 0); verifyWritable(arr, "length", "length", 1); -verifyNotEnumerable(arr, "length"); - -verifyNotConfigurable(arr, "length"); +verifyProperty(arr, "length", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-114.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-114.js index 2afb374774..d11ce306db 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-114.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-114.js @@ -26,8 +26,9 @@ verifyEqualTo(arr, "length", 2); verifyWritable(arr, "length", "length", 5); -verifyNotEnumerable(arr, "length"); - -verifyNotConfigurable(arr, "length"); +verifyProperty(arr, "length", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-115.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-115.js index 239ba3bb3e..7bd6e47c8d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-115.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-115.js @@ -24,10 +24,11 @@ Object.defineProperties(arr, { assert.sameValue(arr.length, 0); arr.length = 2; -assert.sameValue(arr.length, 2); -verifyNotEnumerable(arr, "length"); - -verifyNotConfigurable(arr, "length"); +verifyProperty(arr, "length", { + value: 2, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-12.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-12.js index 0c195e5e0d..323e2e3f49 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-12.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-12.js @@ -26,18 +26,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(fun, "prop", 11); - - verifyNotWritable(fun, "prop"); - - verifyNotEnumerable(fun, "prop"); - - verifyNotConfigurable(fun, "prop"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(fun, "prop", { + value: 11, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-120.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-120.js index 4704109b46..0b7585f683 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-120.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-120.js @@ -19,12 +19,11 @@ Object.defineProperties(arr, { } }); -verifyEqualTo(arr, "length", 0); - -verifyNotWritable(arr, "length"); - -verifyNotEnumerable(arr, "length"); - -verifyNotConfigurable(arr, "length"); +verifyProperty(arr, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-13.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-13.js index be22cb8d81..daf0c3e4ec 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-13.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-13.js @@ -25,18 +25,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arr, "prop", 11); - - verifyNotWritable(arr, "prop"); - - verifyNotEnumerable(arr, "prop"); - - verifyNotConfigurable(arr, "prop"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "prop", { + value: 11, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-14.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-14.js index 3ecd73ab51..3de547f1e7 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-14.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-14.js @@ -25,18 +25,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(str, "prop", 11); - - verifyNotWritable(str, "prop"); - - verifyNotEnumerable(str, "prop"); - - verifyNotConfigurable(str, "prop"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(str, "prop", { + value: 11, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-15.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-15.js index a86aaa2ec5..ede416b548 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-15.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-15.js @@ -26,18 +26,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "prop", 11); - - verifyNotWritable(obj, "prop"); - - verifyNotEnumerable(obj, "prop"); - - verifyNotConfigurable(obj, "prop"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "prop", { + value: 11, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-16.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-16.js index e78dcaa3e2..1e72361437 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-16.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-16.js @@ -26,18 +26,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "prop", 11); - - verifyNotWritable(obj, "prop"); - - verifyNotEnumerable(obj, "prop"); - - verifyNotConfigurable(obj, "prop"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "prop", { + value: 11, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-163.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-163.js index cbe3a65ff3..7359782f32 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-163.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-163.js @@ -24,10 +24,12 @@ Object.defineProperties(arr, { }); //try to overwrite length value of arr -verifyNotWritable(arr, "length") +verifyProperty(arr, "length", { + value: 1, + writable: false, +}); assert(!arr.hasOwnProperty("1")); -assert.sameValue(arr.length, 1); assert.sameValue(arr[0], 0); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-164.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-164.js index f699551ca6..f7bd847919 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-164.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-164.js @@ -31,8 +31,11 @@ try { throw new Test262Error("expected to throw TypeError") } catch (e) { assert(e instanceof TypeError); - assert.sameValue(arr.length, 2); - verifyNotWritable(arr, "length"); } +verifyProperty(arr, "length", { + value: 2, + writable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-176.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-176.js index 7117baebef..cbcebe0b84 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-176.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-176.js @@ -31,11 +31,16 @@ try { throw new Test262Error("Expected to throw TypeError"); } catch (e) { assert(e instanceof TypeError); - assert(arr.hasOwnProperty("1")); - verifyNotWritable(arr, "length"); - assert.sameValue(arr[0], 0); - assert.sameValue(arr[1], 1); - assert.sameValue(arr.length, 2) } +assert(arr.hasOwnProperty("1")); + +verifyProperty(arr, "length", { + value: 2, + writable: false, +}); + +assert.sameValue(arr[0], 0); +assert.sameValue(arr[1], 1); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-177.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-177.js index 1ebd1320be..5bcbd47137 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-177.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-177.js @@ -24,8 +24,11 @@ Object.defineProperties(arr, { }); assert(!arr.hasOwnProperty("1")); -assert.sameValue(arr.length, 0); assert(!arr.hasOwnProperty("0")); -verifyNotWritable(arr, "length"); + +verifyProperty(arr, "length", { + value: 0, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-18.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-18.js index fcd1e5d0d7..0c037c61f7 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-18.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-18.js @@ -26,18 +26,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "prop", 11); - - verifyNotWritable(obj, "prop"); - - verifyNotEnumerable(obj, "prop"); - - verifyNotConfigurable(obj, "prop"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "prop", { + value: 11, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-19.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-19.js index 9d5111dd19..f4a223d68e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-19.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-19.js @@ -26,18 +26,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "prop", 11); - - verifyNotWritable(obj, "prop"); - - verifyNotEnumerable(obj, "prop"); - - verifyNotConfigurable(obj, "prop"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "prop", { + value: 11, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-195.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-195.js index 46e202818f..7ba221bf61 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-195.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-195.js @@ -19,12 +19,11 @@ Object.defineProperties(arr, { } }); -verifyEqualTo(arr, "0", undefined); - -verifyNotWritable(arr, "0"); - -verifyEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: undefined, + writable: false, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-197.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-197.js index c95e92a883..b4b4f90351 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-197.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-197.js @@ -24,8 +24,9 @@ Object.defineProperties(arr, { } }); -assert(arr.hasOwnProperty("0")); -verifyNotWritable(arr, "0"); -assert.sameValue(arr[0], 1001); +verifyProperty(arr, "0", { + value: 1001, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-199.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-199.js index 5d24369753..97417e1683 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-199.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-199.js @@ -24,8 +24,8 @@ Object.defineProperties(arr, { } }); -assert(arr.hasOwnProperty("0")); -verifyNotConfigurable(arr, "0"); -assert(arr.hasOwnProperty("0")); +verifyProperty(arr, "0", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-2.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-2.js index 19de43a79c..883e70de76 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-2.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-2.js @@ -26,12 +26,11 @@ Object.defineProperties(obj, { } }); -verifyEqualTo(obj, "prop", 12); - -verifyNotWritable(obj, "prop"); - -verifyNotEnumerable(obj, "prop"); - -verifyConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + value: 12, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-200.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-200.js index b382c908c7..7c43a21b62 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-200.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-200.js @@ -21,12 +21,11 @@ Object.defineProperties(arr, { } }); -verifyEqualTo(arr, "0", 1001); - -verifyNotWritable(arr, "0"); - -verifyNotEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: 1001, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-202.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-202.js index 6997fab614..8a1c4998e5 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-202.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-202.js @@ -8,6 +8,7 @@ description: > named property, 'P' property doesn't exist in 'O', test [[Set]] of 'P' property in 'Attributes' is set as undefined value if [[Set]] is absent in accessor descriptor 'desc' (15.4.5.1 step 4.c) +includes: [propertyHelper.js] ---*/ var arr = []; @@ -23,24 +24,14 @@ Object.defineProperties(arr, { } }); -var verifyEnumerable = false; -for (var i in arr) { - if (i === "0" && arr.hasOwnProperty("0")) { - verifyEnumerable = true; - } -} - var desc = Object.getOwnPropertyDescriptor(arr, "0"); -var propertyDefineCorrect = arr.hasOwnProperty("0"); -var verifyConfigurable = false; -delete arr[0]; -verifyConfigurable = arr.hasOwnProperty("0"); +verifyProperty(arr, "0", { + enumerable: true, + configurable: true, +}); assert.sameValue(typeof desc.set, "undefined", 'typeof desc.set'); -assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); assert.sameValue(desc.get, getFunc, 'desc.get'); -assert.sameValue(verifyConfigurable, false, 'verifyConfigurable'); -assert(verifyEnumerable, 'verifyEnumerable !== true'); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-204.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-204.js index ef679dcc11..1cddaa0ff7 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-204.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-204.js @@ -39,6 +39,8 @@ if (arr.verifySetter !== 101) { throw new Test262Error('Expected arr.verifySetter === 101, actually ' + arr.verifySetter); } -verifyNotConfigurable(arr, 0); +verifyProperty(arr, "0", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-205.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-205.js index 46d98ea0a0..1ebeaac1f8 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-205.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-205.js @@ -42,8 +42,9 @@ verifyEqualTo(arr, "0", getFun()); verifyWritable(arr, "0", "setVerifyHelpProp"); -verifyNotEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-206.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-206.js index a322992ba4..30e0beb774 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-206.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-206.js @@ -18,12 +18,12 @@ arr[0] = 101; // default value of attributes: writable: true, configurable: true Object.defineProperties(arr, { "0": {} }); -verifyEqualTo(arr, "0", 101); -verifyWritable(arr, "0"); - -verifyEnumerable(arr, "0"); - -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: 101, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-207.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-207.js index 46d88c42e1..19ab6047b9 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-207.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-207.js @@ -34,8 +34,9 @@ verifyEqualTo(arr, "0", get_func()); verifyWritable(arr, "0", "setVerifyHelpProp"); -verifyEnumerable(arr, "0"); - -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-208.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-208.js index 7d7f6ae685..33b1beff19 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-208.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-208.js @@ -24,12 +24,12 @@ Object.defineProperties(arr, { } }); -verifyEqualTo(arr, "0", 100); - -verifyWritable(arr, "0"); - -verifyEnumerable(arr, "0"); - -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: 100, + writable: true, + enumerable: true, + configurable: true, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-209.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-209.js index 48d71fdc94..1935f25ea8 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-209.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-209.js @@ -38,8 +38,9 @@ verifyEqualTo(arr, "0", get_func()); verifyWritable(arr, "0", "setVerifyHelpProp"); -verifyEnumerable(arr, "0"); - -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-21.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-21.js index 174de35bac..6f58cf7632 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-21.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-21.js @@ -26,18 +26,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "prop", 11); - - verifyNotWritable(obj, "prop"); - - verifyNotEnumerable(obj, "prop"); - - verifyNotConfigurable(obj, "prop"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "prop", { + value: 11, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-210.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-210.js index 5d74f4dfd0..2809a05d15 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-210.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-210.js @@ -22,12 +22,12 @@ Object.defineProperties(arr, { value: undefined } }); -verifyEqualTo(arr, "0", undefined); -verifyNotWritable(arr, "0"); - -verifyNotEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-211.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-211.js index 163eb6c69f..f1f02085c9 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-211.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-211.js @@ -21,12 +21,12 @@ Object.defineProperties(arr, { value: null } }); -verifyEqualTo(arr, "0", null); -verifyNotWritable(arr, "0"); - -verifyNotEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: null, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-212.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-212.js index d6aa9bdf5b..7d32ce4958 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-212.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-212.js @@ -22,12 +22,11 @@ Object.defineProperties(arr, { } }); -verifyEqualTo(arr, "0", NaN); - -verifyNotWritable(arr, "0"); - -verifyNotEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: NaN, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-213.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-213.js index b9bff48f9d..000b189084 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-213.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-213.js @@ -24,18 +24,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arr, "0", -0); - - verifyNotWritable(arr, "0"); - - verifyNotEnumerable(arr, "0"); - - verifyNotConfigurable(arr, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "0", { + value: -0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-214.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-214.js index 356f64d1bd..934d03d507 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-214.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-214.js @@ -24,18 +24,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arr, "0", +0); - - verifyNotWritable(arr, "0"); - - verifyNotEnumerable(arr, "0"); - - verifyNotConfigurable(arr, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "0", { + value: +0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-215.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-215.js index ea5c1a2d3f..4cc0c47522 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-215.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-215.js @@ -22,12 +22,12 @@ Object.defineProperties(arr, { value: 101 } }); -verifyEqualTo(arr, "0", 101); -verifyNotWritable(arr, "0"); - -verifyNotEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: 101, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-216.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-216.js index b658b05038..bda83e12a4 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-216.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-216.js @@ -22,12 +22,12 @@ Object.defineProperties(arr, { value: "abcd" } }); -verifyEqualTo(arr, "0", "abcd"); -verifyNotWritable(arr, "0"); - -verifyNotEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: "abcd", + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-217.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-217.js index 94e975a2cb..cf81d69f53 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-217.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-217.js @@ -22,12 +22,12 @@ Object.defineProperties(arr, { value: true } }); -verifyEqualTo(arr, "0", true); -verifyNotWritable(arr, "0"); - -verifyNotEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: true, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-218.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-218.js index 9fefdec9a6..c8998fdd88 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-218.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-218.js @@ -27,12 +27,12 @@ var properties = { }; Object.defineProperties(arr, properties); -verifyEqualTo(arr, "0", obj1); -verifyNotWritable(arr, "0"); - -verifyNotEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: obj1, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-219.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-219.js index 50afb5f2b0..7e53f2f81f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-219.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-219.js @@ -21,12 +21,12 @@ Object.defineProperties(arr, { writable: true } }); -verifyEqualTo(arr, "0", undefined); -verifyWritable(arr, "0"); - -verifyNotEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: undefined, + writable: true, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-220.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-220.js index e655774ae2..b6a031738f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-220.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-220.js @@ -22,12 +22,12 @@ Object.defineProperties(arr, { writable: false } }); -verifyEqualTo(arr, "0", undefined); -verifyNotWritable(arr, "0"); - -verifyNotEnumerable(arr, "0"); - -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: undefined, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-221.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-221.js index f3d107084e..a2ee179aba 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-221.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-221.js @@ -28,8 +28,9 @@ Object.defineProperties(arr, { }); verifyEqualTo(arr, "0", get_func()); -verifyNotEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-222.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-222.js index b9f60bdb8f..eaaf719083 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-222.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-222.js @@ -28,8 +28,9 @@ Object.defineProperties(arr, { }); verifyWritable(arr, "0", "setVerifyHelpProp"); -verifyNotEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-223.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-223.js index 25c4ab4089..f66435c528 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-223.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-223.js @@ -21,12 +21,12 @@ Object.defineProperties(arr, { enumerable: true } }); -verifyEqualTo(arr, "0", undefined); -verifyNotWritable(arr, "0"); - -verifyEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: undefined, + writable: false, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-224.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-224.js index 127f8f89dd..e27cf9f8dd 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-224.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-224.js @@ -22,12 +22,12 @@ Object.defineProperties(arr, { enumerable: false } }); -verifyEqualTo(arr, "0", undefined); -verifyNotWritable(arr, "0"); - -verifyNotEnumerable(arr, "0"); - -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: undefined, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-225.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-225.js index 9db9a3514d..ecd4214862 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-225.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-225.js @@ -21,12 +21,12 @@ Object.defineProperties(arr, { configurable: true } }); -verifyEqualTo(arr, "0", undefined); -verifyNotWritable(arr, "0"); - -verifyNotEnumerable(arr, "0"); - -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: undefined, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-226.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-226.js index 0b839c70e3..783378d959 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-226.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-226.js @@ -21,12 +21,12 @@ Object.defineProperties(arr, { configurable: false } }); -verifyEqualTo(arr, "0", undefined); -verifyNotWritable(arr, "0"); - -verifyNotEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-227.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-227.js index 7e0a0eb3b8..2df44c3abe 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-227.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-227.js @@ -27,18 +27,16 @@ try { } }); } catch (e) { - verifyEqualTo(arr, "1", 3); - - verifyNotWritable(arr, "1"); - - verifyNotEnumerable(arr, "1"); - - verifyNotConfigurable(arr, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "1", { + value: 3, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-228.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-228.js index ae93f23bb1..66fcadb131 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-228.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-228.js @@ -31,18 +31,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arr, "1", 3); - - verifyNotWritable(arr, "1"); - - verifyNotEnumerable(arr, "1"); - - verifyNotConfigurable(arr, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "1", { + value: 3, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-229.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-229.js index 52eeb0b5ef..08df4167f5 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-229.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-229.js @@ -35,14 +35,14 @@ try { } catch (e) { verifyWritable(arr, "1", "setVerifyHelpProp"); - verifyNotEnumerable(arr, "1"); - - verifyNotConfigurable(arr, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "1", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-230.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-230.js index 70c1ebbcab..5b385533ed 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-230.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-230.js @@ -27,18 +27,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arr, "1", 3); - - verifyNotWritable(arr, "1"); - - verifyNotEnumerable(arr, "1"); - - verifyNotConfigurable(arr, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "1", { + value: 3, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-231.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-231.js index 77e43c731c..58ab02eb54 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-231.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-231.js @@ -27,8 +27,9 @@ Object.defineProperties(arr, { verifyWritable(arr, "1", "setVerifyHelpProp"); -verifyEnumerable(arr, "1"); - -verifyConfigurable(arr, "1"); +verifyProperty(arr, "1", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-232.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-232.js index a8f2187f8c..f585634fa1 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-232.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-232.js @@ -28,12 +28,11 @@ Object.defineProperties(arr, { } }); -verifyEqualTo(arr, "1", 12); - -verifyNotWritable(arr, "1"); - -verifyNotEnumerable(arr, "1"); - -verifyConfigurable(arr, "1"); +verifyProperty(arr, "1", { + value: 12, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-233.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-233.js index cc3247a9c7..5aa8ecd912 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-233.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-233.js @@ -30,18 +30,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arr, "1", undefined); - - verifyNotWritable(arr, "1"); - - verifyNotEnumerable(arr, "1"); - - verifyNotConfigurable(arr, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "1", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-234.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-234.js index 668e02eb0f..15279c0e89 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-234.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-234.js @@ -32,18 +32,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arr, "1", 3); - - verifyNotWritable(arr, "1"); - - verifyNotEnumerable(arr, "1"); - - verifyNotConfigurable(arr, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "1", { + value: 3, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-235.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-235.js index a4becc4796..63526b84e9 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-235.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-235.js @@ -26,18 +26,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arr, "1", +0); - - verifyNotWritable(arr, "1"); - - verifyNotEnumerable(arr, "1"); - - verifyNotConfigurable(arr, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "1", { + value: +0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-236.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-236.js index 7a76261002..8ccd912ed0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-236.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-236.js @@ -27,18 +27,16 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arr, "1", -0); - - verifyNotWritable(arr, "1"); - - verifyNotEnumerable(arr, "1"); - - verifyNotConfigurable(arr, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "1", { + value: -0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-237.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-237.js index 9914b27c44..5332d11ce9 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-237.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-237.js @@ -28,18 +28,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arr, "1", 12); - - verifyNotWritable(arr, "1"); - - verifyNotEnumerable(arr, "1"); - - verifyNotConfigurable(arr, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "1", { + value: 12, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-238.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-238.js index 5928b5b299..5e6177b726 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-238.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-238.js @@ -27,18 +27,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arr, "1", "abcd"); - - verifyNotWritable(arr, "1"); - - verifyNotEnumerable(arr, "1"); - - verifyNotConfigurable(arr, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "1", { + value: "abcd", + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-239.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-239.js index e27cf66f6e..a696416afe 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-239.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-239.js @@ -28,18 +28,16 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arr, "1", true); - - verifyNotWritable(arr, "1"); - - verifyNotEnumerable(arr, "1"); - - verifyNotConfigurable(arr, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "1", { + value: true, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-24.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-24.js index f57eb5d1db..8b95fea263 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-24.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-24.js @@ -24,13 +24,12 @@ Object.defineProperties(this, { } }); -verifyEqualTo(this, "prop", 12); - -verifyWritable(this, "prop"); - -verifyEnumerable(this, "prop"); - -verifyConfigurable(this, "prop"); +verifyProperty(this, "prop", { + value: 12, + writable: true, + enumerable: true, + configurable: true, +}); delete this.prop; diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-240.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-240.js index 3e22e8bf14..ce8c4c36a6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-240.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-240.js @@ -34,18 +34,16 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arr, "1", obj1); - - verifyNotWritable(arr, "1"); - - verifyNotEnumerable(arr, "1"); - - verifyNotConfigurable(arr, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "1", { + value: obj1, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-241.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-241.js index 6167a6ee64..17bb7efd40 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-241.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-241.js @@ -34,14 +34,14 @@ try { } catch (e) { verifyWritable(arr, "1", "setVerifyHelpProp"); - verifyNotEnumerable(arr, "1"); - - verifyNotConfigurable(arr, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "1", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-242.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-242.js index a794b04f0d..937341c5a5 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-242.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-242.js @@ -33,14 +33,14 @@ try { } catch (e) { verifyWritable(arr, "1", "setVerifyHelpProp"); - verifyNotEnumerable(arr, "1"); - - verifyNotConfigurable(arr, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "1", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-243.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-243.js index 4f8ba301c4..9f1b7a70a2 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-243.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-243.js @@ -25,8 +25,9 @@ Object.defineProperties(arr, { } }); -verifyNotEnumerable(arr, "1"); - -verifyNotConfigurable(arr, "1"); +verifyProperty(arr, "1", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-244.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-244.js index 12d578b86f..4b7394ea5b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-244.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-244.js @@ -36,14 +36,14 @@ try { } catch (e) { verifyEqualTo(arr, "1", get_fun()); - verifyNotEnumerable(arr, "1"); - - verifyNotConfigurable(arr, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "1", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-245.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-245.js index 046fc367f8..bb8670ee80 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-245.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-245.js @@ -32,14 +32,14 @@ try { } catch (e) { verifyEqualTo(arr, "1", get_fun()); - verifyNotEnumerable(arr, "1"); - - verifyNotConfigurable(arr, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "1", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-246.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-246.js index f7bd329a1e..193596163a 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-246.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-246.js @@ -26,8 +26,9 @@ Object.defineProperties(arr, { } }); -verifyNotEnumerable(arr, "1"); - -verifyNotConfigurable(arr, "1"); +verifyProperty(arr, "1", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-247.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-247.js index f597aaf1af..99151a6eb0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-247.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-247.js @@ -19,12 +19,12 @@ Object.defineProperties(arr, { value: 36 } }); -verifyEqualTo(arr, "0", 36); -verifyWritable(arr, "0"); - -verifyEnumerable(arr, "0"); - -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: 36, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-248.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-248.js index 547713544d..a5ec7a2b73 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-248.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-248.js @@ -19,12 +19,12 @@ Object.defineProperties(arr, { value: undefined } }); -verifyEqualTo(arr, "0", undefined); -verifyWritable(arr, "0"); - -verifyEnumerable(arr, "0"); - -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: undefined, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-249.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-249.js index 36907737c5..8a3179cc5b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-249.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-249.js @@ -19,12 +19,12 @@ Object.defineProperties(arr, { value: 12 } }); -verifyEqualTo(arr, "0", 12); -verifyWritable(arr, "0"); - -verifyEnumerable(arr, "0"); - -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: 12, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-250.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-250.js index f247cfd64b..5332c7076e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-250.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-250.js @@ -19,12 +19,12 @@ Object.defineProperties(arr, { writable: false } }); -verifyEqualTo(arr, "0", 100); -verifyNotWritable(arr, "0"); - -verifyEnumerable(arr, "0"); - -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: 100, + writable: false, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-251.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-251.js index d8e2e29bf4..1ffc966b9f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-251.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-251.js @@ -19,12 +19,12 @@ Object.defineProperties(arr, { enumerable: false } }); -verifyEqualTo(arr, "0", 12); -verifyWritable(arr, "0"); - -verifyNotEnumerable(arr, "0"); - -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: 12, + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-252.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-252.js index c74dba3fb4..dea3971ab4 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-252.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-252.js @@ -19,12 +19,12 @@ Object.defineProperties(arr, { configurable: false } }); -verifyEqualTo(arr, "0", 12); -verifyWritable(arr, "0"); - -verifyEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: 12, + writable: true, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-253.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-253.js index bec2effb09..4ec4199c2a 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-253.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-253.js @@ -21,12 +21,12 @@ Object.defineProperties(arr, { configurable: false } }); -verifyEqualTo(arr, "0", 36); -verifyNotWritable(arr, "0"); - -verifyEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + value: 36, + writable: false, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-254.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-254.js index 5ff7603393..52dfbc2240 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-254.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-254.js @@ -32,8 +32,9 @@ Object.defineProperties(arr, { }); verifyEqualTo(arr, "0", get_fun()); -verifyNotEnumerable(arr, "0"); - -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-255.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-255.js index ca5c0bb33f..e10cec2a3f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-255.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-255.js @@ -26,8 +26,10 @@ Object.defineProperties(arr, { get: undefined } }); -verifyNotEnumerable(arr, "0"); -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-256.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-256.js index 5f2eec519b..5578340283 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-256.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-256.js @@ -30,8 +30,9 @@ Object.defineProperties(arr, { }); verifyEqualTo(arr, "0", get_fun()); -verifyNotEnumerable(arr, "0"); - -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-257.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-257.js index 24ebf36025..6400a30657 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-257.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-257.js @@ -30,8 +30,9 @@ Object.defineProperties(arr, { }); verifyWritable(arr, "0", "setVerifyHelpProp"); -verifyNotEnumerable(arr, "0"); - -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-258.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-258.js index 0cb48c5eb7..45d2f9322b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-258.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-258.js @@ -24,8 +24,10 @@ Object.defineProperties(arr, { set: undefined } }); -verifyNotEnumerable(arr, "0"); -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-259.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-259.js index 0e846489aa..9ea293761b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-259.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-259.js @@ -29,8 +29,9 @@ Object.defineProperties(arr, { }); verifyWritable(arr, "0", "setVerifyHelpProp"); -verifyNotEnumerable(arr, "0"); - -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-260.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-260.js index 62e09ab0f2..441fd014bf 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-260.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-260.js @@ -30,8 +30,9 @@ Object.defineProperties(arr, { }); verifyWritable(arr, "0", "setVerifyHelpProp"); -verifyNotEnumerable(arr, "0"); - -verifyConfigurable(arr, "0"); +verifyProperty(arr, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-261.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-261.js index 3a4aeaac10..a89d450ef1 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-261.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-261.js @@ -29,8 +29,9 @@ Object.defineProperties(arr, { }); verifyWritable(arr, "0", "setVerifyHelpProp"); -verifyNotEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-262.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-262.js index ee319f6ff2..6ba5bf8bfc 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-262.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-262.js @@ -41,8 +41,9 @@ verifyEqualTo(arr, "0", get_fun()); verifyWritable(arr, "0", "setVerifyHelpProp"); -verifyNotEnumerable(arr, "0"); - -verifyNotConfigurable(arr, "0"); +verifyProperty(arr, "0", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-266.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-266.js index 689bec9b21..a81edc844e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-266.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-266.js @@ -22,13 +22,13 @@ Object.defineProperties(arr, { configurable: true } }); -verifyEqualTo(arr, "property", 12); -verifyWritable(arr, "property"); - -verifyEnumerable(arr, "property"); - -verifyConfigurable(arr, "property"); +verifyProperty(arr, "property", { + value: 12, + writable: true, + enumerable: true, + configurable: true, +}); if (arr.length !== 0) { throw new Test262Error('Expected arr.length === 0, actually ' + arr.length); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-267.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-267.js index c81aad2b3f..293f8f33a6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-267.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-267.js @@ -33,9 +33,10 @@ verifyEqualTo(arr, "property", get_fun()); verifyWritable(arr, "property", "setVerifyHelpProp"); -verifyEnumerable(arr, "property"); - -verifyConfigurable(arr, "property"); +verifyProperty(arr, "property", { + enumerable: true, + configurable: true, +}); if (arr.length !== 0) { throw new Test262Error('Expected arr.length === 0, actually ' + arr.length); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-268.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-268.js index 3f27c8552a..6ef189d40f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-268.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-268.js @@ -38,8 +38,9 @@ verifyEqualTo(arr, "property", get_fun()); verifyWritable(arr, "property", "verifySetFun"); -verifyNotEnumerable(arr, "property"); - -verifyConfigurable(arr, "property"); +verifyProperty(arr, "property", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-269.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-269.js index 217cd5b052..24d9bf430e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-269.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-269.js @@ -21,13 +21,13 @@ Object.defineProperties(arr, { configurable: false } }); -verifyEqualTo(arr, "property", 12); -verifyNotWritable(arr, "property"); - -verifyNotEnumerable(arr, "property"); - -verifyNotConfigurable(arr, "property"); +verifyProperty(arr, "property", { + value: 12, + writable: false, + enumerable: false, + configurable: false, +}); if (arr.length !== 0) { throw new Test262Error('Expected arr.length === 0, actually ' + arr.length); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-270.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-270.js index 1fb83b1df8..2750ef8cbd 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-270.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-270.js @@ -26,18 +26,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arr, "property", 12); - - verifyNotWritable(arr, "property"); - - verifyNotEnumerable(arr, "property"); - - verifyNotConfigurable(arr, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "property", { + value: 12, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-271.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-271.js index 01af4ede13..9ebe3f3c87 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-271.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-271.js @@ -26,18 +26,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arr, "property", undefined); - - verifyNotWritable(arr, "property"); - - verifyNotEnumerable(arr, "property"); - - verifyNotConfigurable(arr, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "property", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-272.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-272.js index 1235a3604d..8bff8fee16 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-272.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-272.js @@ -27,18 +27,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arr, "property", 12); - - verifyNotWritable(arr, "property"); - - verifyNotEnumerable(arr, "property"); - - verifyNotConfigurable(arr, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "property", { + value: 12, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-273.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-273.js index 9d8807a77f..0108cff387 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-273.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-273.js @@ -26,18 +26,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arr, "property", 12); - - verifyNotWritable(arr, "property"); - - verifyNotEnumerable(arr, "property"); - - verifyNotConfigurable(arr, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "property", { + value: 12, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-274.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-274.js index 87b8c4cb9a..0cab0ced4b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-274.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-274.js @@ -39,14 +39,14 @@ try { verifyWritable(arr, "property", "verifySetFun"); - verifyNotEnumerable(arr, "property"); - - verifyNotConfigurable(arr, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "property", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-275.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-275.js index 73a3eb6ff6..7a13d69ddc 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-275.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-275.js @@ -30,14 +30,14 @@ try { } catch (e) { verifyWritable(arr, "property", "setVerifyHelpProp"); - verifyNotEnumerable(arr, "property"); - - verifyNotConfigurable(arr, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "property", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-276.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-276.js index 4f44eedb27..cc4b257824 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-276.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-276.js @@ -32,14 +32,14 @@ try { } catch (e) { verifyWritable(arr, "property", "setVerifyHelpProp"); - verifyNotEnumerable(arr, "property"); - - verifyNotConfigurable(arr, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "property", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-277.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-277.js index 6015feab01..88cd60fb56 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-277.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-277.js @@ -32,14 +32,14 @@ try { } catch (e) { verifyWritable(arr, "property", "setVerifyHelpProp"); - verifyNotEnumerable(arr, "property"); - - verifyNotConfigurable(arr, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arr, "property", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-278.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-278.js index ee646acae0..380cbf887c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-278.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-278.js @@ -30,12 +30,11 @@ Object.defineProperties(arg, { } }); -verifyEqualTo(arg, "0", 10); - -verifyWritable(arg, "0"); - -verifyEnumerable(arg, "0"); - -verifyConfigurable(arg, "0"); +verifyProperty(arg, "0", { + value: 10, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-279.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-279.js index 69aff91049..a225f9458f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-279.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-279.js @@ -42,8 +42,9 @@ verifyEqualTo(arg, "0", get_func()); verifyWritable(arg, "0", "setVerifyHelpProp"); -verifyEnumerable(arg, "0"); - -verifyConfigurable(arg, "0"); +verifyProperty(arg, "0", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-28.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-28.js index 1b1b00f14b..f46733e9b5 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-28.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-28.js @@ -18,14 +18,9 @@ Object.defineProperties(obj, { } }); -verifyNotWritable(obj, "prop"); - -if (!obj.hasOwnProperty("prop")) { - throw new Test262Error('Expected obj.hasOwnProperty("prop") to be true, actually ' + obj.hasOwnProperty("prop")); -} - -if (obj.prop !== 1001) { - throw new Test262Error('Expected obj.prop === 1001, actually ' + obj.prop); -} +verifyProperty(obj, "prop", { + value: 1001, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-281.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-281.js index 4df7240d9c..87f70353e5 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-281.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-281.js @@ -27,12 +27,11 @@ Object.defineProperties(arg, { } }); -verifyEqualTo(arg, "0", 20); - -verifyNotWritable(arg, "0"); - -verifyNotEnumerable(arg, "0"); - -verifyNotConfigurable(arg, "0"); +verifyProperty(arg, "0", { + value: 20, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-282.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-282.js index 11d6e36781..10322f5329 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-282.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-282.js @@ -34,18 +34,16 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arg, "0", 0); - - verifyNotWritable(arg, "0"); - - verifyEnumerable(arg, "0"); - - verifyNotConfigurable(arg, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "0", { + value: 0, + writable: false, + enumerable: true, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-283.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-283.js index 8ac9b4f704..ccdf040553 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-283.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-283.js @@ -35,18 +35,16 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arg, "0", 0); - - verifyNotWritable(arg, "0"); - - verifyNotEnumerable(arg, "0"); - - verifyNotConfigurable(arg, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "0", { + value: 0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-284.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-284.js index 9fed19833a..6a449ac3d9 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-284.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-284.js @@ -35,18 +35,16 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arg, "0", 0); - - verifyNotWritable(arg, "0"); - - verifyEnumerable(arg, "0"); - - verifyNotConfigurable(arg, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "0", { + value: 0, + writable: false, + enumerable: true, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-285.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-285.js index a22f1a59ba..b375ce09a4 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-285.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-285.js @@ -35,18 +35,16 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arg, "0", 0); - - verifyNotWritable(arg, "0"); - - verifyNotEnumerable(arg, "0"); - - verifyNotConfigurable(arg, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "0", { + value: 0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-288.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-288.js index a5a2feeecd..bb2843f668 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-288.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-288.js @@ -40,14 +40,14 @@ try { } catch (e) { verifyEqualTo(arg, "0", get_func()); - verifyEnumerable(arg, "0"); - - verifyNotConfigurable(arg, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "0", { + enumerable: true, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-289.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-289.js index 58daa19af6..b6ce95181d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-289.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-289.js @@ -40,14 +40,14 @@ try { } catch (e) { verifyEqualTo(arg, "0", get_func()); - verifyEnumerable(arg, "0"); - - verifyNotConfigurable(arg, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "0", { + enumerable: true, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-290.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-290.js index f03e73674a..0b8e42adfe 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-290.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-290.js @@ -30,12 +30,11 @@ Object.defineProperties(arg, { } }); -verifyEqualTo(arg, "0", 10); - -verifyNotWritable(arg, "0"); - -verifyNotEnumerable(arg, "0"); - -verifyNotConfigurable(arg, "0"); +verifyProperty(arg, "0", { + value: 10, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-291.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-291.js index 1319ec70c2..db6f500445 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-291.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-291.js @@ -42,8 +42,9 @@ verifyEqualTo(arg, "0", get_func()); verifyWritable(arg, "0", "setVerifyHelpProp"); -verifyNotEnumerable(arg, "0"); - -verifyNotConfigurable(arg, "0"); +verifyProperty(arg, "0", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-292.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-292.js index a03cfd2060..b46f0bc120 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-292.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-292.js @@ -43,8 +43,9 @@ Object.defineProperties(arg, { verifyEqualTo(arg, "0", get_func2()); -verifyNotEnumerable(arg, "0"); - -verifyNotConfigurable(arg, "0"); +verifyProperty(arg, "0", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-293.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-293.js index 5d9589888b..7267e28935 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-293.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-293.js @@ -28,12 +28,11 @@ Object.defineProperties(arg, { } }); -verifyEqualTo(arg, "0", 20); - -verifyNotWritable(arg, "0"); - -verifyNotEnumerable(arg, "0"); - -verifyNotConfigurable(arg, "0"); +verifyProperty(arg, "0", { + value: 20, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-294.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-294.js index e1af163e2b..efa1e26fb6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-294.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-294.js @@ -34,18 +34,16 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arg, "0", 0); - - verifyNotWritable(arg, "0"); - - verifyNotEnumerable(arg, "0"); - - verifyNotConfigurable(arg, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "0", { + value: 0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-295.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-295.js index 995e695b60..e6fc9e9422 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-295.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-295.js @@ -35,18 +35,16 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arg, "0", 0); - - verifyNotWritable(arg, "0"); - - verifyNotEnumerable(arg, "0"); - - verifyNotConfigurable(arg, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "0", { + value: 0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-296.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-296.js index d63b6abd7c..ee14307684 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-296.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-296.js @@ -35,18 +35,16 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arg, "0", 0); - - verifyNotWritable(arg, "0"); - - verifyEnumerable(arg, "0"); - - verifyNotConfigurable(arg, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "0", { + value: 0, + writable: false, + enumerable: true, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-297.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-297.js index 85a07ad038..d647c69fc9 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-297.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-297.js @@ -35,18 +35,16 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arg, "0", 0); - - verifyNotWritable(arg, "0"); - - verifyNotEnumerable(arg, "0"); - - verifyNotConfigurable(arg, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "0", { + value: 0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-298.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-298.js index 2bb794f123..82f75ed8d5 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-298.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-298.js @@ -42,14 +42,14 @@ try { } catch (e) { verifyEqualTo(arg, "0", get_func1()); - verifyNotEnumerable(arg, "0"); - - verifyNotConfigurable(arg, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "0", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-299.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-299.js index 2e59611209..f3cf964f13 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-299.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-299.js @@ -43,14 +43,14 @@ try { } catch (e) { verifyEqualTo(arg, "0", get_func()); - verifyNotEnumerable(arg, "0"); - - verifyNotConfigurable(arg, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "0", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-30.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-30.js index bba5d89ff4..580dcaf3da 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-30.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-30.js @@ -19,14 +19,9 @@ Object.defineProperties(obj, { } }); -verifyNotConfigurable(obj, "prop"); - -if (!obj.hasOwnProperty("prop")) { - throw new Test262Error('Expected obj.hasOwnProperty("prop") to be true, actually ' + obj.hasOwnProperty("prop")); -} - -if (obj.prop !== 1001) { - throw new Test262Error('Expected obj.prop === 1001, actually ' + obj.prop); -} +verifyProperty(obj, "prop", { + value: 1001, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-300.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-300.js index 7c10d4efa7..4eb41d999f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-300.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-300.js @@ -39,14 +39,14 @@ try { } catch (e) { verifyEqualTo(arg, "0", get_func()); - verifyEnumerable(arg, "0"); - - verifyNotConfigurable(arg, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "0", { + enumerable: true, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-301.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-301.js index 607a3a746d..1dc7c3747d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-301.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-301.js @@ -39,14 +39,14 @@ try { } catch (e) { verifyEqualTo(arg, "0", get_func()); - verifyEnumerable(arg, "0"); - - verifyNotConfigurable(arg, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "0", { + enumerable: true, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-302.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-302.js index 16f710cd40..3e5bee3cc9 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-302.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-302.js @@ -24,12 +24,11 @@ Object.defineProperties(arg, { } }); -verifyEqualTo(arg, "genericProperty", 1001); - -verifyWritable(arg, "genericProperty"); - -verifyEnumerable(arg, "genericProperty"); - -verifyConfigurable(arg, "genericProperty"); +verifyProperty(arg, "genericProperty", { + value: 1001, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-303.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-303.js index f3f32aab1c..91719ca75f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-303.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-303.js @@ -35,8 +35,9 @@ verifyEqualTo(arg, "genericProperty", getFun()); verifyWritable(arg, "genericProperty", "testGetFunction"); -verifyEnumerable(arg, "genericProperty"); - -verifyConfigurable(arg, "genericProperty"); +verifyProperty(arg, "genericProperty", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-304.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-304.js index e5168c7d84..955fc46f5a 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-304.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-304.js @@ -46,8 +46,9 @@ verifyEqualTo(arg, "genericProperty", getFun()); verifyWritable(arg, "genericProperty", "testGetFunction"); -verifyNotEnumerable(arg, "genericProperty"); - -verifyNotConfigurable(arg, "genericProperty"); +verifyProperty(arg, "genericProperty", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-305.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-305.js index 4863298678..2c8528dee0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-305.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-305.js @@ -30,12 +30,11 @@ Object.defineProperties(arg, { } }); -verifyEqualTo(arg, "genericProperty", 1002); - -verifyWritable(arg, "genericProperty"); - -verifyNotEnumerable(arg, "genericProperty"); - -verifyNotConfigurable(arg, "genericProperty"); +verifyProperty(arg, "genericProperty", { + value: 1002, + writable: true, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-306.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-306.js index 5674c28b7d..7fa55bce0e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-306.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-306.js @@ -30,18 +30,16 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arg, "genericProperty", 1001); - - verifyNotWritable(arg, "genericProperty"); - - verifyNotEnumerable(arg, "genericProperty"); - - verifyNotConfigurable(arg, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "genericProperty", { + value: 1001, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-307.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-307.js index f1294cc7e8..7b6840796d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-307.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-307.js @@ -29,18 +29,16 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arg, "genericProperty", undefined); - - verifyNotWritable(arg, "genericProperty"); - - verifyNotEnumerable(arg, "genericProperty"); - - verifyNotConfigurable(arg, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "genericProperty", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-308.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-308.js index f905ee306c..49be313a95 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-308.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-308.js @@ -29,18 +29,16 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arg, "genericProperty", undefined); - - verifyNotWritable(arg, "genericProperty"); - - verifyEnumerable(arg, "genericProperty"); - - verifyNotConfigurable(arg, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "genericProperty", { + value: undefined, + writable: false, + enumerable: true, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-309.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-309.js index fc7e123d7a..20e70b72df 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-309.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-309.js @@ -28,18 +28,16 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arg, "genericProperty", undefined); - - verifyNotWritable(arg, "genericProperty"); - - verifyNotEnumerable(arg, "genericProperty"); - - verifyNotConfigurable(arg, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "genericProperty", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-31.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-31.js index 3e0d7399be..1cc9e68036 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-31.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-31.js @@ -19,12 +19,12 @@ Object.defineProperties(obj, { configurable: false } }); -verifyEqualTo(obj, "prop", 1002); -verifyNotWritable(obj, "prop"); - -verifyNotEnumerable(obj, "prop"); - -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + value: 1002, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-310.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-310.js index a62ee445a7..51326cbe7f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-310.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-310.js @@ -43,14 +43,14 @@ try { verifyWritable(arg, "genericProperty", "verifySetFun"); - verifyNotEnumerable(arg, "genericProperty"); - - verifyNotConfigurable(arg, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "genericProperty", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-311.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-311.js index b5fd0b53f7..e43c360b87 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-311.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-311.js @@ -36,14 +36,14 @@ try { } catch (e) { verifyWritable(arg, "genericProperty", "genericPropertyString"); - verifyNotEnumerable(arg, "genericProperty"); - - verifyNotConfigurable(arg, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "genericProperty", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-312.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-312.js index a890c971e3..1612b14adb 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-312.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-312.js @@ -35,14 +35,14 @@ try { } catch (e) { verifyWritable(arg, "genericProperty", "genericPropertyString"); - verifyEnumerable(arg, "genericProperty"); - - verifyNotConfigurable(arg, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "genericProperty", { + enumerable: true, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-313.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-313.js index 8a0992330e..aa51e97ee2 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-313.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-313.js @@ -34,14 +34,14 @@ try { } catch (e) { verifyWritable(arg, "genericProperty", "genericPropertyString"); - verifyNotEnumerable(arg, "genericProperty"); - - verifyNotConfigurable(arg, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arg, "genericProperty", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-33.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-33.js index c1c992a90d..25c528e02d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-33.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-33.js @@ -24,8 +24,9 @@ Object.defineProperties(obj, { }); verifyWritable(obj, "prop", "setVerifyHelpProp"); -verifyEnumerable(obj, "prop"); - -verifyConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-35.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-35.js index 5ec06c05ef..394f63ff5f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-35.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-35.js @@ -29,8 +29,9 @@ verifyEqualTo(obj, "prop", getFun()); verifyWritable(obj, "prop", "setVerifyHelpProp"); -verifyNotEnumerable(obj, "prop"); - -verifyConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-36.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-36.js index cd1476eaea..7089f666f5 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-36.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-36.js @@ -30,8 +30,9 @@ verifyEqualTo(obj, "prop", 10); verifyWritable(obj, "prop", "setVerifyHelpProp"); -verifyEnumerable(obj, "prop"); - -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-37.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-37.js index afdb5a5709..466884a968 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-37.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-37.js @@ -29,8 +29,9 @@ verifyEqualTo(obj, "prop", getFun()); verifyWritable(obj, "prop", "setVerifyHelpProp"); -verifyNotEnumerable(obj, "prop"); - -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-38-1.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-38-1.js index 97d92d286c..c5c609ad79 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-38-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-38-1.js @@ -29,8 +29,9 @@ Object.defineProperties(obj, { verifyEqualTo(obj, "foo", getFunc()); -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-38.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-38.js index d687d6345e..9bd8a38c7c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-38.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-38.js @@ -17,12 +17,12 @@ obj.foo = 100; // default value of attributes: writable: true, configurable: tru Object.defineProperties(obj, { foo: {} }); -verifyEqualTo(obj, "foo", 100); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 100, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-39.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-39.js index 54c402d74f..ff7d19a48f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-39.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-39.js @@ -22,12 +22,12 @@ Object.defineProperties(obj, { configurable: true } }); -verifyEqualTo(obj, "foo", 101); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 101, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-40.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-40.js index 6c0d2f2c8a..948a61d092 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-40.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-40.js @@ -40,8 +40,9 @@ verifyEqualTo(obj, "foo", get_func()); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-41.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-41.js index f7d9be5dc4..a41d70fd83 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-41.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-41.js @@ -19,12 +19,12 @@ Object.defineProperties(obj, { value: "102" } }); -verifyEqualTo(obj, "foo", "102"); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: "102", + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-42.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-42.js index 26da7ca748..4971c08a34 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-42.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-42.js @@ -22,12 +22,12 @@ Object.defineProperties(obj, { value: undefined } }); -verifyEqualTo(obj, "foo", undefined); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-43.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-43.js index f31e75dbed..53be56ca55 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-43.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-43.js @@ -22,12 +22,12 @@ Object.defineProperties(obj, { value: null } }); -verifyEqualTo(obj, "foo", null); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: null, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-44.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-44.js index ce699a71b2..895b21043b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-44.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-44.js @@ -23,8 +23,10 @@ Object.defineProperties(obj, { } }); -verifyNotEnumerable(obj, "foo"); -verifyNotWritable(obj, "foo"); -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-45.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-45.js index 5738385a85..765e5e3226 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-45.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-45.js @@ -25,18 +25,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", -0); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: -0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-46.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-46.js index 5b7397c87e..3f57029fbc 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-46.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-46.js @@ -25,18 +25,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", +0); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: +0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-47.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-47.js index 3cbc638a8b..871d859a41 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-47.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-47.js @@ -22,12 +22,12 @@ Object.defineProperties(obj, { value: 101 } }); -verifyEqualTo(obj, "foo", 101); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 101, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-48.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-48.js index b3de13ed9d..eb530fdff3 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-48.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-48.js @@ -19,12 +19,12 @@ Object.defineProperties(obj, { value: 102 } }); -verifyEqualTo(obj, "foo", 102); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 102, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-49.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-49.js index 5cb4ac2df9..73beacbde0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-49.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-49.js @@ -23,12 +23,12 @@ Object.defineProperties(obj, { value: "abcd" } }); -verifyEqualTo(obj, "foo", "abcd"); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: "abcd", + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-5.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-5.js index 5893ad38d2..1cf2293e27 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-5.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-5.js @@ -29,16 +29,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "prop", getFunc()); - - verifyNotEnumerable(obj, "prop"); - - verifyNotConfigurable(obj, "prop"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyEqualTo(obj, "prop", getFunc()); + +verifyProperty(obj, "prop", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-50.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-50.js index c4459a802e..2e7473cada 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-50.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-50.js @@ -19,12 +19,12 @@ Object.defineProperties(obj, { value: "fghj" } }); -verifyEqualTo(obj, "foo", "fghj"); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: "fghj", + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-51.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-51.js index eaeb92e3c7..cf927bc359 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-51.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-51.js @@ -22,12 +22,12 @@ Object.defineProperties(obj, { value: true } }); -verifyEqualTo(obj, "foo", true); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: true, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-52.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-52.js index 294565851e..ad4217d829 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-52.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-52.js @@ -19,12 +19,12 @@ Object.defineProperties(obj, { value: false } }); -verifyEqualTo(obj, "foo", false); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: false, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-53.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-53.js index 47a8e4d761..d9a27c8f94 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-53.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-53.js @@ -25,12 +25,12 @@ Object.defineProperties(obj, { value: obj1 } }); -verifyEqualTo(obj, "foo", obj1); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: obj1, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-54.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-54.js index 0c154f563f..b0fc54d4af 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-54.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-54.js @@ -26,12 +26,12 @@ Object.defineProperties(obj, { value: obj2 } }); -verifyEqualTo(obj, "foo", obj2); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: obj2, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-55.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-55.js index 3db7ea5160..da79965576 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-55.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-55.js @@ -22,12 +22,12 @@ Object.defineProperties(obj, { writable: false } }); -verifyEqualTo(obj, "foo", undefined); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-56.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-56.js index c5e8d07b24..8925a1c6a6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-56.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-56.js @@ -24,12 +24,12 @@ Object.defineProperties(obj, { configurable: true } }); -verifyEqualTo(obj, "foo", undefined); -verifyWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: undefined, + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-57.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-57.js index 07a9774921..f257a3fa8a 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-57.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-57.js @@ -26,9 +26,11 @@ Object.defineProperties(obj, { } }); -verifyNotEnumerable(obj, "foo"); assert.sameValue(obj.foo, 10); -verifyNotConfigurable(obj, "foo") +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-58.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-58.js index c774825fb6..2bdb06848a 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-58.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-58.js @@ -6,6 +6,7 @@ es5id: 15.2.3.7-6-a-58 description: > Object.defineProperties - desc.[[Get]] and P.[[Get]] are two objects which refer to the different objects (8.12.9 step 6) +includes: [propertyHelper.js] ---*/ var obj = {}; @@ -29,25 +30,15 @@ Object.defineProperties(obj, { } }); -var verifyEnumerable = false; -for (var p in obj) { - if (p === "foo") { - verifyEnumerable = true; - } -} - -var verifyValue = false; -verifyValue = (obj.foo === 20); +assert.sameValue(obj.foo, 20); var desc = Object.getOwnPropertyDescriptor(obj, "foo"); -var verifyConfigurable = false; -delete obj.foo; -verifyConfigurable = obj.hasOwnProperty("foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: true, +}); -assert.sameValue(verifyConfigurable, false, 'verifyConfigurable'); -assert.sameValue(verifyEnumerable, false, 'verifyEnumerable'); -assert(verifyValue, 'verifyValue !== true'); assert.sameValue(typeof(desc.set), "undefined", 'typeof (desc.set)'); assert.sameValue(desc.get, get_Func2, 'desc.get'); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-59.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-59.js index 55f0b6e98b..c6ef06f2f7 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-59.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-59.js @@ -27,8 +27,9 @@ Object.defineProperties(obj, { }); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-60.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-60.js index 18b3b08eff..654371c09d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-60.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-60.js @@ -30,8 +30,9 @@ Object.defineProperties(obj, { }); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyNotEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-61.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-61.js index d6b97792f2..7bca98d769 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-61.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-61.js @@ -22,12 +22,12 @@ Object.defineProperties(obj, { enumerable: false } }); -verifyEqualTo(obj, "foo", 10); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 10, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-62.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-62.js index 66707f734d..5e8478764f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-62.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-62.js @@ -23,12 +23,12 @@ Object.defineProperties(obj, { enumerable: true } }); -verifyEqualTo(obj, "foo", 10); -verifyNotWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 10, + writable: false, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-63.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-63.js index d6bfa302ff..c88d34a3d9 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-63.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-63.js @@ -23,12 +23,12 @@ Object.defineProperties(obj, { configurable: false } }); -verifyEqualTo(obj, "foo", 10); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 10, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-64.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-64.js index fe97b64dd8..a2666ea4d3 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-64.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-64.js @@ -22,12 +22,12 @@ Object.defineProperties(obj, { configurable: false } }); -verifyEqualTo(obj, "foo", 10); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 10, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-65.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-65.js index c6678316fc..47811b7582 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-65.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-65.js @@ -25,18 +25,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", 10); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: 10, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-66-1.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-66-1.js index dd97034520..ddabfa6957 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-66-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-66-1.js @@ -27,18 +27,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", 10); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: 10, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-66.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-66.js index 6c1a70521e..7bbc90ac6e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-66.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-66.js @@ -27,18 +27,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", 10); - - verifyNotWritable(obj, "foo"); - - verifyEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: 10, + writable: false, + enumerable: true, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-67.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-67.js index 3980343982..3967859349 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-67.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-67.js @@ -31,11 +31,13 @@ try { throw new Test262Error("Expected TypeError"); } catch (e) { assert(e instanceof TypeError); - verifyNotEnumerable(obj, "foo"); assert.sameValue(obj.foo, 10); - verifyNotConfigurable(obj, "foo"); + verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, + }); var desc = Object.getOwnPropertyDescriptor(obj, "foo"); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-68.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-68.js index c2581e46bf..db5ed622cd 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-68.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-68.js @@ -30,18 +30,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", 10); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: 10, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-69.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-69.js index 16f5527999..d94a669dd0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-69.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-69.js @@ -6,6 +6,7 @@ es5id: 15.2.3.7-6-a-69 description: > Object.defineProperties - 'P' is data property and P.configurable is true, desc is accessor property (8.12.9 step 9.b.i) +includes: [propertyHelper.js] ---*/ var obj = {}; @@ -25,25 +26,15 @@ Object.defineProperties(obj, { } }); -var verifyEnumerable = false; -for (var p in obj) { - if (p === "foo") { - verifyEnumerable = true; - } -} - -var verifyValue = false; -verifyValue = (obj.foo === 20); +assert.sameValue(obj.foo, 20); var desc = Object.getOwnPropertyDescriptor(obj, "foo"); -var verifyConfigurable = true; -delete obj.foo; -verifyConfigurable = obj.hasOwnProperty("foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: true, +}); -assert.sameValue(verifyConfigurable, false, 'verifyConfigurable'); -assert.sameValue(verifyEnumerable, false, 'verifyEnumerable'); -assert(verifyValue, 'verifyValue !== true'); assert.sameValue(typeof desc.set, "undefined", 'typeof desc.set'); assert.sameValue(desc.get, get_Func, 'desc.get'); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-70.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-70.js index 2c19545d04..311d85dc1e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-70.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-70.js @@ -27,12 +27,12 @@ Object.defineProperties(obj, { value: 12 } }); -verifyEqualTo(obj, "foo", 12); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 12, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-71.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-71.js index 6be29229ee..85d1d8192e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-71.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-71.js @@ -27,18 +27,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", 10); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: 10, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-72.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-72.js index 3807bf9155..8db43b2aa2 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-72.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-72.js @@ -28,18 +28,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", 10); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: 10, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-73.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-73.js index ec98b17976..4027fc5b41 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-73.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-73.js @@ -24,12 +24,12 @@ Object.defineProperties(obj, { value: undefined } }); -verifyEqualTo(obj, "foo", undefined); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-74.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-74.js index 7efeaf287a..8bbcdbb240 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-74.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-74.js @@ -24,12 +24,12 @@ Object.defineProperties(obj, { value: null } }); -verifyEqualTo(obj, "foo", null); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: null, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-75.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-75.js index a1fe2653ec..b734bd9f6f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-75.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-75.js @@ -26,8 +26,10 @@ Object.defineProperties(obj, { } }); -verifyNotEnumerable(obj, "foo"); -verifyNotWritable(obj, "foo"); -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-76.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-76.js index 1a1c1e02c0..6b6cddb15b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-76.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-76.js @@ -27,18 +27,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", -0); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: -0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-77.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-77.js index 4be63a9fc3..f444cbee00 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-77.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-77.js @@ -27,18 +27,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", +0); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: +0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-78.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-78.js index 2752971e2e..fce755d9ea 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-78.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-78.js @@ -24,12 +24,12 @@ Object.defineProperties(obj, { value: 100 } }); -verifyEqualTo(obj, "foo", 100); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 100, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-79.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-79.js index a6533a918c..b0cddcd66f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-79.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-79.js @@ -27,18 +27,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", 10); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: 10, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-80.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-80.js index a7b91fa17b..bf1780dd56 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-80.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-80.js @@ -24,12 +24,12 @@ Object.defineProperties(obj, { value: "abcd" } }); -verifyEqualTo(obj, "foo", "abcd"); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: "abcd", + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-81.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-81.js index a8b094a8e0..edc253f300 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-81.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-81.js @@ -27,18 +27,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", "abcd"); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: "abcd", + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-82.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-82.js index e5d26c4acd..3d8b01d752 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-82.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-82.js @@ -25,12 +25,12 @@ Object.defineProperties(obj, { value: false } }); -verifyEqualTo(obj, "foo", false); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: false, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-83.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-83.js index 7e69ae863b..28625eebf8 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-83.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-83.js @@ -27,18 +27,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", false); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: false, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-84-1.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-84-1.js index 19c54b3883..b4f1985956 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-84-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-84-1.js @@ -32,12 +32,12 @@ Object.defineProperties(obj, { value: obj2 } }); -verifyEqualTo(obj, "foo", obj1); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: obj1, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-84.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-84.js index 0edfc761a9..873bfc248a 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-84.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-84.js @@ -29,12 +29,12 @@ Object.defineProperties(obj, { value: obj1 } }); -verifyEqualTo(obj, "foo", obj1); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: obj1, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-85.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-85.js index f9b41a56a4..10e7399cf1 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-85.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-85.js @@ -35,18 +35,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", obj1); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: obj1, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-86-1.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-86-1.js index 500986c18d..7b10abcdc2 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-86-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-86-1.js @@ -34,16 +34,16 @@ try { } }); } catch (e) { - verifyWritable(obj, "foo", "setVerifyHelpProp"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyWritable(obj, "foo", "setVerifyHelpProp"); + +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-86.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-86.js index a6f109dabd..b1ebcbc4dd 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-86.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-86.js @@ -29,8 +29,10 @@ Object.defineProperties(obj, { }); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyNotEnumerable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); -verifyNotConfigurable(obj, "foo"); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-87.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-87.js index f1cee12ac7..b4e642bcdc 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-87.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-87.js @@ -32,16 +32,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyWritable(obj, "foo", "setVerifyHelpProp"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyWritable(obj, "foo", "setVerifyHelpProp"); + +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-88.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-88.js index 12de5bbe14..5534a858b6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-88.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-88.js @@ -34,20 +34,20 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - var desc = Object.getOwnPropertyDescriptor(obj, "foo"); - - if (typeof(desc.set) !== "undefined") { - throw new Test262Error('Expected typeof (desc.set) === "undefined", actually ' + typeof(desc.set)); - } - - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } +} + +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); + +var desc = Object.getOwnPropertyDescriptor(obj, "foo"); +if (typeof(desc.set) !== "undefined") { + throw new Test262Error('Expected typeof (desc.set) === "undefined", actually ' + typeof(desc.set)); } reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-89.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-89.js index ae7c1d6aa4..f8cf6dc904 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-89.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-89.js @@ -30,9 +30,10 @@ Object.defineProperties(obj, { } }); -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); var desc = Object.getOwnPropertyDescriptor(obj, "foo"); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-90.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-90.js index 4a7b37c5b0..a6c7d008c1 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-90.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-90.js @@ -37,8 +37,9 @@ verifyEqualTo(obj, "foo", get_func()); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-91.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-91.js index 77f1b0a61c..94a43927be 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-91.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-91.js @@ -44,14 +44,14 @@ try { verifyWritable(obj, "foo", "setVerifyHelpProp"); - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-92.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-92.js index 8a79bf19b1..f17c0e9826 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-92.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-92.js @@ -38,14 +38,14 @@ try { } catch (e) { verifyWritable(obj, "foo", "setVerifyHelpProp"); - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93-1.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93-1.js index 14f8f294c5..702cfc7abd 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93-1.js @@ -38,25 +38,23 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "property", 1002); - - verifyNotWritable(obj, "property"); - - verifyNotEnumerable(obj, "property"); - - verifyConfigurable(obj, "property"); - verifyEqualTo(obj, "property1", 1003); - - verifyNotWritable(obj, "property1"); - - verifyNotEnumerable(obj, "property1"); - - verifyNotConfigurable(obj, "property1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "property", { + value: 1002, + writable: false, + enumerable: false, + configurable: true, +}); + +verifyProperty(obj, "property1", { + value: 1003, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93-2.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93-2.js index 3426413f72..c3651d96a6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93-2.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93-2.js @@ -38,25 +38,23 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "0", 1002); - - verifyNotWritable(obj, "0"); - - verifyNotEnumerable(obj, "0"); - - verifyConfigurable(obj, "0"); - verifyEqualTo(obj, "1", 1003); - - verifyNotWritable(obj, "1"); - - verifyNotEnumerable(obj, "1"); - - verifyNotConfigurable(obj, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "0", { + value: 1002, + writable: false, + enumerable: false, + configurable: true, +}); + +verifyProperty(obj, "1", { + value: 1003, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93-3.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93-3.js index 927d25a004..9ae84e271d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93-3.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93-3.js @@ -37,26 +37,23 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "property", 1001); - - verifyNotWritable(obj, "property"); - - verifyNotEnumerable(obj, "property"); - - verifyNotConfigurable(obj, "property"); - - verifyEqualTo(obj, "property1", 1003); - - verifyNotWritable(obj, "property1"); - - verifyNotEnumerable(obj, "property1"); - - verifyConfigurable(obj, "property1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "property", { + value: 1001, + writable: false, + enumerable: false, + configurable: false, +}); + +verifyProperty(obj, "property1", { + value: 1003, + writable: false, + enumerable: false, + configurable: true, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93-4.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93-4.js index 7d6548ea1d..53ff196de0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93-4.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93-4.js @@ -37,25 +37,23 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "0", 1001); - - verifyNotWritable(obj, "0"); - - verifyNotEnumerable(obj, "0"); - - verifyNotConfigurable(obj, "0"); - verifyEqualTo(obj, "1", 1003); - - verifyNotWritable(obj, "1"); - - verifyNotEnumerable(obj, "1"); - - verifyConfigurable(obj, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "0", { + value: 1001, + writable: false, + enumerable: false, + configurable: false, +}); + +verifyProperty(obj, "1", { + value: 1003, + writable: false, + enumerable: false, + configurable: true, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93.js index cbfc06a190..3c53e641cc 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-93.js @@ -31,8 +31,9 @@ Object.defineProperties(obj, { }); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-94.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-94.js index 8f97c40e12..7eeef1842b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-94.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-94.js @@ -19,12 +19,12 @@ Object.defineProperties(obj, { value: 200 } }); -verifyEqualTo(obj, "foo", 200); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 200, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-95.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-95.js index b89ec12636..fed250c3a3 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-95.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-95.js @@ -24,12 +24,12 @@ Object.defineProperties(obj, { value: undefined } }); -verifyEqualTo(obj, "foo", undefined); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: undefined, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-96.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-96.js index cecec30eb2..06d55a0c5f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-96.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-96.js @@ -24,12 +24,12 @@ Object.defineProperties(obj, { value: 200 } }); -verifyEqualTo(obj, "foo", 200); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 200, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-97.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-97.js index 830402f265..23461d6227 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-97.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-97.js @@ -24,12 +24,12 @@ Object.defineProperties(obj, { writable: true } }); -verifyEqualTo(obj, "foo", 100); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 100, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-98.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-98.js index c45c0b3582..938e2a7b17 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-98.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-98.js @@ -24,12 +24,12 @@ Object.defineProperties(obj, { enumerable: true } }); -verifyEqualTo(obj, "foo", 200); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 200, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-99.js b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-99.js index 8dee2771e6..a91c0ab91f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-99.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-99.js @@ -24,12 +24,12 @@ Object.defineProperties(obj, { configurable: false } }); -verifyEqualTo(obj, "foo", 200); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 200, + writable: true, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/name.js b/js/src/tests/test262/built-ins/Object/defineProperties/name.js index 64e4c0c4c2..2a9d5c9fbe 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/name.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.defineProperties.name, "defineProperties"); - -verifyNotEnumerable(Object.defineProperties, "name"); -verifyNotWritable(Object.defineProperties, "name"); -verifyConfigurable(Object.defineProperties, "name"); +verifyProperty(Object.defineProperties, "name", { + value: "defineProperties", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperties/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/defineProperties/not-a-constructor.js index 7987b575ff..151dd2d509 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperties/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/defineProperties/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Object.defineProperties({}, {}); -}, '`new Object.defineProperties({}, {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-100.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-100.js index de37bdae68..0f9b56f06d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-100.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-100.js @@ -15,7 +15,8 @@ Object.defineProperty(obj, "property", { configurable: null }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-102.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-102.js index a0abf592c3..9352cdf328 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-102.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-102.js @@ -15,7 +15,8 @@ Object.defineProperty(obj, "property", { configurable: false }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-103.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-103.js index c9b59463af..e25a7ab12b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-103.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-103.js @@ -15,7 +15,8 @@ Object.defineProperty(obj, "property", { configurable: 0 }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-104.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-104.js index 9ae7f58e48..ac87f08e86 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-104.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-104.js @@ -15,7 +15,8 @@ Object.defineProperty(obj, "property", { configurable: +0 }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-105.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-105.js index 3055a6ff9f..ccff0ebded 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-105.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-105.js @@ -15,7 +15,8 @@ Object.defineProperty(obj, "property", { configurable: -0 }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-106.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-106.js index c6a037f9a6..5c024dd411 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-106.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-106.js @@ -15,7 +15,8 @@ Object.defineProperty(obj, "property", { configurable: NaN }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-109.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-109.js index 575c4c9459..f433030ddf 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-109.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-109.js @@ -15,7 +15,8 @@ Object.defineProperty(obj, "property", { configurable: "" }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-152.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-152.js index 87913b2d2d..61d481e7e8 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-152.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-152.js @@ -17,8 +17,9 @@ var attr = { Object.defineProperty(obj, "property", attr); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-153.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-153.js index 20c3e5c191..9f2c747347 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-153.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-153.js @@ -17,7 +17,8 @@ var attr = { Object.defineProperty(obj, "property", attr); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-162.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-162.js index 088bb9d5d2..79882c4f16 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-162.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-162.js @@ -18,7 +18,8 @@ Object.defineProperty(attr, "writable", { Object.defineProperty(obj, "property", attr); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-163.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-163.js index bfd2ff3dfb..80b482d4f3 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-163.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-163.js @@ -29,7 +29,8 @@ Object.defineProperty(child, "writable", { Object.defineProperty(obj, "property", child); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-164.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-164.js index 61fe9a5583..2f270d9b9d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-164.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-164.js @@ -24,7 +24,8 @@ var child = new ConstructFun(); Object.defineProperty(obj, "property", child); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-171-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-171-1.js index d8ee8da884..feffeefe59 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-171-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-171-1.js @@ -17,8 +17,10 @@ try { var dateObj = new Date(); Object.defineProperty(obj, "property", dateObj); - verifyWritable(obj, "property"); + verifyProperty(obj, "property", { + writable: true, + }); } finally { delete Date.prototype.writable; } diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-178.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-178.js index 42ab36b422..9069d503ad 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-178.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-178.js @@ -15,7 +15,8 @@ Object.defineProperty(obj, "property", { writable: undefined }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-179.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-179.js index be0fca785e..c4082a47cc 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-179.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-179.js @@ -15,7 +15,8 @@ Object.defineProperty(obj, "property", { writable: null }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-181.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-181.js index 04a60062e3..1f47b6b09e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-181.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-181.js @@ -15,7 +15,8 @@ Object.defineProperty(obj, "property", { writable: false }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-182.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-182.js index e1506931c8..b38cc2d799 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-182.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-182.js @@ -15,7 +15,8 @@ Object.defineProperty(obj, "property", { writable: 0 }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-183.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-183.js index 08b46c555a..762d8861bd 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-183.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-183.js @@ -15,7 +15,8 @@ Object.defineProperty(obj, "property", { writable: +0 }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-184.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-184.js index d456fbeb38..dca54d121b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-184.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-184.js @@ -15,7 +15,8 @@ Object.defineProperty(obj, "property", { writable: -0 }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-185.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-185.js index 81061f91f0..d51323620d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-185.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-185.js @@ -15,10 +15,9 @@ Object.defineProperty(obj, "property", { writable: NaN }); -assert(obj.hasOwnProperty("property")); - -verifyNotWritable(obj, "property"); - -assert.sameValue(typeof(obj.property), "undefined"); +verifyProperty(obj, "property", { + value: undefined, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-188.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-188.js index 29e6a06d42..554b370535 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-188.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-188.js @@ -15,7 +15,8 @@ Object.defineProperty(obj, "property", { writable: "" }); -assert(obj.hasOwnProperty("property")); -verifyNotWritable(obj, "property"); +verifyProperty(obj, "property", { + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-73.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-73.js index 965fa44537..816b74380c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-73.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-73.js @@ -15,7 +15,8 @@ Object.defineProperty(obj, "property", { configurable: false }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-74.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-74.js index 443d61a4a7..5a2d1d8b46 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-74.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-74.js @@ -15,7 +15,8 @@ Object.defineProperty(obj, "property", { value: 100 }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-76.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-76.js index 076c86ede5..70bbe20368 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-76.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-76.js @@ -22,12 +22,9 @@ var child = new ConstructFun(); Object.defineProperty(obj, "property", child); -assert(obj.hasOwnProperty("property")); - -verifyNotConfigurable(obj, "property"); - -assert(obj.hasOwnProperty("property")); - -assert.sameValue(typeof(obj.property), "undefined"); +verifyProperty(obj, "property", { + value: undefined, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-83.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-83.js index 1ab0672165..e08a8f1e06 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-83.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-83.js @@ -18,7 +18,8 @@ Object.defineProperty(attr, "configurable", { Object.defineProperty(obj, "property", attr); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-84.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-84.js index 2361aa0708..a5be67bd6f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-84.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-84.js @@ -29,7 +29,8 @@ Object.defineProperty(child, "configurable", { Object.defineProperty(obj, "property", child); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-85.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-85.js index 0b0868625f..cab6d919d0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-85.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-85.js @@ -24,11 +24,10 @@ var child = new ConstructFun(); Object.defineProperty(obj, "property", child); -assert(obj.hasOwnProperty("property")); - -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); -assert(obj.hasOwnProperty("property")); assert.sameValue(typeof(obj.property), "undefined"); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-99.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-99.js index aabe445bef..2e46f03642 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-99.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-3-99.js @@ -15,7 +15,8 @@ Object.defineProperty(obj, "property", { configurable: undefined }); -assert(obj.hasOwnProperty("property")); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-100.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-100.js index 34c2f090cd..4e92039f13 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-100.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-100.js @@ -16,12 +16,12 @@ obj.foo = 100; // default value of attributes: writable: true, configurable: tru Object.defineProperty(obj, "foo", { value: 200 }); -verifyEqualTo(obj, "foo", 200); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 200, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-101.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-101.js index 1da7826cf5..3dc30d6ed0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-101.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-101.js @@ -16,12 +16,12 @@ obj.foo = 100; // default value of attributes: writable: true, configurable: tru Object.defineProperty(obj, "foo", { value: undefined }); -verifyEqualTo(obj, "foo", undefined); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: undefined, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-102.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-102.js index 33d84c9f53..06fc9a4887 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-102.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-102.js @@ -16,12 +16,12 @@ obj.foo = undefined; // default value of attributes: writable: true, configurabl Object.defineProperty(obj, "foo", { value: 100 }); -verifyEqualTo(obj, "foo", 100); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 100, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-103.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-103.js index b98b2837f7..b179185952 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-103.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-103.js @@ -20,12 +20,12 @@ Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", { writable: true }); -verifyEqualTo(obj, "foo", undefined); -verifyWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: undefined, + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-104.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-104.js index 28de47218b..5ec8732e23 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-104.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-104.js @@ -20,12 +20,12 @@ Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", { enumerable: true }); -verifyEqualTo(obj, "foo", undefined); -verifyNotWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: undefined, + writable: false, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-105.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-105.js index d1c51afdd3..9da65ba390 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-105.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-105.js @@ -23,12 +23,11 @@ Object.defineProperty(obj, "foo", { configurable: false }); -verifyEqualTo(obj, "foo", 200); - -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 200, + writable: true, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-106.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-106.js index 9d726fe9c3..d4897eb29c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-106.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-106.js @@ -24,12 +24,12 @@ Object.defineProperty(obj, "foo", { writable: false, enumerable: false }); -verifyEqualTo(obj, "foo", 200); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 200, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-107.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-107.js index 949c297366..9c66006422 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-107.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-107.js @@ -38,8 +38,9 @@ verifyEqualTo(obj, "foo", getFunc2()); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyNotEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-108.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-108.js index c9f5864973..58e2152dc6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-108.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-108.js @@ -34,8 +34,9 @@ Object.defineProperty(obj, "foo", { }); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-109.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-109.js index 8093ffd718..fa2d599742 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-109.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-109.js @@ -34,8 +34,9 @@ verifyEqualTo(obj, "foo", getFunc()); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-110.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-110.js index c94fbc8af0..bfbf658e9f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-110.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-110.js @@ -32,8 +32,9 @@ Object.defineProperty(obj, "foo", { }); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-112.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-112.js index 4a80f6b084..662a1cbdca 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-112.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-112.js @@ -35,8 +35,9 @@ verifyEqualTo(obj, "foo", getFunc()); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-113.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-113.js index 48e4fa7f6d..bce7c0d28e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-113.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-113.js @@ -30,8 +30,9 @@ Object.defineProperty(obj, "foo", { verifyEqualTo(obj, "foo", getFunc()); -verifyNotEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-114.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-114.js index a0a8bc367d..a8c2631ca3 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-114.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-114.js @@ -35,8 +35,9 @@ verifyEqualTo(obj, "foo", getFunc()); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-115.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-115.js index 5481206420..6137b1d684 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-115.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-115.js @@ -42,8 +42,9 @@ verifyEqualTo(obj, "foo", getFunc2()); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyNotEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-118.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-118.js index 47a6508761..4407e43422 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-118.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-118.js @@ -16,8 +16,11 @@ Object.defineProperty(arrObj, "length", {}); assert.sameValue(arrObj.length, 0); arrObj.length = 2; -assert.sameValue(arrObj.length, 2); -verifyNotEnumerable(arrObj, "length"); -verifyNotConfigurable(arrObj, "length"); + +verifyProperty(arrObj, "length", { + value: 2, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-119.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-119.js index 0c07b625e0..5f50d645dc 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-119.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-119.js @@ -21,8 +21,11 @@ Object.defineProperty(arrObj, "length", { assert.sameValue(arrObj.length, 0); arrObj.length = 2; -assert.sameValue(arrObj.length, 2); -verifyNotEnumerable(arrObj, "length"); -verifyNotConfigurable(arrObj, "length"); + +verifyProperty(arrObj, "length", { + value: 2, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-124.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-124.js index 1dce4ea87c..ba58d7b69b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-124.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-124.js @@ -16,12 +16,12 @@ var arrObj = []; Object.defineProperty(arrObj, "length", { writable: false }); -verifyEqualTo(arrObj, "length", 0); -verifyNotWritable(arrObj, "length"); - -verifyNotEnumerable(arrObj, "length"); - -verifyNotConfigurable(arrObj, "length"); +verifyProperty(arrObj, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-167.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-167.js index 8c51484bd1..a611ceaf40 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-167.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-167.js @@ -22,7 +22,10 @@ Object.defineProperty(arrObj, "length", { }); assert(!arrObj.hasOwnProperty("1")) -assert.sameValue(arrObj.length, 1); -verifyNotWritable(arrObj, "length"); + +verifyProperty(arrObj, "length", { + value: 1, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-181.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-181.js index 26f0e3e3cd..9b8881341b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-181.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-181.js @@ -21,9 +21,11 @@ Object.defineProperty(arrObj, "length", { writable: false }); -verifyNotWritable(arrObj, "length"); - assert(!arrObj.hasOwnProperty("1")); -assert.sameValue(arrObj.length, 0); + +verifyProperty(arrObj, "length", { + value: 0, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-190.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-190.js index e9f7f17e6a..06d0f71da5 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-190.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-190.js @@ -24,17 +24,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "0", "ownDataProperty"); - - verifyNotWritable(arrObj, "0"); - - verifyNotEnumerable(arrObj, "0"); - - verifyNotConfigurable(arrObj, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } } +verifyProperty(arrObj, "0", { + value: "ownDataProperty", + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-194.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-194.js index c69f78bdbc..f1172f8810 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-194.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-194.js @@ -29,14 +29,14 @@ try { } catch (e) { verifyEqualTo(arrObj, "0", getFunc()); - verifyNotEnumerable(arrObj, "0"); - - verifyNotConfigurable(arrObj, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e.name); } - } +verifyProperty(arrObj, "0", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-195.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-195.js index 56e50846b6..ff0dd05fa3 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-195.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-195.js @@ -41,9 +41,10 @@ try { verifyWritable(arrObj, "0", "helpVerifySet"); - verifyNotEnumerable(arrObj, "0"); - - verifyNotConfigurable(arrObj, "0"); + verifyProperty(arrObj, "0", { + enumerable: false, + configurable: false, + }); } finally { delete Array.prototype[0]; } diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-199.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-199.js index 98cefd1ded..80cbce9a39 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-199.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-199.js @@ -17,12 +17,11 @@ Object.defineProperty(arrObj, "0", { enumerable: true }); -verifyEqualTo(arrObj, "0", undefined); - -verifyNotWritable(arrObj, "0"); - -verifyEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: undefined, + writable: false, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-200.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-200.js index 2c0632c716..b727dfd394 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-200.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-200.js @@ -20,12 +20,11 @@ Object.defineProperty(arrObj, "0", { configurable: false }); -verifyEqualTo(arrObj, "0", undefined); - -verifyWritable(arrObj, "0"); - -verifyEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: undefined, + writable: true, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-201.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-201.js index ab771a71c0..67e5615699 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-201.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-201.js @@ -19,12 +19,12 @@ Object.defineProperty(arrObj, "0", { enumerable: true, configurable: false }); -verifyEqualTo(arrObj, "0", 1001); -verifyNotWritable(arrObj, "0"); - -verifyEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: 1001, + writable: false, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-202.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-202.js index f6fe819199..bb074efafc 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-202.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-202.js @@ -19,12 +19,12 @@ Object.defineProperty(arrObj, "0", { writable: true, configurable: true }); -verifyEqualTo(arrObj, "0", 1001); -verifyWritable(arrObj, "0"); - -verifyNotEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: 1001, + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-203.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-203.js index 9e6cad35fb..49840159a2 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-203.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-203.js @@ -19,12 +19,12 @@ Object.defineProperty(arrObj, "0", { writable: true, enumerable: true }); -verifyEqualTo(arrObj, "0", 1001); -verifyWritable(arrObj, "0"); - -verifyEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: 1001, + writable: true, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-204.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-204.js index b513a1dbb9..49c684f429 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-204.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-204.js @@ -19,12 +19,11 @@ Object.defineProperty(arrObj, "0", { configurable: false }); -verifyEqualTo(arrObj, "0", 1001); - -verifyNotWritable(arrObj, "0"); - -verifyNotEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: 1001, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-205.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-205.js index 72e179ef74..13a6128fa3 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-205.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-205.js @@ -24,8 +24,9 @@ Object.defineProperty(arrObj, "0", { verifyWritable(arrObj, "0", "setVerifyHelpProp"); -verifyEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-207.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-207.js index 966b1744bd..72501910fb 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-207.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-207.js @@ -28,8 +28,9 @@ verifyEqualTo(arrObj, "0", getFunc()); verifyWritable(arrObj, "0", "setVerifyHelpProp"); -verifyNotEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-208.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-208.js index ba15c84b8e..be88bcd111 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-208.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-208.js @@ -27,8 +27,9 @@ verifyEqualTo(arrObj, "0", getFunc()); verifyWritable(arrObj, "0", "setVerifyHelpProp"); -verifyEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-209.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-209.js index cdefdc539e..6a6284615f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-209.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-209.js @@ -38,8 +38,9 @@ verifyEqualTo(arrObj, "0", getFunc()); verifyWritable(arrObj, "0", "setVerifyHelpProp"); -verifyNotEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-210.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-210.js index 3d5614db18..d94a0e32c2 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-210.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-210.js @@ -15,12 +15,12 @@ var arrObj = []; arrObj[0] = 101; // default value of attributes: writable: true, configurable: true, enumerable: true Object.defineProperty(arrObj, "0", {}); -verifyEqualTo(arrObj, "0", 101); -verifyWritable(arrObj, "0"); - -verifyEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: 101, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-211.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-211.js index 74773a8b8c..963370db23 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-211.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-211.js @@ -32,8 +32,9 @@ verifyEqualTo(arrObj, "0", getFunc()); verifyWritable(arrObj, "0", "setVerifyHelpProp"); -verifyEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-212.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-212.js index 60a73af96b..ac275e4b75 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-212.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-212.js @@ -22,12 +22,11 @@ Object.defineProperty(arrObj, "0", { configurable: true }); -verifyEqualTo(arrObj, "0", 100); - -verifyWritable(arrObj, "0"); - -verifyEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: 100, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-213.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-213.js index aba7e1fb85..9af3a4f98e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-213.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-213.js @@ -39,8 +39,9 @@ verifyEqualTo(arrObj, "0", getFunc()); verifyWritable(arrObj, "0", "setVerifyHelpProp"); -verifyEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-214.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-214.js index a68119a095..95c97dc221 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-214.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-214.js @@ -26,18 +26,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "0", 101); - - verifyNotWritable(arrObj, "0"); - - verifyNotEnumerable(arrObj, "0"); - - verifyNotConfigurable(arrObj, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "0", { + value: 101, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-215.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-215.js index f6fccd3a61..84af6b3d29 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-215.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-215.js @@ -19,12 +19,12 @@ Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", { value: undefined }); -verifyEqualTo(arrObj, "0", undefined); -verifyNotWritable(arrObj, "0"); - -verifyNotEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-216.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-216.js index ac7099d2bd..fd58d43e5c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-216.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-216.js @@ -19,12 +19,12 @@ Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", { value: null }); -verifyEqualTo(arrObj, "0", null); -verifyNotWritable(arrObj, "0"); - -verifyNotEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: null, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-217.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-217.js index 3b9df95a20..b539dc5c9d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-217.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-217.js @@ -20,11 +20,11 @@ Object.defineProperty(arrObj, "0", { value: NaN }); -assert(arrObj.hasOwnProperty("0")); -assert(arrObj[0] !== arrObj[0]); - -verifyNotWritable(arrObj, "0"); -verifyNotEnumerable(arrObj, "0"); -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: NaN, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-218.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-218.js index f9e2e8c567..4f1697f07b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-218.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-218.js @@ -23,18 +23,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "0", -0); - - verifyNotWritable(arrObj, "0"); - - verifyNotEnumerable(arrObj, "0"); - - verifyNotConfigurable(arrObj, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "0", { + value: -0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-219.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-219.js index 627a70f3ac..ef0742dce5 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-219.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-219.js @@ -23,18 +23,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "0", +0); - - verifyNotWritable(arrObj, "0"); - - verifyNotEnumerable(arrObj, "0"); - - verifyNotConfigurable(arrObj, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "0", { + value: +0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-220.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-220.js index 1e3d4a2d4c..a890330b36 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-220.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-220.js @@ -20,12 +20,12 @@ Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", { value: 101 }); -verifyEqualTo(arrObj, "0", 101); -verifyNotWritable(arrObj, "0"); - -verifyNotEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: 101, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-221.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-221.js index 00732ff7be..441feff1b9 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-221.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-221.js @@ -25,18 +25,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "0", 101); - - verifyNotWritable(arrObj, "0"); - - verifyNotEnumerable(arrObj, "0"); - - verifyNotConfigurable(arrObj, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "0", { + value: 101, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-222.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-222.js index 88d73c0af9..93d15fbf4f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-222.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-222.js @@ -20,12 +20,12 @@ Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", { value: "abcd" }); -verifyEqualTo(arrObj, "0", "abcd"); -verifyNotWritable(arrObj, "0"); - -verifyNotEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: "abcd", + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-223.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-223.js index 7177f6a39a..b39670d94c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-223.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-223.js @@ -25,18 +25,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "0", "abcd"); - - verifyNotWritable(arrObj, "0"); - - verifyNotEnumerable(arrObj, "0"); - - verifyNotConfigurable(arrObj, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "0", { + value: "abcd", + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-224.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-224.js index 91cac8ffdc..01c57e38f7 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-224.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-224.js @@ -20,12 +20,12 @@ Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", { value: true }); -verifyEqualTo(arrObj, "0", true); -verifyNotWritable(arrObj, "0"); - -verifyNotEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: true, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-225.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-225.js index 28d8f74f8e..29b344eb75 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-225.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-225.js @@ -25,18 +25,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "0", true); - - verifyNotWritable(arrObj, "0"); - - verifyNotEnumerable(arrObj, "0"); - - verifyNotConfigurable(arrObj, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "0", { + value: true, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-226.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-226.js index d766b26449..1b02ed6bbb 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-226.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-226.js @@ -24,12 +24,13 @@ Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", { value: obj1 }); -verifyEqualTo(arrObj, "0", obj1); -verifyNotWritable(arrObj, "0"); - -verifyNotEnumerable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: obj1, + writable: false, + enumerable: false, + configurable: false, +}); -verifyNotConfigurable(arrObj, "0"); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-227.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-227.js index 1834373563..a01f415dac 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-227.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-227.js @@ -32,18 +32,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "0", obj1); - - verifyNotWritable(arrObj, "0"); - - verifyNotEnumerable(arrObj, "0"); - - verifyNotConfigurable(arrObj, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "0", { + value: obj1, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-228.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-228.js index 9316e59db2..c6a7bea532 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-228.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-228.js @@ -20,12 +20,12 @@ Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", { writable: false }); -verifyEqualTo(arrObj, "0", undefined); -verifyNotWritable(arrObj, "0"); - -verifyNotEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-229.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-229.js index e1dead5a60..7dc8b36836 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-229.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-229.js @@ -21,12 +21,12 @@ Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", { writable: true }); -verifyEqualTo(arrObj, "0", undefined); -verifyWritable(arrObj, "0"); - -verifyNotEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: undefined, + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-230.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-230.js index 61d0187d81..44305782dc 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-230.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-230.js @@ -34,8 +34,9 @@ verifyEqualTo(arrObj, "0", getFunc()); verifyWritable(arrObj, "0", "helpVerifySet"); -verifyNotEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-231.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-231.js index 40199bd209..9180a48ff8 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-231.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-231.js @@ -40,8 +40,9 @@ verifyEqualTo(arrObj, "0", getFunc2()); verifyWritable(arrObj, "0", "helpVerifySet"); -verifyNotEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-232.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-232.js index d22adbe6f1..b61f732589 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-232.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-232.js @@ -26,8 +26,9 @@ Object.defineProperty(arrObj, "0", { }); verifyWritable(arrObj, "0", "setVerifyHelpProp"); -verifyNotEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-233.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-233.js index bd2f68977e..137485c1eb 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-233.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-233.js @@ -29,8 +29,9 @@ Object.defineProperty(arrObj, "0", { }); verifyWritable(arrObj, "0", "setVerifyHelpProp"); -verifyNotEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-234.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-234.js index b67690ecd5..056b76e72c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-234.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-234.js @@ -20,12 +20,12 @@ Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", { enumerable: false }); -verifyEqualTo(arrObj, "0", undefined); -verifyNotWritable(arrObj, "0"); - -verifyNotEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-235.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-235.js index d10baaf8d4..6d46f6e47f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-235.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-235.js @@ -21,12 +21,12 @@ Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", { enumerable: true }); -verifyEqualTo(arrObj, "0", undefined); -verifyNotWritable(arrObj, "0"); - -verifyEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: undefined, + writable: false, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-236.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-236.js index b7df65b72a..d403262794 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-236.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-236.js @@ -20,12 +20,12 @@ Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", { configurable: false }); -verifyEqualTo(arrObj, "0", undefined); -verifyNotWritable(arrObj, "0"); - -verifyNotEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-237.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-237.js index 59d2e8c84e..291c075755 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-237.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-237.js @@ -20,12 +20,12 @@ Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", { configurable: false }); -verifyEqualTo(arrObj, "0", undefined); -verifyNotWritable(arrObj, "0"); - -verifyNotEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-238.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-238.js index 9708bd0766..2afbac121c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-238.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-238.js @@ -27,20 +27,17 @@ try { configurable: true }); throw new Test262Error("Expected an exception."); - } catch (e) { - verifyEqualTo(arrObj, "1", 3); - - verifyWritable(arrObj, "1"); - - verifyNotEnumerable(arrObj, "1"); - - verifyNotConfigurable(arrObj, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "1", { + value: 3, + writable: true, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-239.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-239.js index 16a8aa0b1a..3036c00095 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-239.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-239.js @@ -29,20 +29,17 @@ try { enumerable: true }); throw new Test262Error("Expected an exception."); - } catch (e) { - verifyEqualTo(arrObj, "1", 3); - - verifyWritable(arrObj, "1"); - - verifyNotEnumerable(arrObj, "1"); - - verifyNotConfigurable(arrObj, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "1", { + value: 3, + writable: true, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-240.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-240.js index e74b2479d3..7c3712b1e3 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-240.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-240.js @@ -32,14 +32,14 @@ try { } catch (e) { verifyWritable(arrObj, "1", "setVerifyHelpProp"); - verifyNotEnumerable(arrObj, "1"); - - verifyNotConfigurable(arrObj, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "1", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-241.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-241.js index 8923abc966..6447fcad04 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-241.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-241.js @@ -24,20 +24,17 @@ try { set: function() {} }); throw new Test262Error("Expected an exception."); - } catch (e) { - verifyEqualTo(arrObj, "1", 3); - - verifyNotWritable(arrObj, "1"); - - verifyNotEnumerable(arrObj, "1"); - - verifyNotConfigurable(arrObj, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "1", { + value: 3, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-242-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-242-1.js index 7c21f48ca5..b943a2a765 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-242-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-242-1.js @@ -20,12 +20,11 @@ Object.defineProperty(arrObj, "0", { enumerable: false }); -verifyEqualTo(arrObj, "0", 1001); - -verifyNotWritable(arrObj, "0"); - -verifyNotEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: 1001, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-242.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-242.js index 5f1d4a8dce..29b55c9ba9 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-242.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-242.js @@ -24,8 +24,9 @@ Object.defineProperty(arrObj, "0", { verifyWritable(arrObj, "0", "setVerifyHelpProp"); -verifyEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-243-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-243-1.js index a87d6172ea..672f5cc677 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-243-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-243-1.js @@ -27,8 +27,9 @@ arrObj[1] = 4; verifyEqualTo(arrObj, "1", getFunc()); -verifyNotEnumerable(arrObj, "1"); - -verifyConfigurable(arrObj, "1"); +verifyProperty(arrObj, "1", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-243-2-strict.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-243-2-strict.js index ef5649662c..6ac6382e7d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-243-2-strict.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-243-2-strict.js @@ -29,8 +29,9 @@ assert.throws(TypeError, function() { }); verifyEqualTo(arrObj, "1", getFunc()); -verifyNotEnumerable(arrObj, "1"); - -verifyConfigurable(arrObj, "1"); +verifyProperty(arrObj, "1", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-243.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-243.js index 08a11f8705..c6be9ba3ec 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-243.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-243.js @@ -27,12 +27,11 @@ Object.defineProperty(arrObj, "1", { value: 12 }); -verifyEqualTo(arrObj, "1", 12); - -verifyNotWritable(arrObj, "1"); - -verifyNotEnumerable(arrObj, "1"); - -verifyConfigurable(arrObj, "1"); +verifyProperty(arrObj, "1", { + value: 12, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-244.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-244.js index e5e1d30c7b..112dc0cbfd 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-244.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-244.js @@ -22,25 +22,21 @@ Object.defineProperty(arrObj, "1", { }); try { - Object.defineProperty(arrObj, "1", { writable: true }); throw new Test262Error("Expected an exception."); - } catch (e) { - verifyEqualTo(arrObj, "1", undefined); - - verifyNotWritable(arrObj, "1"); - - verifyNotEnumerable(arrObj, "1"); - - verifyNotConfigurable(arrObj, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "1", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-245.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-245.js index eae22cfee2..91c5b07da6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-245.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-245.js @@ -29,18 +29,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "1", 3); - - verifyNotWritable(arrObj, "1"); - - verifyNotEnumerable(arrObj, "1"); - - verifyNotConfigurable(arrObj, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "1", { + value: 3, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-246.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-246.js index dddbc50767..863f1a7c71 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-246.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-246.js @@ -18,7 +18,6 @@ var arrObj = []; Object.defineProperty(arrObj, "1", { value: -0 - }); try { @@ -27,18 +26,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "1", -0); - - verifyNotWritable(arrObj, "1"); - - verifyNotEnumerable(arrObj, "1"); - - verifyNotConfigurable(arrObj, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "1", { + value: -0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-247.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-247.js index 1a3085a231..fb296bd6b0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-247.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-247.js @@ -27,18 +27,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "1", +0); - - verifyNotWritable(arrObj, "1"); - - verifyNotEnumerable(arrObj, "1"); - - verifyNotConfigurable(arrObj, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "1", { + value: +0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-248.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-248.js index b946c44ae1..8bcd5768f8 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-248.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-248.js @@ -26,18 +26,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "1", 12); - - verifyNotWritable(arrObj, "1"); - - verifyNotEnumerable(arrObj, "1"); - - verifyNotConfigurable(arrObj, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "1", { + value: 12, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-249.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-249.js index 9a7132c20f..7753d29ba7 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-249.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-249.js @@ -26,18 +26,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "1", "abc"); - - verifyNotWritable(arrObj, "1"); - - verifyNotEnumerable(arrObj, "1"); - - verifyNotConfigurable(arrObj, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "1", { + value: "abc", + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-250.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-250.js index e4710d7ef8..5475d629db 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-250.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-250.js @@ -26,18 +26,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "1", false); - - verifyNotWritable(arrObj, "1"); - - verifyNotEnumerable(arrObj, "1"); - - verifyNotConfigurable(arrObj, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "1", { + value: false, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-251.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-251.js index 594cb3a3ee..90796842bc 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-251.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-251.js @@ -29,18 +29,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "1", obj); - - verifyNotWritable(arrObj, "1"); - - verifyNotEnumerable(arrObj, "1"); - - verifyNotConfigurable(arrObj, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "1", { + value: obj, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-252.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-252.js index ab56258dc1..a3ac4bf1ef 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-252.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-252.js @@ -32,14 +32,14 @@ try { } catch (e) { verifyWritable(arrObj, "1", "setVerifyHelpProp"); - verifyNotEnumerable(arrObj, "1"); - - verifyNotConfigurable(arrObj, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "1", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-253.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-253.js index a6fbb2221c..90c76748ad 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-253.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-253.js @@ -32,14 +32,14 @@ try { } catch (e) { verifyEqualTo(arrObj, "1", getFunc()); - verifyNotEnumerable(arrObj, "1"); - - verifyNotConfigurable(arrObj, "1"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "1", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-254.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-254.js index 857f5bd3e1..3960688abb 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-254.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-254.js @@ -29,7 +29,9 @@ var desc = Object.getOwnPropertyDescriptor(arrObj, "1"); assert(desc.hasOwnProperty("get") && typeof desc.get === "undefined"); assert(desc.hasOwnProperty("set") && typeof desc.set === "undefined"); -verifyNotEnumerable(arrObj, "1"); -verifyNotConfigurable(arrObj, "1"); +verifyProperty(arrObj, "1", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-255.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-255.js index 03e3d8a268..d4ec618a12 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-255.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-255.js @@ -40,9 +40,11 @@ try { assert(arrObj[1] === getFunc()); assert(desc.hasOwnProperty("set") && typeof desc.set === "undefined"); - - verifyNotEnumerable(arrObj, "1"); - verifyNotConfigurable(arrObj, "1"); } +verifyProperty(arrObj, "1", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-256.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-256.js index a015f2a9a0..20fb18a60a 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-256.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-256.js @@ -38,8 +38,10 @@ try { assert(desc.hasOwnProperty("set") && typeof desc.set === "undefined"); verifyNotWritable(arrObj, "1"); - - verifyNotConfigurable(arrObj, "1"); } +verifyProperty(arrObj, "1", { + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-257.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-257.js index e6e8c2d369..96f9aae122 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-257.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-257.js @@ -31,8 +31,9 @@ Object.defineProperty(arrObj, "1", { verifyWritable(arrObj, "1", "setVerifyHelpProp"); -verifyNotEnumerable(arrObj, "1"); - -verifyNotConfigurable(arrObj, "1"); +verifyProperty(arrObj, "1", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-258.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-258.js index 9821d646bb..c1fe51cf10 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-258.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-258.js @@ -17,12 +17,12 @@ var arrObj = [100]; Object.defineProperty(arrObj, "0", { value: 200 }); -verifyEqualTo(arrObj, "0", 200); -verifyWritable(arrObj, "0"); - -verifyEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: 200, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-259.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-259.js index b0fbd5e780..e7fbdc8f17 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-259.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-259.js @@ -17,12 +17,12 @@ var arrObj = [100]; Object.defineProperty(arrObj, "0", { value: undefined }); -verifyEqualTo(arrObj, "0", undefined); -verifyWritable(arrObj, "0"); - -verifyEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: undefined, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-260.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-260.js index 5e2b69c160..3a195ba846 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-260.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-260.js @@ -16,12 +16,12 @@ var arrObj = [undefined]; Object.defineProperty(arrObj, "0", { value: 100 }); -verifyEqualTo(arrObj, "0", 100); -verifyWritable(arrObj, "0"); - -verifyEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: 100, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-261.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-261.js index e945f54eeb..7ecc70fc44 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-261.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-261.js @@ -16,12 +16,12 @@ var arrObj = [100]; Object.defineProperty(arrObj, "0", { writable: false }); -verifyEqualTo(arrObj, "0", 100); -verifyNotWritable(arrObj, "0"); - -verifyEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: 100, + writable: false, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-262.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-262.js index aed61cb5ae..b9a6475463 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-262.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-262.js @@ -17,12 +17,12 @@ var arrObj = [100]; Object.defineProperty(arrObj, "0", { enumerable: false }); -verifyEqualTo(arrObj, "0", 100); -verifyWritable(arrObj, "0"); - -verifyNotEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: 100, + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-263.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-263.js index b0b4ea2cc0..c0caa9fd90 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-263.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-263.js @@ -17,12 +17,12 @@ var arrObj = [100]; Object.defineProperty(arrObj, "0", { configurable: false }); -verifyEqualTo(arrObj, "0", 100); -verifyWritable(arrObj, "0"); - -verifyEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: 100, + writable: true, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-264.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-264.js index a7d2eac7f2..97db5f6f91 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-264.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-264.js @@ -18,12 +18,12 @@ Object.defineProperty(arrObj, "0", { enumerable: false, configurable: false }); -verifyEqualTo(arrObj, "0", 100); -verifyNotWritable(arrObj, "0"); - -verifyNotEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + value: 100, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-265.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-265.js index f68fdd93f4..ae3d86596c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-265.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-265.js @@ -28,8 +28,9 @@ Object.defineProperty(arrObj, "0", { }); verifyEqualTo(arrObj, "0", getFunc()); -verifyNotEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-266.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-266.js index 98d664d424..7fd1bfcf7f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-266.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-266.js @@ -26,8 +26,10 @@ Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", { get: undefined }); -verifyNotEnumerable(arrObj, "0"); -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-267.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-267.js index b1d1f3c19e..532c94c676 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-267.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-267.js @@ -27,8 +27,9 @@ Object.defineProperty(arrObj, "0", { }); verifyEqualTo(arrObj, "0", getFunc()); -verifyNotEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-268.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-268.js index 8f65ec43a1..3f60a9de36 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-268.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-268.js @@ -27,8 +27,9 @@ Object.defineProperty(arrObj, "0", { }); verifyWritable(arrObj, "0", "setVerifyHelpProp"); -verifyNotEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-269.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-269.js index 84be2830ff..9f0535aa58 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-269.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-269.js @@ -22,8 +22,10 @@ Object.defineProperty(arrObj, "0", { Object.defineProperty(arrObj, "0", { set: undefined }); -verifyNotEnumerable(arrObj, "0"); -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-270.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-270.js index 696ebb956a..5d22407b0b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-270.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-270.js @@ -28,8 +28,9 @@ Object.defineProperty(arrObj, "0", { }); verifyWritable(arrObj, "0", "setVerifyHelpProp"); -verifyNotEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-271.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-271.js index e82084fe9e..f79b212fcf 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-271.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-271.js @@ -29,8 +29,9 @@ Object.defineProperty(arrObj, "0", { }); verifyWritable(arrObj, "0", "setVerifyHelpProp"); -verifyNotEnumerable(arrObj, "0"); - -verifyConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-272.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-272.js index 663614560e..478981ccd2 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-272.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-272.js @@ -28,8 +28,9 @@ Object.defineProperty(arrObj, "0", { }); verifyWritable(arrObj, "0", "setVerifyHelpProp"); -verifyNotEnumerable(arrObj, "0"); - -verifyNotConfigurable(arrObj, "0"); +verifyProperty(arrObj, "0", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-273.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-273.js index 14d45dbbb5..0855f67372 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-273.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-273.js @@ -39,8 +39,9 @@ verifyEqualTo(arrObj, "1", getFunc()); verifyWritable(arrObj, "1", "setVerifyHelpProp"); -verifyNotEnumerable(arrObj, "1"); - -verifyNotConfigurable(arrObj, "1"); +verifyProperty(arrObj, "1", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-277.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-277.js index 825c594a6b..919c7ebc51 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-277.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-277.js @@ -21,12 +21,11 @@ Object.defineProperty(arrObj, "property", { configurable: true }); -verifyEqualTo(arrObj, "property", 12); - -verifyWritable(arrObj, "property"); - -verifyEnumerable(arrObj, "property"); - -verifyConfigurable(arrObj, "property"); +verifyProperty(arrObj, "property", { + value: 12, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-278.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-278.js index 4ad70e2558..bf537c408d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-278.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-278.js @@ -32,8 +32,9 @@ verifyEqualTo(arrObj, "property", getFunc()); verifyWritable(arrObj, "property", "setVerifyHelpProp"); -verifyEnumerable(arrObj, "property"); - -verifyConfigurable(arrObj, "property"); +verifyProperty(arrObj, "property", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-279.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-279.js index 9f78e7cc67..6536ef9bdc 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-279.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-279.js @@ -38,8 +38,9 @@ verifyEqualTo(arrObj, "property", getFunc()); verifyWritable(arrObj, "property", "setVerifyHelpProp"); -verifyNotEnumerable(arrObj, "property"); - -verifyNotConfigurable(arrObj, "property"); +verifyProperty(arrObj, "property", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-280.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-280.js index 7315c8c784..63f0d7d140 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-280.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-280.js @@ -21,12 +21,11 @@ Object.defineProperty(arrObj, "property", { configurable: false }); -verifyEqualTo(arrObj, "property", 12); - -verifyNotWritable(arrObj, "property"); - -verifyNotEnumerable(arrObj, "property"); - -verifyNotConfigurable(arrObj, "property"); +verifyProperty(arrObj, "property", { + value: 12, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-281.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-281.js index 67ec5776bc..36b8dc51e3 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-281.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-281.js @@ -23,18 +23,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "property", 12); - - verifyNotWritable(arrObj, "property"); - - verifyNotEnumerable(arrObj, "property"); - - verifyNotConfigurable(arrObj, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "property", { + value: 12, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-282.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-282.js index 0b05899bc6..01f4174e22 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-282.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-282.js @@ -23,18 +23,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "property", undefined); - - verifyNotWritable(arrObj, "property"); - - verifyNotEnumerable(arrObj, "property"); - - verifyNotConfigurable(arrObj, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "property", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-283.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-283.js index 7ca939b4f5..c106eef000 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-283.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-283.js @@ -23,18 +23,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "property", 12); - - verifyNotWritable(arrObj, "property"); - - verifyNotEnumerable(arrObj, "property"); - - verifyNotConfigurable(arrObj, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "property", { + value: 12, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-284.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-284.js index 48bd118b9c..ef9e68ce98 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-284.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-284.js @@ -23,18 +23,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arrObj, "property", 12); - - verifyNotWritable(arrObj, "property"); - - verifyNotEnumerable(arrObj, "property"); - - verifyNotConfigurable(arrObj, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "property", { + value: 12, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-285.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-285.js index 055d7d32d7..5604a04a61 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-285.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-285.js @@ -37,14 +37,14 @@ try { verifyWritable(arrObj, "property", "setVerifyHelpProp"); - verifyNotEnumerable(arrObj, "property"); - - verifyNotConfigurable(arrObj, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "property", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-286.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-286.js index ebf54b5e61..7c2317d15f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-286.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-286.js @@ -28,14 +28,14 @@ try { } catch (e) { verifyWritable(arrObj, "property", "setVerifyHelpProp"); - verifyNotEnumerable(arrObj, "property"); - - verifyNotConfigurable(arrObj, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "property", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-287.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-287.js index 3aa609e301..28ce64b648 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-287.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-287.js @@ -29,14 +29,14 @@ try { } catch (e) { verifyWritable(arrObj, "property", "setVerifyHelpProp"); - verifyNotEnumerable(arrObj, "property"); - - verifyNotConfigurable(arrObj, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "property", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-288.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-288.js index 99317bcbab..a022fc284d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-288.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-288.js @@ -29,14 +29,14 @@ try { } catch (e) { verifyWritable(arrObj, "property", "setVerifyHelpProp"); - verifyNotEnumerable(arrObj, "property"); - - verifyNotConfigurable(arrObj, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(arrObj, "property", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-289-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-289-1.js index 9c16dbb07a..83ecff8e49 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-289-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-289-1.js @@ -28,13 +28,12 @@ includes: [propertyHelper.js] throw new Test262Error("Expected a === 0, actually " + a); } - verifyEqualTo(arguments, "0", 10); - - verifyWritable(arguments, "0"); - - verifyEnumerable(arguments, "0"); - - verifyConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + value: 10, + writable: true, + enumerable: true, + configurable: true, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-289.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-289.js index 4b90e38ef6..c5f4bc699a 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-289.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-289.js @@ -19,13 +19,13 @@ includes: [propertyHelper.js] enumerable: true, configurable: true }); - verifyEqualTo(arguments, "0", 10); - verifyWritable(arguments, "0"); - - verifyEnumerable(arguments, "0"); - - verifyConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + value: 10, + writable: true, + enumerable: true, + configurable: true, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-290-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-290-1.js index 71fa4baeff..b31957da09 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-290-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-290-1.js @@ -37,9 +37,10 @@ includes: [propertyHelper.js] verifyWritable(arguments, "0", "setVerifyHelpProp"); - verifyEnumerable(arguments, "0"); - - verifyConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + enumerable: true, + configurable: true, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-290.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-290.js index 6b4d350268..204d9550c6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-290.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-290.js @@ -31,9 +31,10 @@ includes: [propertyHelper.js] verifyWritable(arguments, "0", "setVerifyHelpProp"); - verifyEnumerable(arguments, "0"); - - verifyConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + enumerable: true, + configurable: true, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-291-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-291-1.js index 04faea4a9e..98cac6c8b0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-291-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-291-1.js @@ -36,9 +36,10 @@ includes: [propertyHelper.js] verifyEqualTo(arguments, "0", getFunc2()); - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-291.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-291.js index 0d936a72a3..d7b113d7d4 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-291.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-291.js @@ -31,9 +31,10 @@ includes: [propertyHelper.js] }); verifyEqualTo(arguments, "0", getFunc2()); - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-292-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-292-1.js index 124143b87c..8eb28bae83 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-292-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-292-1.js @@ -25,13 +25,12 @@ flags: [noStrict] throw new Test262Error('Expected a === 20, actually ' + a); } - verifyEqualTo(arguments, "0", 20); - - verifyNotWritable(arguments, "0"); - - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + value: 20, + writable: false, + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-292-2-strict.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-292-2-strict.js index 5327e61f5d..da294bea67 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-292-2-strict.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-292-2-strict.js @@ -26,13 +26,12 @@ flags: [onlyStrict] throw new Test262Error('Expected a === 0, actually ' + a); } - verifyEqualTo(arguments, "0", 20); - - verifyNotWritable(arguments, "0"); - - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + value: 20, + writable: false, + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-292.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-292.js index 7091d42cf8..b96b3476f4 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-292.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-292.js @@ -18,13 +18,13 @@ includes: [propertyHelper.js] enumerable: false, configurable: false }); - verifyEqualTo(arguments, "0", 20); - verifyNotWritable(arguments, "0"); - - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + value: 20, + writable: false, + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293-1.js index 642e95f413..f4d493bade 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293-1.js @@ -20,13 +20,13 @@ includes: [propertyHelper.js] Object.defineProperty(arguments, "0", { value: 20 }); - verifyEqualTo(arguments, "0", 20); - verifyNotWritable(arguments, "0"); - - verifyEnumerable(arguments, "0"); - - verifyConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + value: 20, + writable: false, + enumerable: true, + configurable: true, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293-2.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293-2.js index 063ab121d1..9ed17e4bb3 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293-2.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293-2.js @@ -28,24 +28,21 @@ flags: [noStrict] throw new Test262Error("Expected an exception."); } catch (e) { - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - verifyEqualTo(arguments, "0", 10); - - verifyNotWritable(arguments, "0"); - - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (a !== 10) { throw new Test262Error('Expected "a === 10", actually ' + a); } - } + + verifyProperty(arguments, "0", { + value: 10, + writable: false, + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293-3.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293-3.js index a27f584a65..bb3170d229 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293-3.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293-3.js @@ -26,13 +26,12 @@ flags: [noStrict] throw new Test262Error('Expected "a === 10", actually ' + a); } - verifyEqualTo(arguments, "0", 20); - - verifyNotWritable(arguments, "0"); - - verifyEnumerable(arguments, "0"); - - verifyConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + value: 20, + writable: false, + enumerable: true, + configurable: true, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293-4-strict.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293-4-strict.js index 03ace78694..6e6c2d9eda 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293-4-strict.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293-4-strict.js @@ -27,13 +27,12 @@ flags: [onlyStrict] throw new Test262Error('Expected "a === 0", actually ' + a); } - verifyEqualTo(arguments, "0", 20); - - verifyNotWritable(arguments, "0"); - - verifyEnumerable(arguments, "0"); - - verifyConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + value: 20, + writable: false, + enumerable: true, + configurable: true, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293.js index 4ca208ba8e..002556ebbe 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-293.js @@ -25,19 +25,17 @@ includes: [propertyHelper.js] }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arguments, "0", 10); - - verifyNotWritable(arguments, "0"); - - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + value: 10, + writable: false, + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-294-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-294-1.js index e358ab75e8..38413c6b14 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-294-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-294-1.js @@ -32,20 +32,17 @@ flags: [noStrict] throw new Test262Error("Expected TypeError, got " + e); } - verifyEqualTo(arguments, "0", 10); - - verifyNotWritable(arguments, "0"); - - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (a !== 10) { throw new Test262Error('Expected "a === 10", actually ' + a); } - } + verifyProperty(arguments, "0", { + value: 10, + writable: false, + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-294.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-294.js index 08c69e755e..5138dc4c3f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-294.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-294.js @@ -24,19 +24,17 @@ includes: [propertyHelper.js] }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arguments, "0", 10); - - verifyNotWritable(arguments, "0"); - - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + value: 10, + writable: false, + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-295-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-295-1.js index 394066dfc2..3045dee339 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-295-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-295-1.js @@ -32,18 +32,17 @@ flags: [noStrict] throw new Test262Error("Expected TypeError, got " + e); } - verifyEqualTo(arguments, "0", 10); - - verifyNotWritable(arguments, "0"); - - verifyEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (a !== 10) { throw new Test262Error('Expected "a === 10", actually ' + a); } } + + verifyProperty(arguments, "0", { + value: 10, + writable: false, + enumerable: true, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-295.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-295.js index cd7eb340b7..34df8eb700 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-295.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-295.js @@ -24,19 +24,17 @@ includes: [propertyHelper.js] }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arguments, "0", 10); - - verifyNotWritable(arguments, "0"); - - verifyEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + value: 10, + writable: false, + enumerable: true, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-296-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-296-1.js index 77e9fe1642..90a53ae720 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-296-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-296-1.js @@ -31,18 +31,17 @@ flags: [noStrict] throw new Test262Error("Expected TypeError, got " + e); } - verifyEqualTo(arguments, "0", 10); - - verifyNotWritable(arguments, "0"); - - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (a !== 10) { throw new Test262Error('Expected "a === 10", actually ' + a); } } + + verifyProperty(arguments, "0", { + value: 10, + writable: false, + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-296.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-296.js index 8625821007..af40ff4d9c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-296.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-296.js @@ -24,19 +24,17 @@ includes: [propertyHelper.js] }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arguments, "0", 10); - - verifyNotWritable(arguments, "0"); - - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + value: 10, + writable: false, + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-297-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-297-1.js index 8627560fa9..ec2b3857da 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-297-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-297-1.js @@ -38,15 +38,15 @@ includes: [propertyHelper.js] verifyEqualTo(arguments, "0", getFunc1()); - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-297.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-297.js index e738fc84a3..fee2b5a6d6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-297.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-297.js @@ -32,15 +32,15 @@ includes: [propertyHelper.js] } catch (e) { verifyEqualTo(arguments, "0", getFunc1()); - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-298-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-298-1.js index 9cb976b0fd..3bf5f45f96 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-298-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-298-1.js @@ -39,15 +39,15 @@ includes: [propertyHelper.js] verifyEqualTo(arguments, "0", getFunc()); - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-298.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-298.js index 651330f8f5..e0f0627691 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-298.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-298.js @@ -33,15 +33,15 @@ includes: [propertyHelper.js] } catch (e) { verifyEqualTo(arguments, "0", getFunc()); - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-299-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-299-1.js index 2ef3e98416..f56db5b666 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-299-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-299-1.js @@ -33,15 +33,15 @@ includes: [propertyHelper.js] } verifyEqualTo(arguments, "0", getFunc()); - verifyEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + enumerable: true, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-299.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-299.js index 8294112d3a..533e491194 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-299.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-299.js @@ -28,15 +28,15 @@ includes: [propertyHelper.js] } catch (e) { verifyEqualTo(arguments, "0", getFunc()); - verifyEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + enumerable: true, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-300-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-300-1.js index 802dd24613..b3d77c7423 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-300-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-300-1.js @@ -33,15 +33,15 @@ includes: [propertyHelper.js] } verifyEqualTo(arguments, "0", getFunc()); - verifyEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + enumerable: true, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-300.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-300.js index 2341d87dca..6e14aa45a6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-300.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-300.js @@ -28,15 +28,15 @@ includes: [propertyHelper.js] } catch (e) { verifyEqualTo(arguments, "0", getFunc()); - verifyEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + enumerable: true, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-301-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-301-1.js index 50854b502f..ba3ff3691c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-301-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-301-1.js @@ -23,13 +23,13 @@ includes: [propertyHelper.js] if (a !== 0) { throw new Test262Error("Expected a === 0, actually " + a); } - verifyEqualTo(arguments, "0", 10); - verifyNotWritable(arguments, "0"); - - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + value: 10, + writable: false, + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-301.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-301.js index 6387b45b3c..0f32d2e7bc 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-301.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-301.js @@ -20,13 +20,13 @@ includes: [propertyHelper.js] enumerable: false, configurable: false }); - verifyEqualTo(arguments, "0", 10); - verifyNotWritable(arguments, "0"); - - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + value: 10, + writable: false, + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-302-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-302-1.js index d9e24450e1..2ccfa7b7b0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-302-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-302-1.js @@ -36,9 +36,10 @@ includes: [propertyHelper.js] verifyWritable(arguments, "0", "setVerifyHelpProp"); - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-302.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-302.js index 40fe4d4fcd..a3818170b8 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-302.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-302.js @@ -32,9 +32,10 @@ includes: [propertyHelper.js] verifyWritable(arguments, "0", "setVerifyHelpProp"); - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + enumerable: false, + configurable: false, + }); }(0, 1, 2)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-303.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-303.js index e1d15a9dcd..b627552c2b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-303.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-303.js @@ -32,9 +32,10 @@ includes: [propertyHelper.js] }); verifyEqualTo(arguments, "0", getFunc2()); - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + enumerable: false, + configurable: false, + }); }()); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-304.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-304.js index 058949b82b..a327b5b422 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-304.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-304.js @@ -19,13 +19,13 @@ includes: [propertyHelper.js] enumerable: false, configurable: false }); - verifyEqualTo(arguments, "0", 20); - verifyNotWritable(arguments, "0"); - - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); + verifyProperty(arguments, "0", { + value: 20, + writable: false, + enumerable: false, + configurable: false, + }); }()); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-305.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-305.js index 88e3ea9526..fedd5c087c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-305.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-305.js @@ -25,19 +25,17 @@ includes: [propertyHelper.js] }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arguments, "0", 0); - - verifyNotWritable(arguments, "0"); - - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + value: 0, + writable: false, + enumerable: false, + configurable: false, + }); }()); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-306.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-306.js index a33eff559b..54208f8013 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-306.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-306.js @@ -25,19 +25,17 @@ includes: [propertyHelper.js] }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arguments, "0", 0); - - verifyNotWritable(arguments, "0"); - - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + value: 0, + writable: false, + enumerable: false, + configurable: false, + }); }()); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-307.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-307.js index c9fdf870ff..df233b482d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-307.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-307.js @@ -25,19 +25,17 @@ includes: [propertyHelper.js] }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arguments, "0", 0); - - verifyNotWritable(arguments, "0"); - - verifyEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + value: 0, + writable: false, + enumerable: true, + configurable: false, + }); }()); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-308.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-308.js index aceabc53a0..e9cff62621 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-308.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-308.js @@ -25,19 +25,17 @@ includes: [propertyHelper.js] }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arguments, "0", 0); - - verifyNotWritable(arguments, "0"); - - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + value: 0, + writable: false, + enumerable: false, + configurable: false, + }); }()); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-309.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-309.js index f1803f13cd..36adce5824 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-309.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-309.js @@ -33,15 +33,15 @@ includes: [propertyHelper.js] } catch (e) { verifyEqualTo(arguments, "0", getFunc1()); - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + enumerable: false, + configurable: false, + }); }()); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-310.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-310.js index 094229861a..462d472756 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-310.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-310.js @@ -34,15 +34,15 @@ includes: [propertyHelper.js] } catch (e) { verifyEqualTo(arguments, "0", getFunc()); - verifyNotEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + enumerable: false, + configurable: false, + }); }()); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-311.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-311.js index ede81f7918..9a4c8172be 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-311.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-311.js @@ -29,15 +29,15 @@ includes: [propertyHelper.js] } catch (e) { verifyEqualTo(arguments, "0", getFunc()); - verifyEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + enumerable: true, + configurable: false, + }); }()); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-312.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-312.js index eaf2c27fab..b906d92976 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-312.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-312.js @@ -27,15 +27,15 @@ includes: [propertyHelper.js] } catch (e) { verifyEqualTo(arguments, "0", getFunc()); - verifyEnumerable(arguments, "0"); - - verifyNotConfigurable(arguments, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "0", { + enumerable: true, + configurable: false, + }); }()); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-313-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-313-1.js index 24f6b77d8b..f51e471fec 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-313-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-313-1.js @@ -18,13 +18,13 @@ includes: [propertyHelper.js] enumerable: true, configurable: true }); - verifyEqualTo(arguments, "genericProperty", 1001); - verifyWritable(arguments, "genericProperty"); - - verifyEnumerable(arguments, "genericProperty"); - - verifyConfigurable(arguments, "genericProperty"); + verifyProperty(arguments, "genericProperty", { + value: 1001, + writable: true, + enumerable: true, + configurable: true, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-313.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-313.js index 5f5650d942..815ad29d11 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-313.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-313.js @@ -18,13 +18,13 @@ includes: [propertyHelper.js] enumerable: true, configurable: true }); - verifyEqualTo(arguments, "genericProperty", 1001); - verifyWritable(arguments, "genericProperty"); - - verifyEnumerable(arguments, "genericProperty"); - - verifyConfigurable(arguments, "genericProperty"); + verifyProperty(arguments, "genericProperty", { + value: 1001, + writable: true, + enumerable: true, + configurable: true, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-314-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-314-1.js index aaa4d6a0fc..60c2f1066f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-314-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-314-1.js @@ -29,9 +29,10 @@ includes: [propertyHelper.js] verifyWritable(arguments, "genericProperty", "testgetFunction"); - verifyEnumerable(arguments, "genericProperty"); - - verifyConfigurable(arguments, "genericProperty"); + verifyProperty(arguments, "genericProperty", { + enumerable: true, + configurable: true, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-314.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-314.js index 707689d404..de44b05071 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-314.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-314.js @@ -29,9 +29,10 @@ includes: [propertyHelper.js] verifyWritable(arguments, "genericProperty", "testgetFunction"); - verifyEnumerable(arguments, "genericProperty"); - - verifyConfigurable(arguments, "genericProperty"); + verifyProperty(arguments, "genericProperty", { + enumerable: true, + configurable: true, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-315-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-315-1.js index 078b2b0c03..83290dddd1 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-315-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-315-1.js @@ -44,9 +44,10 @@ includes: [propertyHelper.js] verifyWritable(arguments, "genericProperty", "testgetFunction"); - verifyNotEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); + verifyProperty(arguments, "genericProperty", { + enumerable: false, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-315.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-315.js index f9e6b876a8..7d6c5b80c8 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-315.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-315.js @@ -40,9 +40,10 @@ includes: [propertyHelper.js] verifyWritable(arguments, "genericProperty", "testgetFunction"); - verifyNotEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); + verifyProperty(arguments, "genericProperty", { + enumerable: false, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-316-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-316-1.js index 4c18c0b45c..9d4203c2b7 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-316-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-316-1.js @@ -23,13 +23,13 @@ includes: [propertyHelper.js] enumerable: false, configurable: false }); - verifyEqualTo(arguments, "genericProperty", 1002); - verifyWritable(arguments, "genericProperty"); - - verifyNotEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); + verifyProperty(arguments, "genericProperty", { + value: 1002, + writable: true, + enumerable: false, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-316.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-316.js index 6683891473..7ed325b7ab 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-316.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-316.js @@ -23,13 +23,13 @@ includes: [propertyHelper.js] enumerable: false, configurable: false }); - verifyEqualTo(arguments, "genericProperty", 1002); - verifyWritable(arguments, "genericProperty"); - - verifyNotEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); + verifyProperty(arguments, "genericProperty", { + value: 1002, + writable: true, + enumerable: false, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-317-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-317-1.js index be820cbce1..5eec5035ee 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-317-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-317-1.js @@ -28,19 +28,17 @@ includes: [propertyHelper.js] throw new Test262Error('Expected "b === 2;", actually ' + b); } - verifyEqualTo(arguments, "genericProperty", 1001); - - verifyNotWritable(arguments, "genericProperty"); - - verifyNotEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "genericProperty", { + value: 1001, + writable: false, + enumerable: false, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-317.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-317.js index 77ca0ba862..0d7c8266b0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-317.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-317.js @@ -23,19 +23,17 @@ includes: [propertyHelper.js] }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arguments, "genericProperty", 1001); - - verifyNotWritable(arguments, "genericProperty"); - - verifyNotEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "genericProperty", { + value: 1001, + writable: false, + enumerable: false, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-318-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-318-1.js index c275772feb..acd8d37483 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-318-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-318-1.js @@ -23,19 +23,17 @@ includes: [propertyHelper.js] }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arguments, "genericProperty", undefined); - - verifyNotWritable(arguments, "genericProperty"); - - verifyNotEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "genericProperty", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-318.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-318.js index 95284091f6..ce31e7dc9f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-318.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-318.js @@ -22,21 +22,17 @@ includes: [propertyHelper.js] }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arguments, "genericProperty", undefined); - - verifyNotWritable(arguments, "genericProperty"); - - verifyNotEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); - - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + verifyProperty(arguments, "genericProperty", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-319-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-319-1.js index 6f184f8196..449fdf3fbd 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-319-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-319-1.js @@ -23,20 +23,17 @@ includes: [propertyHelper.js] }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arguments, "genericProperty", undefined); - - verifyNotWritable(arguments, "genericProperty"); - - verifyEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); - - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "genericProperty", { + value: undefined, + writable: false, + enumerable: true, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-319.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-319.js index d4c4c20dc9..a9059f043f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-319.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-319.js @@ -22,19 +22,17 @@ includes: [propertyHelper.js] }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arguments, "genericProperty", undefined); - - verifyNotWritable(arguments, "genericProperty"); - - verifyEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "genericProperty", { + value: undefined, + writable: false, + enumerable: true, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-320-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-320-1.js index 794b689a98..343a81b5eb 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-320-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-320-1.js @@ -22,19 +22,17 @@ includes: [propertyHelper.js] }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arguments, "genericProperty", undefined); - - verifyNotWritable(arguments, "genericProperty"); - - verifyNotEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "genericProperty", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-320.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-320.js index 2d16488d20..018b12ae85 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-320.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-320.js @@ -21,21 +21,17 @@ includes: [propertyHelper.js] }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(arguments, "genericProperty", undefined); - - verifyNotWritable(arguments, "genericProperty"); - - verifyNotEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); - - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + verifyProperty(arguments, "genericProperty", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-321-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-321-1.js index f0b19aff91..328f00ac56 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-321-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-321-1.js @@ -41,15 +41,15 @@ includes: [propertyHelper.js] verifyWritable(arguments, "genericProperty", "helpVerifyGet"); - verifyNotEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "genericProperty", { + enumerable: false, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-321.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-321.js index ce1ebc65ec..cc21c38b96 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-321.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-321.js @@ -36,15 +36,15 @@ includes: [propertyHelper.js] verifyWritable(arguments, "genericProperty", "helpVerifyGet"); - verifyNotEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "genericProperty", { + enumerable: false, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-322-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-322-1.js index 4261b4980b..e50a02d336 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-322-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-322-1.js @@ -30,15 +30,15 @@ includes: [propertyHelper.js] } catch (e) { verifyWritable(arguments, "genericProperty", "genericPropertyString"); - verifyNotEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "genericProperty", { + enumerable: false, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-322.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-322.js index 9414c90d54..3d52c42a3d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-322.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-322.js @@ -29,15 +29,15 @@ includes: [propertyHelper.js] } catch (e) { verifyWritable(arguments, "genericProperty", "genericPropertyString"); - verifyNotEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "genericProperty", { + enumerable: false, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-323-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-323-1.js index 769c0a8634..252fad78ae 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-323-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-323-1.js @@ -32,16 +32,15 @@ includes: [propertyHelper.js] } verifyWritable(arguments, "genericProperty", "genericPropertyString"); - verifyEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + verifyProperty(arguments, "genericProperty", { + enumerable: true, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-323.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-323.js index a6e17705ef..ee0cbf67ac 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-323.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-323.js @@ -28,15 +28,15 @@ includes: [propertyHelper.js] } catch (e) { verifyWritable(arguments, "genericProperty", "genericPropertyString"); - verifyEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "genericProperty", { + enumerable: true, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-324-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-324-1.js index 949102ee2f..0bffa63c65 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-324-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-324-1.js @@ -28,15 +28,15 @@ includes: [propertyHelper.js] } catch (e) { verifyWritable(arguments, "genericProperty", "genericPropertyString"); - verifyNotEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } + + verifyProperty(arguments, "genericProperty", { + enumerable: false, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-324.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-324.js index bd7e47b2d2..c7f0a023f6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-324.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-324.js @@ -27,16 +27,15 @@ includes: [propertyHelper.js] } catch (e) { verifyWritable(arguments, "genericProperty", "genericPropertyString"); - verifyNotEnumerable(arguments, "genericProperty"); - - verifyNotConfigurable(arguments, "genericProperty"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } - false; + + verifyProperty(arguments, "genericProperty", { + enumerable: false, + configurable: false, + }); }(1, 2, 3)); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-1.js index b38f669f07..b1eb009f19 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-1.js @@ -24,12 +24,11 @@ Object.defineProperty(obj, "property", { value: 1002 }); -verifyEqualTo(obj, "property", 1002); - -verifyWritable(obj, "property"); - -verifyNotEnumerable(obj, "property"); - -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + value: 1002, + writable: true, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-2.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-2.js index 2c7ac9fd07..e2df9640ff 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-2.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-2.js @@ -24,12 +24,11 @@ Object.defineProperty(obj, "0", { value: 1002 }); -verifyEqualTo(obj, "0", 1002); - -verifyWritable(obj, "0"); - -verifyNotEnumerable(obj, "0"); - -verifyNotConfigurable(obj, "0"); +verifyProperty(obj, "0", { + value: 1002, + writable: true, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-3.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-3.js index 214436cb50..cd9db364ea 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-3.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-3.js @@ -26,12 +26,11 @@ Object.defineProperty(obj, "property", { value: 1002 }); -verifyEqualTo(obj, "property", 1002); - -verifyWritable(obj, "property"); - -verifyNotEnumerable(obj, "property"); - -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + value: 1002, + writable: true, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-6.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-6.js index 21265866ff..77186e1b85 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-6.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-6.js @@ -24,12 +24,11 @@ Object.defineProperty(obj, "0", { value: 1002 }); -verifyEqualTo(obj, "0", 1002); - -verifyWritable(obj, "0"); - -verifyNotEnumerable(obj, "0"); - -verifyNotConfigurable(obj, "0"); +verifyProperty(obj, "0", { + value: 1002, + writable: true, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-7.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-7.js index dea755a355..8881de5da7 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-7.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-7.js @@ -24,12 +24,11 @@ Object.defineProperty(obj, "prop", { value: 1002 }); -verifyEqualTo(obj, "prop", 1002); - -verifyWritable(obj, "prop"); - -verifyNotEnumerable(obj, "prop"); - -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + value: 1002, + writable: true, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-8.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-8.js index 785d0adc99..1e440f485b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-8.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-333-8.js @@ -26,12 +26,11 @@ Object.defineProperty(obj, "0", { value: 1002 }); -verifyEqualTo(obj, "0", 1002); - -verifyWritable(obj, "0"); - -verifyNotEnumerable(obj, "0"); - -verifyNotConfigurable(obj, "0"); +verifyProperty(obj, "0", { + value: 1002, + writable: true, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-335.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-335.js index 177a249f90..8afe8c12f0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-335.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-335.js @@ -18,8 +18,9 @@ Object.defineProperty(obj, "prop", { configurable: false }); -assert(obj.hasOwnProperty("prop")); -verifyNotConfigurable(obj, "prop"); -assert.sameValue(obj.prop, 2010); +verifyProperty(obj, "prop", { + value: 2010, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-349.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-349.js index 143606c7a9..af098aa486 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-349.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-349.js @@ -18,8 +18,9 @@ Object.defineProperty(obj, "prop", { configurable: false }); -assert(obj.hasOwnProperty("prop")); -verifyNotConfigurable(obj, "prop"); -assert.sameValue(obj.prop, 2010); +verifyProperty(obj, "prop", { + value: 2010, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-1.js index 3e580abc51..f17f51615c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-1.js @@ -24,12 +24,11 @@ Object.defineProperty(obj, "property", { value: 1002 }); -verifyEqualTo(obj, "property", 1002); - -verifyNotWritable(obj, "property"); - -verifyNotEnumerable(obj, "property"); - -verifyConfigurable(obj, "property"); +verifyProperty(obj, "property", { + value: 1002, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-10.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-10.js index 4fa47d892d..78e8a4e234 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-10.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-10.js @@ -24,12 +24,11 @@ Object.defineProperty(obj, "0", { value: 1002 }); -verifyEqualTo(obj, "0", 1002); - -verifyNotWritable(obj, "0"); - -verifyNotEnumerable(obj, "0"); - -verifyConfigurable(obj, "0"); +verifyProperty(obj, "0", { + value: 1002, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-11.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-11.js index 0f23373bff..3cde36b73f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-11.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-11.js @@ -24,12 +24,11 @@ Object.defineProperty(obj, "prop", { value: 1002 }); -verifyEqualTo(obj, "prop", 1002); - -verifyNotWritable(obj, "prop"); - -verifyNotEnumerable(obj, "prop"); - -verifyConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + value: 1002, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-12.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-12.js index c301667d62..762a767ecc 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-12.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-12.js @@ -26,12 +26,11 @@ Object.defineProperty(obj, "0", { value: 1002 }); -verifyEqualTo(obj, "0", 1002); - -verifyNotWritable(obj, "0"); - -verifyNotEnumerable(obj, "0"); - -verifyConfigurable(obj, "0"); +verifyProperty(obj, "0", { + value: 1002, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-15.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-15.js index 42cf188ef5..df68d33fc5 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-15.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-15.js @@ -19,7 +19,9 @@ Object.defineProperty(obj, "prop", { configurable: true }); -assert.sameValue(obj.prop, 2010); -verifyNotWritable(obj, "prop"); +verifyProperty(obj, "prop", { + value: 2010, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-16.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-16.js index b5947a8818..94466d9dcf 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-16.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-16.js @@ -22,7 +22,9 @@ Object.defineProperty(obj, "0", { configurable: true }); -assert.sameValue(obj[0], 2010); -verifyNotWritable(obj, "0"); +verifyProperty(obj, "0", { + value: 2010, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-2.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-2.js index 60ef5a8187..25c8fd2b22 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-2.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-2.js @@ -24,12 +24,11 @@ Object.defineProperty(obj, "0", { value: 1002 }); -verifyEqualTo(obj, "0", 1002); - -verifyNotWritable(obj, "0"); - -verifyNotEnumerable(obj, "0"); - -verifyConfigurable(obj, "0"); +verifyProperty(obj, "0", { + value: 1002, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-3.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-3.js index fecfdd55a4..7567ddf16d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-3.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-3.js @@ -25,12 +25,11 @@ Object.defineProperty(obj, "property", { value: 1002 }); -verifyEqualTo(obj, "property", 1002); - -verifyNotWritable(obj, "property"); - -verifyNotEnumerable(obj, "property"); - -verifyConfigurable(obj, "property"); +verifyProperty(obj, "property", { + value: 1002, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-6.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-6.js index 140bc5b7f7..58669c9a14 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-6.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-6.js @@ -19,7 +19,9 @@ Object.defineProperty(obj, "0", { configurable: true }); -assert.sameValue(obj[0], 2010); -verifyNotWritable(obj, "0"); +verifyProperty(obj, "0", { + value: 2010, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-7.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-7.js index 31fffa2ee2..c7f38278ed 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-7.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354-7.js @@ -21,7 +21,9 @@ Object.defineProperty(obj, "prop", { configurable: true }); -assert.sameValue(obj.prop, 2010); -verifyNotWritable(obj, "prop"); +verifyProperty(obj, "prop", { + value: 2010, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354.js index dbf15887fb..d43159c7c6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-354.js @@ -18,7 +18,9 @@ Object.defineProperty(obj, "prop", { configurable: true }); -assert.sameValue(obj.prop, 2010); -verifyNotWritable(obj, "prop"); +verifyProperty(obj, "prop", { + value: 2010, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-361.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-361.js index ddaf657cd8..5369b5da0b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-361.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-361.js @@ -18,7 +18,9 @@ Object.defineProperty(obj, "prop", { configurable: false }); -assert.sameValue(obj.prop, 2010); -verifyNotWritable(obj, "prop"); +verifyProperty(obj, "prop", { + value: 2010, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-363.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-363.js index 5eb3404f36..cd9b1d6519 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-363.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-363.js @@ -18,7 +18,8 @@ Object.defineProperty(obj, "prop", { configurable: false }); -assert(obj.hasOwnProperty("prop")); -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-368.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-368.js index 1faaa98d37..1a9cb6b12b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-368.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-368.js @@ -18,7 +18,9 @@ Object.defineProperty(obj, "prop", { configurable: true }); -assert.sameValue(obj.prop, 2010); -verifyNotWritable(obj, "prop"); +verifyProperty(obj, "prop", { + value: 2010, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-375.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-375.js index b41c9513e2..9c9cbd5511 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-375.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-375.js @@ -18,7 +18,9 @@ Object.defineProperty(obj, "prop", { configurable: false }); -assert.sameValue(obj.prop, 2010); -verifyNotWritable(obj, "prop"); +verifyProperty(obj, "prop", { + value: 2010, + writable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-377.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-377.js index efd2e54659..c9102fcc6f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-377.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-377.js @@ -18,7 +18,8 @@ Object.defineProperty(obj, "prop", { configurable: false }); -assert(obj.hasOwnProperty("prop")); -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-38.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-38.js index f40b4f152a..b3ac2b6d88 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-38.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-38.js @@ -16,13 +16,12 @@ try { configurable: true }); - verifyEqualTo(Math, "foo", 12); - - verifyNotWritable(Math, "foo"); - - verifyNotEnumerable(Math, "foo"); - - verifyConfigurable(Math, "foo"); + verifyProperty(Math, "foo", { + value: 12, + writable: false, + enumerable: false, + configurable: true, + }); } finally { delete Math.foo; } diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-41.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-41.js index e69119a145..df5be6a6c9 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-41.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-41.js @@ -16,13 +16,12 @@ Object.defineProperty(JSON, "foo", { configurable: true }); -verifyEqualTo(JSON, "foo", 12); - -verifyNotWritable(JSON, "foo"); - -verifyNotEnumerable(JSON, "foo"); - -verifyConfigurable(JSON, "foo"); +verifyProperty(JSON, "foo", { + value: 12, + writable: false, + enumerable: false, + configurable: true, +}); delete JSON.foo; diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-429.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-429.js index 1484ccd385..074908184e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-429.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-429.js @@ -24,11 +24,11 @@ var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); Object.defineProperty(obj, "prop", { configurable: false }); -var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); -verifyNotConfigurable(obj, "prop"); assert.sameValue(desc1.configurable, true); -assert.sameValue(desc2.configurable, false); -assert(obj.hasOwnProperty("prop")); + +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-434.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-434.js index 0c278f09b7..7d3bd1adc5 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-434.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-434.js @@ -19,12 +19,8 @@ Object.defineProperty(obj, "prop", { configurable: false }); -assert(obj.hasOwnProperty("prop")); - -var desc = Object.getOwnPropertyDescriptor(obj, "prop"); - -assert.sameValue(desc.configurable, false); - -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-438.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-438.js index ccf6b3d0aa..25bb6064b0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-438.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-438.js @@ -30,14 +30,11 @@ try { } catch (e) { assert(e instanceof TypeError); - var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); - assert.sameValue(desc1.configurable, false); - assert.sameValue(desc2.configurable, false); - - verifyNotConfigurable(obj, "prop"); - - assert(obj.hasOwnProperty("prop")); } +verifyProperty(obj, "prop", { + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-447.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-447.js index e7580caeb2..e983a44b71 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-447.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-447.js @@ -25,12 +25,10 @@ Object.defineProperty(obj, "prop", { configurable: false }); -var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); - assert.sameValue(desc1.configurable, true); -assert.sameValue(desc2.configurable, false); -verifyNotConfigurable(obj, "prop"); -assert(obj.hasOwnProperty("prop")); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-45.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-45.js index 65701f6c78..63126072c2 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-45.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-45.js @@ -15,12 +15,11 @@ Object.defineProperty(this, "foo", { configurable: true }); -verifyEqualTo(this, "foo", 12); - -verifyNotWritable(this, "foo"); - -verifyNotEnumerable(this, "foo"); - -verifyConfigurable(this, "foo"); +verifyProperty(this, "foo", { + value: 12, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-452.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-452.js index d099d78495..19a74b78ac 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-452.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-452.js @@ -19,12 +19,8 @@ Object.defineProperty(obj, "prop", { configurable: false }); -assert(obj.hasOwnProperty("prop")); - -var desc = Object.getOwnPropertyDescriptor(obj, "prop"); - -assert.sameValue(desc.configurable, false); - -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-456.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-456.js index da9397f14d..3f008f372c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-456.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-456.js @@ -30,14 +30,11 @@ try { } catch (e) { assert(e instanceof TypeError); - var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); - assert.sameValue(desc1.configurable, false); - assert.sameValue(desc2.configurable, false); - - verifyNotConfigurable(obj, "prop"); - - assert(obj.hasOwnProperty("prop")); } +verifyProperty(obj, "prop", { + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-465.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-465.js index 6ff40b2cc5..f4071187d6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-465.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-465.js @@ -30,12 +30,10 @@ Object.defineProperty(obj, "prop", { configurable: false }); -var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); - assert.sameValue(desc1.configurable, true); -assert.sameValue(desc2.configurable, false); -verifyNotConfigurable(obj, "prop"); -assert(obj.hasOwnProperty("prop")); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-47.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-47.js index 4b8fd1bf7f..6734e898d6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-47.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-47.js @@ -18,12 +18,11 @@ Object.defineProperty(obj, "property", { configurable: false }); -verifyEqualTo(obj, "property", undefined); - -verifyWritable(obj, "property"); - -verifyEnumerable(obj, "property"); - -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + value: undefined, + writable: true, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-470.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-470.js index 39b025006b..9a8cdc0e77 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-470.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-470.js @@ -26,13 +26,10 @@ Object.defineProperty(obj, "prop", { assert(obj.hasOwnProperty("prop")); -var desc = Object.getOwnPropertyDescriptor(obj, "prop"); - verifyNotWritable(obj, "prop"); -verifyNotConfigurable(obj, "prop"); - -assert.sameValue(desc.configurable, false); -assert(obj.hasOwnProperty("prop")); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-474.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-474.js index ce3fa250dd..6c9bdd63e7 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-474.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-474.js @@ -35,14 +35,11 @@ try { } catch (e) { assert(e instanceof TypeError); - var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); - assert.sameValue(desc1.configurable, false); - assert.sameValue(desc2.configurable, false); - - verifyNotConfigurable(obj, "prop"); - - assert(obj.hasOwnProperty("prop")); } +verifyProperty(obj, "prop", { + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-48.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-48.js index 1dcf25ea46..68228104fc 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-48.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-48.js @@ -18,12 +18,11 @@ Object.defineProperty(obj, "property", { configurable: false }); -verifyEqualTo(obj, "property", 1001); - -verifyNotWritable(obj, "property"); - -verifyEnumerable(obj, "property"); - -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + value: 1001, + writable: false, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-483.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-483.js index 118a8aac10..44225c7497 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-483.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-483.js @@ -30,13 +30,10 @@ Object.defineProperty(obj, "prop", { configurable: false }); -var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); - assert.sameValue(desc1.configurable, true); -assert.sameValue(desc2.configurable, false); - -verifyNotConfigurable(obj, "prop"); -assert(obj.hasOwnProperty("prop")); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-488.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-488.js index 0785a3996e..c6155cd8de 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-488.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-488.js @@ -24,13 +24,8 @@ Object.defineProperty(obj, "prop", { configurable: false }); -assert(obj.hasOwnProperty("prop")); - -var desc = Object.getOwnPropertyDescriptor(obj, "prop"); - -verifyNotConfigurable(obj, "prop"); -assert.sameValue(desc.configurable, false); - -assert(obj.hasOwnProperty("prop")); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-49.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-49.js index 9e45eed271..5861ea3315 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-49.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-49.js @@ -17,12 +17,12 @@ Object.defineProperty(obj, "property", { writable: true, configurable: true }); -verifyEqualTo(obj, "property", 1001); -verifyWritable(obj, "property"); - -verifyNotEnumerable(obj, "property"); - -verifyConfigurable(obj, "property"); +verifyProperty(obj, "property", { + value: 1001, + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-492.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-492.js index cc418c9e12..08df806be9 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-492.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-492.js @@ -35,14 +35,11 @@ try { } catch (e) { assert(e instanceof TypeError); - var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); - - verifyNotConfigurable(obj, "prop"); - assert.sameValue(desc1.configurable, false); - assert.sameValue(desc2.configurable, false); - - assert(obj.hasOwnProperty("prop")); } +verifyProperty(obj, "prop", { + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-50.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-50.js index f49f61a6c3..3a3a1ae707 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-50.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-50.js @@ -17,12 +17,12 @@ Object.defineProperty(obj, "property", { writable: true, enumerable: true }); -verifyEqualTo(obj, "property", 1001); -verifyWritable(obj, "property"); - -verifyEnumerable(obj, "property"); - -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + value: 1001, + writable: true, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-501.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-501.js index 7de38b5055..436f8d63e3 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-501.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-501.js @@ -29,14 +29,12 @@ Object.defineProperty(obj, "prop", { configurable: false }); -var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); - assert.sameValue(desc1.configurable, true); -assert.sameValue(desc2.configurable, false); verifyNotWritable(obj, "prop"); -verifyNotConfigurable(obj, "prop"); -assert(obj.hasOwnProperty("prop")); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-506.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-506.js index 8ad6ca3b7c..a65dd9b778 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-506.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-506.js @@ -23,14 +23,8 @@ Object.defineProperty(obj, "prop", { configurable: false }); -assert(obj.hasOwnProperty("prop")); - -var desc = Object.getOwnPropertyDescriptor(obj, "prop"); - -assert.sameValue(desc.configurable, false); - -verifyNotConfigurable(obj, "prop"); - -assert(obj.hasOwnProperty("prop")); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-51.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-51.js index 989d71d164..7c987bdbb3 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-51.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-51.js @@ -20,12 +20,11 @@ Object.defineProperty(obj, "property", { configurable: false }); -verifyEqualTo(obj, "property", 1001); - -verifyNotWritable(obj, "property"); - -verifyNotEnumerable(obj, "property"); - -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + value: 1001, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-510.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-510.js index 325f76e16c..418d8113e1 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-510.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-510.js @@ -34,14 +34,11 @@ try { } catch (e) { assert(e instanceof TypeError); - var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); - assert.sameValue(desc1.configurable, false); - assert.sameValue(desc2.configurable, false); - - verifyNotConfigurable(obj, "prop"); - - assert(obj.hasOwnProperty("prop")); } +verifyProperty(obj, "prop", { + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-519.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-519.js index 60baf731ee..b5305b02e3 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-519.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-519.js @@ -29,13 +29,10 @@ Object.defineProperty(obj, "prop", { configurable: false }); -var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); - assert.sameValue(desc1.configurable, true); -assert.sameValue(desc2.configurable, false); - -verifyNotConfigurable(obj, "prop"); -assert(obj.hasOwnProperty("prop")); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-52.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-52.js index 0d2ca8420a..4c2713c081 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-52.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-52.js @@ -14,12 +14,11 @@ var obj = {}; Object.defineProperty(obj, "property", {}); -verifyEqualTo(obj, "property", undefined); - -verifyNotWritable(obj, "property"); - -verifyNotEnumerable(obj, "property"); - -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-524.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-524.js index aa6fe43c25..7f2161477f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-524.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-524.js @@ -23,13 +23,8 @@ Object.defineProperty(obj, "prop", { configurable: false }); -assert(obj.hasOwnProperty("prop")); -var desc = Object.getOwnPropertyDescriptor(obj, "prop"); - -assert.sameValue(desc.configurable, false); - -verifyNotConfigurable(obj, "prop"); - -assert(obj.hasOwnProperty("prop")); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-528.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-528.js index b666822536..5dab355151 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-528.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-528.js @@ -34,14 +34,11 @@ try { } catch (e) { assert(e instanceof TypeError); - var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); - assert.sameValue(desc1.configurable, false); - assert.sameValue(desc2.configurable, false); - - verifyNotConfigurable(obj, "prop"); - - assert(obj.hasOwnProperty("prop")); } +verifyProperty(obj, "prop", { + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-53.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-53.js index b8dd34d5ab..2da947a546 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-53.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-53.js @@ -23,8 +23,9 @@ Object.defineProperty(obj, "property", { verifyWritable(obj, "property", "setVerifyHelpProp"); -verifyEnumerable(obj, "property"); - -verifyConfigurable(obj, "property"); +verifyProperty(obj, "property", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-1.js index 167099fb52..8326068541 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-1.js @@ -40,8 +40,9 @@ verifyEqualTo(obj, "property", getFunc()); verifyWritable(obj, "property", "verifySetFunction1"); -verifyNotEnumerable(obj, "property"); - -verifyConfigurable(obj, "property"); +verifyProperty(obj, "property", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-10.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-10.js index 50dbf751f4..a419791c35 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-10.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-10.js @@ -42,8 +42,9 @@ verifyEqualTo(obj, "0", getFunc()); verifyWritable(obj, "0", "verifySetFunction1"); -verifyNotEnumerable(obj, "0"); - -verifyConfigurable(obj, "0"); +verifyProperty(obj, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-11.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-11.js index d23dfcde09..304b9db3bb 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-11.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-11.js @@ -41,8 +41,9 @@ verifyEqualTo(obj, "prop", getFunc()); verifyWritable(obj, "prop", "verifySetFunction1"); -verifyNotEnumerable(obj, "prop"); - -verifyConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-12.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-12.js index 05a7954bab..7cac1e393e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-12.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-12.js @@ -43,8 +43,9 @@ verifyEqualTo(obj, "0", getFunc()); verifyWritable(obj, "0", "verifySetFunction1"); -verifyNotEnumerable(obj, "0"); - -verifyConfigurable(obj, "0"); +verifyProperty(obj, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-2.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-2.js index 6c459d0db2..2151ea314c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-2.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-2.js @@ -42,8 +42,9 @@ verifyEqualTo(obj, "0", getFunc()); verifyWritable(obj, "0", "verifySetFunction1"); -verifyNotEnumerable(obj, "0"); - -verifyConfigurable(obj, "0"); +verifyProperty(obj, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-3.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-3.js index 0dc6f76257..9720210f17 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-3.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-531-3.js @@ -43,8 +43,9 @@ verifyEqualTo(obj, "property", getFunc()); verifyWritable(obj, "property", "verifySetFunction1"); -verifyNotEnumerable(obj, "property"); - -verifyConfigurable(obj, "property"); +verifyProperty(obj, "property", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-537.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-537.js index e05ce8fecf..a361819a17 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-537.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-537.js @@ -34,11 +34,11 @@ var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); Object.defineProperty(obj, "prop", { configurable: false }); -var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); -verifyNotConfigurable(obj, "prop"); assert.sameValue(desc1.configurable, true); -assert.sameValue(desc2.configurable, false); -assert(obj.hasOwnProperty("prop")); + +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538-1.js index 06dd0aa4b9..340bbd5aa2 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538-1.js @@ -54,8 +54,9 @@ verifyEqualTo(obj, "0", 1001); verifyNotWritable(obj, "0"); -verifyEnumerable(obj, "0"); - -verifyConfigurable(obj, "0"); +verifyProperty(obj, "0", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538-2.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538-2.js index c1a03d0ff9..89fcca4632 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538-2.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538-2.js @@ -56,8 +56,9 @@ verifyEqualTo(obj, "prop", 1001); verifyNotWritable(obj, "prop"); -verifyEnumerable(obj, "prop"); - -verifyConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538-5.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538-5.js index effdbc3676..146f5c421b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538-5.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538-5.js @@ -55,8 +55,9 @@ verifyEqualTo(obj, "prop", 1001); verifyNotWritable(obj, "prop"); -verifyEnumerable(obj, "prop"); - -verifyConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538-6.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538-6.js index 4bfe9d32ee..aa286ce903 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538-6.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538-6.js @@ -56,8 +56,9 @@ verifyEqualTo(obj, "0", 1001); verifyNotWritable(obj, "0"); -verifyEnumerable(obj, "0"); - -verifyConfigurable(obj, "0"); +verifyProperty(obj, "0", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538.js index 8943f5cff9..89f7fbe3e5 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-538.js @@ -51,8 +51,9 @@ verifyEqualTo(obj, "prop", 1001); verifyNotWritable(obj, "prop"); -verifyEnumerable(obj, "prop"); - -verifyConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-54.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-54.js index 34de6eff1d..e36e1e18ac 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-54.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-54.js @@ -26,7 +26,9 @@ assert.sameValue(obj.property, "property"); var desc = Object.getOwnPropertyDescriptor(obj, "property"); assert.sameValue(typeof desc.set, "undefined"); -verifyNotEnumerable(obj, "property"); -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-1.js index ac2f8d5fb0..b7ccfef31f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-1.js @@ -38,12 +38,13 @@ try { verifyEqualTo(obj, "property", getFunc()); verifyWritable(obj, "property", "verifySetFunction"); - - verifyNotEnumerable(obj, "property"); - - verifyNotConfigurable(obj, "property"); } +verifyProperty(obj, "property", { + enumerable: false, + configurable: false, +}); + try { Object.defineProperty(obj, "property", { set: function(value) { @@ -59,14 +60,14 @@ try { verifyWritable(obj, "property", "verifySetFunction"); - verifyNotEnumerable(obj, "property"); - - verifyNotConfigurable(obj, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "property", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-2.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-2.js index df61180433..4e2ac6db59 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-2.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-2.js @@ -38,12 +38,13 @@ try { verifyEqualTo(obj, "0", getFunc()); verifyWritable(obj, "0", "verifySetFunction"); - - verifyNotEnumerable(obj, "0"); - - verifyNotConfigurable(obj, "0"); } +verifyProperty(obj, "0", { + enumerable: false, + configurable: false, +}); + try { Object.defineProperty(obj, "0", { set: function(value) { @@ -59,14 +60,14 @@ try { verifyWritable(obj, "0", "verifySetFunction"); - verifyNotEnumerable(obj, "0"); - - verifyNotConfigurable(obj, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "0", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-3.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-3.js index f7018700c9..1aeb2c071d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-3.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-3.js @@ -39,12 +39,13 @@ try { verifyEqualTo(obj, "property", getFunc()); verifyWritable(obj, "property", "verifySetFunction"); - - verifyNotEnumerable(obj, "property"); - - verifyNotConfigurable(obj, "property"); } +verifyProperty(obj, "property", { + enumerable: false, + configurable: false, +}); + try { Object.defineProperty(obj, "property", { set: function(value) { @@ -61,14 +62,14 @@ try { verifyWritable(obj, "property", "verifySetFunction"); - verifyNotEnumerable(obj, "property"); - - verifyNotConfigurable(obj, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "property", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-6.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-6.js index 64cc3ff55f..8431a64191 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-6.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-6.js @@ -39,12 +39,13 @@ try { verifyEqualTo(obj, "0", getFunc()); verifyWritable(obj, "0", "verifySetFunction"); - - verifyNotEnumerable(obj, "0"); - - verifyNotConfigurable(obj, "0"); } +verifyProperty(obj, "0", { + enumerable: false, + configurable: false, +}); + try { Object.defineProperty(obj, "0", { set: function(value) { @@ -60,15 +61,14 @@ try { verifyWritable(obj, "0", "verifySetFunction"); - verifyNotEnumerable(obj, "0"); - - verifyNotConfigurable(obj, "0"); - - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "0", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-7.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-7.js index bc90c7b983..1bc3fcfa22 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-7.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-7.js @@ -38,12 +38,13 @@ try { verifyEqualTo(obj, "prop", getFunc()); verifyWritable(obj, "prop", "verifySetFunction"); - - verifyNotEnumerable(obj, "prop"); - - verifyNotConfigurable(obj, "prop"); } +verifyProperty(obj, "prop", { + enumerable: false, + configurable: false, +}); + try { Object.defineProperty(obj, "prop", { set: function(value) { @@ -60,15 +61,14 @@ try { verifyWritable(obj, "prop", "verifySetFunction"); - verifyNotEnumerable(obj, "prop"); - - verifyNotConfigurable(obj, "prop"); - - if (!(e1 instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e1); } - } +verifyProperty(obj, "prop", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-8.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-8.js index 26be4c5177..cca11f6b53 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-8.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-540-8.js @@ -40,12 +40,13 @@ try { verifyEqualTo(obj, "0", getFunc()); verifyWritable(obj, "0", "verifySetFunction"); - - verifyNotEnumerable(obj, "0"); - - verifyNotConfigurable(obj, "0"); } +verifyProperty(obj, "0", { + enumerable: false, + configurable: false, +}); + try { Object.defineProperty(obj, "0", { set: function(value) { @@ -61,14 +62,14 @@ try { verifyWritable(obj, "0", "verifySetFunction"); - verifyNotEnumerable(obj, "0"); - - verifyNotConfigurable(obj, "0"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "0", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-542.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-542.js index 0768fd3034..d1effa9fe0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-542.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-542.js @@ -28,7 +28,8 @@ Object.defineProperty(obj, "prop", { configurable: false }); -assert(obj.hasOwnProperty("prop")); -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-546.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-546.js index bd266dbcb3..2cefdfbb7f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-546.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-546.js @@ -29,6 +29,7 @@ Object.defineProperty(obj, "prop", { configurable: false }); var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); +assert.sameValue(desc1.configurable, false); try { Object.defineProperty(obj, "prop", { @@ -38,12 +39,10 @@ try { throw new Test262Error("Expected TypeError"); } catch (e) { assert(e instanceof TypeError); - assert.sameValue(desc1.configurable, false); - - var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); - assert.sameValue(desc2.configurable, false); - - verifyNotConfigurable(obj, "prop"); } +verifyProperty(obj, "prop", { + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-547-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-547-1.js index ae003f7fdd..24c73a6f46 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-547-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-547-1.js @@ -51,15 +51,14 @@ try { verifyWritable(obj, "0", "verifySetFunc"); - verifyEnumerable(obj, "0"); - - verifyNotConfigurable(obj, "0"); - - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "0", { + enumerable: true, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-547-2.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-547-2.js index 6b40da84ff..1fc93445ef 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-547-2.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-547-2.js @@ -53,15 +53,14 @@ try { verifyWritable(obj, "prop", "verifySetFunc"); - verifyEnumerable(obj, "prop"); - - verifyNotConfigurable(obj, "prop"); - - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "prop", { + enumerable: true, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-547-3.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-547-3.js index db6e0fdd62..3e3815b131 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-547-3.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-547-3.js @@ -51,14 +51,15 @@ try { verifyWritable(obj, "prop", "verifySetFunc"); - verifyEnumerable(obj, "prop"); - - verifyNotConfigurable(obj, "prop"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } } +verifyProperty(obj, "prop", { + enumerable: true, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-547-4.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-547-4.js index ffc954933e..f5261f8ce5 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-547-4.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-547-4.js @@ -51,15 +51,14 @@ try { verifyWritable(obj, "0", "verifySetFunc"); - verifyEnumerable(obj, "0"); - - verifyNotConfigurable(obj, "0"); - - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "0", { + enumerable: true, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-55.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-55.js index ca020589dd..7fced08f66 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-55.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-55.js @@ -28,8 +28,9 @@ verifyEqualTo(obj, "property", getFunc()); verifyWritable(obj, "property", "setVerifyHelpProp"); -verifyNotEnumerable(obj, "property"); - -verifyConfigurable(obj, "property"); +verifyProperty(obj, "property", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-555.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-555.js index 96f0f78ea5..64d8596265 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-555.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-555.js @@ -36,6 +36,8 @@ Object.defineProperty(obj, "prop", { configurable: false }); -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-56.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-56.js index c5ea0ffad5..004dc7e27a 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-56.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-56.js @@ -27,8 +27,9 @@ verifyEqualTo(obj, "property", getFunc()); verifyWritable(obj, "property", "setVerifyHelpProp"); -verifyEnumerable(obj, "property"); - -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-560.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-560.js index 127e3d4d42..ce9172ee37 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-560.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-560.js @@ -28,7 +28,8 @@ Object.defineProperty(obj, "prop", { configurable: false }); -assert(obj.hasOwnProperty("prop")); -verifyNotConfigurable(obj, "prop"); +verifyProperty(obj, "prop", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-564.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-564.js index b4d0e29416..24c6c00d0b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-564.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-564.js @@ -28,7 +28,6 @@ Object.defineProperty(obj, "prop", { enumerable: false, configurable: false }); -var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); try { Object.defineProperty(obj, "prop", { @@ -38,8 +37,10 @@ try { throw new Test262Error("Expected TypeError"); } catch (e) { assert(e instanceof TypeError); - assert.sameValue(desc1.configurable, false); - verifyNotConfigurable(obj, "prop"); } +verifyProperty(obj, "prop", { + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-57.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-57.js index 5ad316ca51..3d010a65ec 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-57.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-57.js @@ -37,8 +37,9 @@ verifyEqualTo(obj, "property", getFunc()); verifyWritable(obj, "property", "setVerifyHelpProp"); -verifyNotEnumerable(obj, "property"); - -verifyNotConfigurable(obj, "property"); +verifyProperty(obj, "property", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-58.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-58.js index d561f384f6..0e63b0085c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-58.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-58.js @@ -15,12 +15,12 @@ var obj = {}; obj.foo = 101; // default value of attributes: writable: true, configurable: true, enumerable: true Object.defineProperty(obj, "foo", {}); -verifyEqualTo(obj, "foo", 101); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 101, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-59.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-59.js index 903ac63326..6621860c56 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-59.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-59.js @@ -30,8 +30,9 @@ verifyEqualTo(obj, "foo", getFunc()); verifyWritable(obj, "foo", "helpVerifySet"); -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-60.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-60.js index bb14e77bed..58699274f6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-60.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-60.js @@ -17,12 +17,12 @@ obj.foo = 101; // default value of attributes: writable: true, configurable: tru Object.defineProperty(obj, "foo", { value: "abc" }); -verifyEqualTo(obj, "foo", "abc"); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: "abc", + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-61.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-61.js index a59d8e6098..6e9ca52710 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-61.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-61.js @@ -19,12 +19,12 @@ Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", { value: undefined }); -verifyEqualTo(obj, "foo", undefined); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-611.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-611.js index 19c0ef715c..29f1c7b0e6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-611.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-611.js @@ -6,33 +6,13 @@ es5id: 15.2.3.6-4-611 description: > ES5 Attributes - all attributes in Function.prototype.bind are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Function.prototype, "bind"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Function.prototype.bind; - -Function.prototype.bind = "2010"; - -var isWritable = (Function.prototype.bind === "2010"); - -var isEnumerable = false; - -for (var prop in Function.prototype) { - if (prop === "bind") { - isEnumerable = true; - } -} - -delete Function.prototype.bind; - -var isConfigurable = !Function.prototype.hasOwnProperty("bind"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Function.prototype, "bind", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-612.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-612.js index e33d81a9c2..5669e33ad1 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-612.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-612.js @@ -6,33 +6,13 @@ es5id: 15.2.3.6-4-612 description: > ES5 Attributes - all attributes in Array.prototype.indexOf are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Array.prototype, "indexOf"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Array.prototype.indexOf; - -Array.prototype.indexOf = "2010"; - -var isWritable = (Array.prototype.indexOf === "2010"); - -var isEnumerable = false; - -for (var prop in Array.prototype) { - if (prop === "indexOf") { - isEnumerable = true; - } -} - -delete Array.prototype.indexOf; - -var isConfigurable = !Array.prototype.hasOwnProperty("indexOf"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Array.prototype, "indexOf", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-613.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-613.js index 162333109f..3be61c6ded 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-613.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-613.js @@ -4,33 +4,13 @@ /*--- es5id: 15.2.3.6-4-613 description: ES5 Attributes - all attributes in Object.lastIndexOf are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Array.prototype, "lastIndexOf"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Array.prototype.lastIndexOf; - -Array.prototype.lastIndexOf = "2010"; - -var isWritable = (Array.prototype.lastIndexOf === "2010"); - -var isEnumerable = false; - -for (var prop in Array.prototype) { - if (prop === "lastIndexOf") { - isEnumerable = true; - } -} - -delete Array.prototype.lastIndexOf; - -var isConfigurable = !Array.prototype.hasOwnProperty("lastIndexOf"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Array.prototype, "lastIndexOf", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-614.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-614.js index 368a3b8977..b4017c499c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-614.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-614.js @@ -6,33 +6,13 @@ es5id: 15.2.3.6-4-614 description: > ES5 Attributes - all attributes in Array.prototype.every are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Array.prototype, "every"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Array.prototype.every; - -Array.prototype.every = "2010"; - -var isWritable = (Array.prototype.every === "2010"); - -var isEnumerable = false; - -for (var prop in Array.prototype) { - if (prop === "every") { - isEnumerable = true; - } -} - -delete Array.prototype.every; - -var isConfigurable = !Array.prototype.hasOwnProperty("every"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Array.prototype, "every", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-615.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-615.js index c4deed0cd6..de306634f0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-615.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-615.js @@ -4,33 +4,13 @@ /*--- es5id: 15.2.3.6-4-615 description: ES5 Attributes - all attributes in Array.prototype.some are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Array.prototype, "some"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Array.prototype.some; - -Array.prototype.some = "2010"; - -var isWritable = (Array.prototype.some === "2010"); - -var isEnumerable = false; - -for (var prop in Array.prototype) { - if (prop === "some") { - isEnumerable = true; - } -} - -delete Array.prototype.some; - -var isConfigurable = !Array.prototype.hasOwnProperty("some"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Array.prototype, "some", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-616.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-616.js index d5547bda86..a55fea0497 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-616.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-616.js @@ -6,33 +6,13 @@ es5id: 15.2.3.6-4-616 description: > ES5 Attributes - all attributes in Array.prototype.forEach are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Array.prototype, "forEach"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Array.prototype.forEach; - -Array.prototype.forEach = "2010"; - -var isWritable = (Array.prototype.forEach === "2010"); - -var isEnumerable = false; - -for (var prop in Array.prototype) { - if (prop === "forEach") { - isEnumerable = true; - } -} - -delete Array.prototype.forEach; - -var isConfigurable = !Array.prototype.hasOwnProperty("forEach"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Array.prototype, "forEach", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-617.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-617.js index 0d18438ceb..a2ba3ab540 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-617.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-617.js @@ -4,33 +4,13 @@ /*--- es5id: 15.2.3.6-4-617 description: ES5 Attributes - all attributes in Array.prototype.map are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Array.prototype, "map"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Array.prototype.map; - -Array.prototype.map = "2010"; - -var isWritable = (Array.prototype.map === "2010"); - -var isEnumerable = false; - -for (var prop in Array.prototype) { - if (prop === "map") { - isEnumerable = true; - } -} - -delete Array.prototype.map; - -var isConfigurable = !Array.prototype.hasOwnProperty("map"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Array.prototype, "map", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-618.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-618.js index 3e21462908..8b7d744743 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-618.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-618.js @@ -6,33 +6,13 @@ es5id: 15.2.3.6-4-618 description: > ES5 Attributes - all attributes in Array.prototype.filter are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Array.prototype, "filter"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Array.prototype.filter; - -Array.prototype.filter = "2010"; - -var isWritable = (Array.prototype.filter === "2010"); - -var isEnumerable = false; - -for (var prop in Array.prototype) { - if (prop === "filter") { - isEnumerable = true; - } -} - -delete Array.prototype.filter; - -var isConfigurable = !Array.prototype.hasOwnProperty("filter"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Array.prototype, "filter", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-619.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-619.js index 746209ea13..2bc25fcfe4 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-619.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-619.js @@ -6,33 +6,13 @@ es5id: 15.2.3.6-4-619 description: > ES5 Attributes - all attributes in Array.prototype.reduce are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Array.prototype, "reduce"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Array.prototype.reduce; - -Array.prototype.reduce = "2010"; - -var isWritable = (Array.prototype.reduce === "2010"); - -var isEnumerable = false; - -for (var prop in Array.prototype) { - if (prop === "reduce") { - isEnumerable = true; - } -} - -delete Array.prototype.reduce; - -var isConfigurable = !Array.prototype.hasOwnProperty("reduce"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Array.prototype, "reduce", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-62.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-62.js index f16d18a98b..4faabfad64 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-62.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-62.js @@ -19,12 +19,12 @@ Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", { value: null }); -verifyEqualTo(obj, "foo", null); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: null, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-620.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-620.js index 6ce2dbb7ce..d20710fc44 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-620.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-620.js @@ -6,33 +6,13 @@ es5id: 15.2.3.6-4-620 description: > ES5 Attributes - all attributes in Array.prototype.reduceRight are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Array.prototype, "reduceRight"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Array.prototype.reduceRight; - -Array.prototype.reduceRight = "2010"; - -var isWritable = (Array.prototype.reduceRight === "2010"); - -var isEnumerable = false; - -for (var prop in Array.prototype) { - if (prop === "reduceRight") { - isEnumerable = true; - } -} - -delete Array.prototype.reduceRight; - -var isConfigurable = !Array.prototype.hasOwnProperty("reduceRight"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Array.prototype, "reduceRight", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-621.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-621.js index 5e00e1db4f..9bd87e96e3 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-621.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-621.js @@ -6,33 +6,13 @@ es5id: 15.2.3.6-4-621 description: > ES5 Attributes - all attributes in String.prototype.trim are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(String.prototype, "trim"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = String.prototype.trim; - -String.prototype.trim = "2010"; - -var isWritable = (String.prototype.trim === "2010"); - -var isEnumerable = false; - -for (var prop in String.prototype) { - if (prop === "trim") { - isEnumerable = true; - } -} - -delete String.prototype.trim; - -var isConfigurable = !String.prototype.hasOwnProperty("trim"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(String.prototype, "trim", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-622.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-622.js index db59aba810..fe21ad4d58 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-622.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-622.js @@ -4,33 +4,14 @@ /*--- es5id: 15.2.3.6-4-622 description: ES5 Attributes - all attributes in Date.now are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Date, "now"); +verifyProperty(Date, "now", { + writable: true, + enumerable: false, + configurable: true, +}); -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Date.now; - -Date.now = "2010"; - -var isWritable = (Date.now === "2010"); - -var isEnumerable = false; - -for (var prop in Date) { - if (prop === "now") { - isEnumerable = true; - } -} - -delete Date.now; - -var isConfigurable = !Date.hasOwnProperty("now"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-623.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-623.js index a5c94f29b7..b314bc2c50 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-623.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-623.js @@ -6,33 +6,13 @@ es5id: 15.2.3.6-4-623 description: > ES5 Attributes - all attributes in Date.prototype.toISOString are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Date.prototype, "toISOString"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Date.prototype.toISOString; - -Date.prototype.toISOString = "2010"; - -var isWritable = (Date.prototype.toISOString === "2010"); - -var isEnumerable = false; - -for (var prop in Date.prototype) { - if (prop === "toISOString") { - isEnumerable = true; - } -} - -delete Date.prototype.toISOString; - -var isConfigurable = !Date.prototype.hasOwnProperty("toISOString"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Date.prototype, "toISOString", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-624.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-624.js index 4774991788..e2362387ca 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-624.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-624.js @@ -6,33 +6,13 @@ es5id: 15.2.3.6-4-624 description: > ES5 Attributes - all attributes in Date.prototype.toJSON are correct +includes: [propertyHelper.js] ---*/ -var desc = Object.getOwnPropertyDescriptor(Date.prototype, "toJSON"); - -var propertyAreCorrect = (desc.writable === true && desc.enumerable === false && desc.configurable === true); - -var temp = Date.prototype.toJSON; - -Date.prototype.toJSON = "2010"; - -var isWritable = (Date.prototype.toJSON === "2010"); - -var isEnumerable = false; - -for (var prop in Date.prototype) { - if (prop === "toJSON") { - isEnumerable = true; - } -} - -delete Date.prototype.toJSON; - -var isConfigurable = !Date.prototype.hasOwnProperty("toJSON"); - -assert(propertyAreCorrect, 'propertyAreCorrect !== true'); -assert(isWritable, 'isWritable !== true'); -assert.sameValue(isEnumerable, false, 'isEnumerable'); -assert(isConfigurable, 'isConfigurable !== true'); +verifyProperty(Date.prototype, "toJSON", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-63.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-63.js index feaf556cef..e92be049d0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-63.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-63.js @@ -19,12 +19,11 @@ Object.defineProperty(obj, "foo", { value: NaN }); -assert.sameValue(obj.foo, NaN); - -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: NaN, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-64.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-64.js index d627e8a13f..53599d36c6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-64.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-64.js @@ -23,18 +23,16 @@ try { throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", -0); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: -0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-65.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-65.js index ed2ac2cc12..f0abc12984 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-65.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-65.js @@ -22,18 +22,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", +0); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: +0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-66.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-66.js index 87fe39bdbd..3339c81706 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-66.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-66.js @@ -17,12 +17,12 @@ obj.foo = 101; // default value of attributes: writable: true, configurable: tru Object.defineProperty(obj, "foo", { value: 102 }); -verifyEqualTo(obj, "foo", 102); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 102, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-67.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-67.js index 6778b65e76..ab0c3fce02 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-67.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-67.js @@ -20,12 +20,12 @@ Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", { value: "abcd" }); -verifyEqualTo(obj, "foo", "abcd"); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: "abcd", + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-68.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-68.js index f3f74ca0b1..e914ee7275 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-68.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-68.js @@ -17,12 +17,12 @@ obj.foo = "abcd"; // default value of attributes: writable: true, configurable: Object.defineProperty(obj, "foo", { value: "fghj" }); -verifyEqualTo(obj, "foo", "fghj"); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: "fghj", + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-69.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-69.js index 39244aa40a..682db19208 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-69.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-69.js @@ -19,12 +19,12 @@ Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", { value: true }); -verifyEqualTo(obj, "foo", true); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: true, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-70.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-70.js index 24d4977637..c431b43b55 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-70.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-70.js @@ -17,12 +17,12 @@ obj.foo = true; // default value of attributes: writable: true, configurable: tr Object.defineProperty(obj, "foo", { value: false }); -verifyEqualTo(obj, "foo", false); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: false, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-71.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-71.js index c12aa123b1..146f1b2a92 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-71.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-71.js @@ -23,12 +23,12 @@ Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", { value: obj1 }); -verifyEqualTo(obj, "foo", obj1); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: obj1, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-72.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-72.js index 36c4fe3a34..2e10a620e6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-72.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-72.js @@ -24,12 +24,12 @@ var obj2 = { Object.defineProperty(obj, "foo", { value: obj2 }); -verifyEqualTo(obj, "foo", obj2); -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: obj2, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-73.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-73.js index e003f7060f..19ee10354a 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-73.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-73.js @@ -19,12 +19,12 @@ Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", { writable: false }); -verifyEqualTo(obj, "foo", undefined); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-74.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-74.js index 735ff9e36d..a711a14148 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-74.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-74.js @@ -20,12 +20,12 @@ Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", { writable: true }); -verifyEqualTo(obj, "foo", undefined); -verifyWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: undefined, + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-75.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-75.js index ffb8fa59fc..b51fe84c77 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-75.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-75.js @@ -32,8 +32,9 @@ verifyEqualTo(obj, "foo", getFunc()); verifyWritable(obj, "foo", "helpVerifySet"); -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-76.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-76.js index 91a011f019..b6b16ff6ac 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-76.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-76.js @@ -37,8 +37,9 @@ verifyEqualTo(obj, "foo", getFunc2()); verifyWritable(obj, "foo", "helpVerifySet"); -verifyNotEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-77.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-77.js index 11813c0338..6e9275c910 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-77.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-77.js @@ -25,8 +25,9 @@ Object.defineProperty(obj, "foo", { }); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-78.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-78.js index 9ffdeb435b..7be495b41e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-78.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-78.js @@ -28,8 +28,9 @@ Object.defineProperty(obj, "foo", { }); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyNotEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-79.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-79.js index 0295f90eef..f82e5431b1 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-79.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-79.js @@ -19,12 +19,12 @@ Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", { enumerable: false }); -verifyEqualTo(obj, "foo", undefined); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-80.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-80.js index 06c6f05859..f2595e67e6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-80.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-80.js @@ -20,12 +20,12 @@ Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", { enumerable: true }); -verifyEqualTo(obj, "foo", undefined); -verifyNotWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: undefined, + writable: false, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-81.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-81.js index bb04cb882d..88b4844633 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-81.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-81.js @@ -19,12 +19,12 @@ Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", { configurable: false }); -verifyEqualTo(obj, "foo", undefined); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-1.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-1.js index b2a9b4b8ae..c5dfda4bc9 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-1.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-1.js @@ -27,12 +27,11 @@ Object.defineProperty(obj, "foo", { enumerable: false }); -verifyEqualTo(obj, "foo", 1001); - -verifyWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 1001, + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-10.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-10.js index 4c2395e14d..ac6298f340 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-10.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-10.js @@ -38,8 +38,9 @@ verifyEqualTo(obj, "foo", get_func()); verifyWritable(obj, "foo", "verifySetFunction"); -verifyEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-11.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-11.js index 0fefd5de68..416f684952 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-11.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-11.js @@ -38,8 +38,9 @@ verifyEqualTo(obj, "foo", get_func()); verifyWritable(obj, "foo", "verifySetFunction"); -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-12.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-12.js index ba8dd041b1..14e09775c2 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-12.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-12.js @@ -37,8 +37,9 @@ verifyEqualTo(obj, "foo", get_func()); verifyWritable(obj, "foo", "verifySetFunction"); -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-13.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-13.js index 4e954f0939..0e3cd8165c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-13.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-13.js @@ -27,12 +27,11 @@ Object.defineProperty(obj, "0", { enumerable: false }); -verifyEqualTo(obj, "0", 1001); - -verifyWritable(obj, "0"); - -verifyNotEnumerable(obj, "0"); - -verifyConfigurable(obj, "0"); +verifyProperty(obj, "0", { + value: 1001, + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-14.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-14.js index b91f538d57..3f21dbcd94 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-14.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-14.js @@ -28,12 +28,11 @@ Object.defineProperty(obj, "0", { configurable: true }); -verifyEqualTo(obj, "0", 1001); - -verifyWritable(obj, "0"); - -verifyNotEnumerable(obj, "0"); - -verifyConfigurable(obj, "0"); +verifyProperty(obj, "0", { + value: 1001, + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-15.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-15.js index 5a88b4781c..49d20e8780 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-15.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-15.js @@ -26,12 +26,11 @@ Object.defineProperty(obj, "0", { configurable: false }); -verifyEqualTo(obj, "0", 1001); - -verifyWritable(obj, "0"); - -verifyEnumerable(obj, "0"); - -verifyNotConfigurable(obj, "0"); +verifyProperty(obj, "0", { + value: 1001, + writable: true, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-16.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-16.js index fe07c56e74..b22ff1fb7c 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-16.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-16.js @@ -28,12 +28,11 @@ Object.defineProperty(obj, "0", { configurable: false }); -verifyEqualTo(obj, "0", 1001); - -verifyWritable(obj, "0"); - -verifyEnumerable(obj, "0"); - -verifyNotConfigurable(obj, "0"); +verifyProperty(obj, "0", { + value: 1001, + writable: true, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-17.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-17.js index de43ae8048..acac52e8c1 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-17.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-17.js @@ -28,12 +28,11 @@ Object.defineProperty(obj, "0", { configurable: false }); -verifyEqualTo(obj, "0", 1001); - -verifyWritable(obj, "0"); - -verifyNotEnumerable(obj, "0"); - -verifyNotConfigurable(obj, "0"); +verifyProperty(obj, "0", { + value: 1001, + writable: true, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-18.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-18.js index 30b44c922c..063c7d48a1 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-18.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-18.js @@ -27,12 +27,11 @@ Object.defineProperty(obj, "0", { enumerable: true }); -verifyEqualTo(obj, "0", 1001); - -verifyWritable(obj, "0"); - -verifyEnumerable(obj, "0"); - -verifyConfigurable(obj, "0"); +verifyProperty(obj, "0", { + value: 1001, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-19.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-19.js index b8776f7da0..894860a0a6 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-19.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-19.js @@ -37,8 +37,9 @@ verifyEqualTo(obj, "0", get_func()); verifyWritable(obj, "0", "verifySetFunction"); -verifyNotEnumerable(obj, "0"); - -verifyConfigurable(obj, "0"); +verifyProperty(obj, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-2.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-2.js index e5093aeec7..0c3c12cb09 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-2.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-2.js @@ -28,12 +28,11 @@ Object.defineProperty(obj, "foo", { configurable: true }); -verifyEqualTo(obj, "foo", 1001); - -verifyWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 1001, + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-20.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-20.js index 4b4ee70a99..d05a255134 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-20.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-20.js @@ -38,8 +38,9 @@ verifyEqualTo(obj, "0", get_func()); verifyWritable(obj, "0", "verifySetFunction"); -verifyNotEnumerable(obj, "0"); - -verifyConfigurable(obj, "0"); +verifyProperty(obj, "0", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-21.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-21.js index f4d984ef54..c3f45f0fb5 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-21.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-21.js @@ -37,8 +37,9 @@ verifyEqualTo(obj, "0", get_func()); verifyWritable(obj, "0", "verifySetFunction"); -verifyEnumerable(obj, "0"); - -verifyNotConfigurable(obj, "0"); +verifyProperty(obj, "0", { + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-22.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-22.js index 4df84cf130..88c4a33a60 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-22.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-22.js @@ -38,8 +38,9 @@ verifyEqualTo(obj, "0", get_func()); verifyWritable(obj, "0", "verifySetFunction"); -verifyEnumerable(obj, "0"); - -verifyNotConfigurable(obj, "0"); +verifyProperty(obj, "0", { + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-23.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-23.js index a313d8ed02..8c9693671f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-23.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-23.js @@ -38,8 +38,9 @@ verifyEqualTo(obj, "0", get_func()); verifyWritable(obj, "0", "verifySetFunction"); -verifyNotEnumerable(obj, "0"); - -verifyNotConfigurable(obj, "0"); +verifyProperty(obj, "0", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-24.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-24.js index fd2e6d537b..199a0c8f9e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-24.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-24.js @@ -37,8 +37,9 @@ verifyEqualTo(obj, "0", get_func()); verifyWritable(obj, "0", "verifySetFunction"); -verifyEnumerable(obj, "0"); - -verifyConfigurable(obj, "0"); +verifyProperty(obj, "0", { + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-3.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-3.js index f031e54a38..083cd2a349 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-3.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-3.js @@ -26,12 +26,11 @@ Object.defineProperty(obj, "foo", { configurable: false }); -verifyEqualTo(obj, "foo", 1001); - -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 1001, + writable: true, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-4.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-4.js index 9e6bd3600a..341f8055ba 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-4.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-4.js @@ -28,12 +28,11 @@ Object.defineProperty(obj, "foo", { configurable: false }); -verifyEqualTo(obj, "foo", 1001); - -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 1001, + writable: true, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-5.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-5.js index d0dae554c5..431ae80ae1 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-5.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-5.js @@ -28,12 +28,11 @@ Object.defineProperty(obj, "foo", { configurable: false }); -verifyEqualTo(obj, "foo", 1001); - -verifyWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 1001, + writable: true, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-6.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-6.js index 265df4a1bb..c5821b1bba 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-6.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-6.js @@ -27,12 +27,11 @@ Object.defineProperty(obj, "foo", { enumerable: true }); -verifyEqualTo(obj, "foo", 1001); - -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 1001, + writable: true, + enumerable: true, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-7.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-7.js index 72e6355d42..d41b441ab0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-7.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-7.js @@ -37,8 +37,9 @@ verifyEqualTo(obj, "foo", get_func()); verifyWritable(obj, "foo", "verifySetFunction"); -verifyNotEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-8.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-8.js index 1238652846..3404e81fe0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-8.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-8.js @@ -38,8 +38,9 @@ verifyEqualTo(obj, "foo", get_func()); verifyWritable(obj, "foo", "verifySetFunction"); -verifyNotEnumerable(obj, "foo"); - -verifyConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-9.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-9.js index 7f7b8b7a1d..e8a7bdfb6e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-9.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82-9.js @@ -37,8 +37,9 @@ verifyEqualTo(obj, "foo", get_func()); verifyWritable(obj, "foo", "verifySetFunction"); -verifyEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82.js index f80c1afff1..961ee791bb 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-82.js @@ -19,12 +19,12 @@ Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", { configurable: false }); -verifyEqualTo(obj, "foo", undefined); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-83.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-83.js index c9fb22b3d7..34d5c23c1f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-83.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-83.js @@ -24,12 +24,12 @@ Object.defineProperty(obj, "foo", { writable: false, configurable: false }); -verifyEqualTo(obj, "foo", undefined); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: undefined, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-84.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-84.js index fdb49395ee..cd1857b57f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-84.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-84.js @@ -24,12 +24,12 @@ Object.defineProperty(obj, "foo", { writable: false, configurable: false }); -verifyEqualTo(obj, "foo", null); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: null, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-85.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-85.js index 882a018143..077358427d 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-85.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-85.js @@ -24,12 +24,11 @@ Object.defineProperty(obj, "foo", { configurable: false }); -assert.sameValue(obj.foo, NaN); - -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: NaN, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-86.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-86.js index 1bf35f3460..e06026db5f 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-86.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-86.js @@ -25,18 +25,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", -0); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: -0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-87.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-87.js index cbf3421f4e..bb440cdfab 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-87.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-87.js @@ -25,18 +25,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", +0); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: +0, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-88.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-88.js index 27b56ee337..acf4b9ef0b 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-88.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-88.js @@ -23,12 +23,12 @@ Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", { value: 100 }); -verifyEqualTo(obj, "foo", 100); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 100, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-89.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-89.js index a8b3ba707f..c2486ea1c9 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-89.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-89.js @@ -25,18 +25,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", 10); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: 10, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-90.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-90.js index 07438a7406..e5909987a0 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-90.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-90.js @@ -23,12 +23,12 @@ Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", { value: "abcd" }); -verifyEqualTo(obj, "foo", "abcd"); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: "abcd", + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-91.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-91.js index 665ae48b79..b8b341634e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-91.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-91.js @@ -25,18 +25,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", "abcd"); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: "abcd", + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-92.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-92.js index 780ad68e54..5eea0ded00 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-92.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-92.js @@ -23,12 +23,12 @@ Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", { value: false }); -verifyEqualTo(obj, "foo", false); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: false, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-93.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-93.js index 27113a056f..ae20af55cb 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-93.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-93.js @@ -25,18 +25,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", false); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: false, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-94.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-94.js index 6a3a90950d..62816a425e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-94.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-94.js @@ -27,12 +27,12 @@ Object.defineProperty(obj, "foo", { Object.defineProperty(obj, "foo", { value: obj1 }); -verifyEqualTo(obj, "foo", obj1); -verifyNotWritable(obj, "foo"); - -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: obj1, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-95.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-95.js index 9590be199b..d88f1f6a86 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-95.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-95.js @@ -34,18 +34,16 @@ try { }); throw new Test262Error("Expected an exception."); } catch (e) { - verifyEqualTo(obj, "foo", obj1); - - verifyNotWritable(obj, "foo"); - - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + value: obj1, + writable: false, + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-96.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-96.js index 6cc17c467e..f0629223d7 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-96.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-96.js @@ -27,8 +27,9 @@ Object.defineProperty(obj, "foo", { }); verifyWritable(obj, "foo", "setVerifyHelpProp"); -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-97.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-97.js index 6e3d07a24b..8a5ada0331 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-97.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-97.js @@ -33,14 +33,14 @@ try { } catch (e) { verifyEqualTo(obj, "property", getFunc()); - verifyNotEnumerable(obj, "property"); - - verifyNotConfigurable(obj, "property"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "property", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-98.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-98.js index 0b54b241d5..99cd678b2a 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-98.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-98.js @@ -35,8 +35,9 @@ verifyEqualTo(obj, "foo", getFunc()); verifyWritable(obj, "foo", "verifyGetHelpMethod"); -verifyNotEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-99.js b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-99.js index bc8efa7208..2d0cd0e7da 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-99.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-99.js @@ -35,14 +35,14 @@ try { } catch (e) { verifyWritable(obj, "foo", "setVerifyHelpProp"); - verifyNotEnumerable(obj, "foo"); - - verifyNotConfigurable(obj, "foo"); - if (!(e instanceof TypeError)) { throw new Test262Error("Expected TypeError, got " + e); } - } +verifyProperty(obj, "foo", { + enumerable: false, + configurable: false, +}); + reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/name.js b/js/src/tests/test262/built-ins/Object/defineProperty/name.js index 93e3066236..277210934e 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/name.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.defineProperty.name, "defineProperty"); - -verifyNotEnumerable(Object.defineProperty, "name"); -verifyNotWritable(Object.defineProperty, "name"); -verifyConfigurable(Object.defineProperty, "name"); +verifyProperty(Object.defineProperty, "name", { + value: "defineProperty", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/defineProperty/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/defineProperty/not-a-constructor.js index 8c49a7085c..4b5af11af9 100644 --- a/js/src/tests/test262/built-ins/Object/defineProperty/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/defineProperty/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Object.defineProperty({}, '', {}); -}, '`new Object.defineProperty({}, \'\', {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/entries/function-length.js b/js/src/tests/test262/built-ins/Object/entries/function-length.js index 6510ac12b6..297c3acb8b 100644 --- a/js/src/tests/test262/built-ins/Object/entries/function-length.js +++ b/js/src/tests/test262/built-ins/Object/entries/function-length.js @@ -8,10 +8,11 @@ author: Jordan Harband includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.entries.length, 1, 'Expected Object.entries.length to be 1'); - -verifyNotEnumerable(Object.entries, 'length'); -verifyNotWritable(Object.entries, 'length'); -verifyConfigurable(Object.entries, 'length'); +verifyProperty(Object.entries, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/entries/function-name.js b/js/src/tests/test262/built-ins/Object/entries/function-name.js index ddc50048d8..981386649c 100644 --- a/js/src/tests/test262/built-ins/Object/entries/function-name.js +++ b/js/src/tests/test262/built-ins/Object/entries/function-name.js @@ -8,14 +8,11 @@ author: Jordan Harband includes: [propertyHelper.js] ---*/ -assert.sameValue( - Object.entries.name, - 'entries', - 'Expected Object.entries.name to be "entries"' -); - -verifyNotEnumerable(Object.entries, 'name'); -verifyNotWritable(Object.entries, 'name'); -verifyConfigurable(Object.entries, 'name'); +verifyProperty(Object.entries, "name", { + value: "entries", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/entries/function-property-descriptor.js b/js/src/tests/test262/built-ins/Object/entries/function-property-descriptor.js index a1ed98ba44..35bb70debf 100644 --- a/js/src/tests/test262/built-ins/Object/entries/function-property-descriptor.js +++ b/js/src/tests/test262/built-ins/Object/entries/function-property-descriptor.js @@ -8,8 +8,10 @@ author: Jordan Harband includes: [propertyHelper.js] ---*/ -verifyNotEnumerable(Object, 'entries'); -verifyWritable(Object, 'entries'); -verifyConfigurable(Object, 'entries'); +verifyProperty(Object, "entries", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/entries/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/entries/not-a-constructor.js index cab5f1d2e6..5c53c08703 100644 --- a/js/src/tests/test262/built-ins/Object/entries/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/entries/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Object.entries), false, 'isConstructor(Object.ent assert.throws(TypeError, () => { new Object.entries({}); -}, '`new Object.entries({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-4.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-4.js index d1c0131160..812183048a 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-4.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-4.js @@ -17,8 +17,9 @@ Object.defineProperty(obj, "foo", { Object.freeze(obj); -assert(obj.hasOwnProperty("foo")); -verifyNotWritable(obj, "foo"); -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-1.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-1.js index a03d148d17..49575f4042 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-1.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-1.js @@ -13,9 +13,10 @@ obj.foo = 10; // default [[Configurable]] attribute value of foo: true Object.freeze(obj); -verifyNotWritable(obj, "foo"); -verifyNotConfigurable(obj, "foo"); - -assert.sameValue(obj.foo, 10); +verifyProperty(obj, "foo", { + value: 10, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-10.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-10.js index ac66e48f32..4f8efb99c8 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-10.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-10.js @@ -15,9 +15,10 @@ arrObj.foo = 10; // default [[Configurable]] attribute value of foo: true Object.freeze(arrObj); -verifyNotWritable(arrObj, "foo"); -verifyNotConfigurable(arrObj, "foo"); - -assert.sameValue(arrObj.foo, 10); +verifyProperty(arrObj, "foo", { + value: 10, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-11.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-11.js index b9db664525..4e4fe8ac10 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-11.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-11.js @@ -17,10 +17,10 @@ var argObj = (function() { Object.freeze(argObj); -var desc = Object.getOwnPropertyDescriptor(argObj, "0"); - -verifyNotWritable(argObj, "0"); -verifyNotConfigurable(argObj, "0"); -assert.sameValue(argObj[0], 1); +verifyProperty(argObj, "0", { + value: 1, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-12.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-12.js index 1eb5dbbc11..4072d7b0f1 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-12.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-12.js @@ -15,9 +15,10 @@ var strObj = new String("abc"); Object.freeze(strObj); -verifyNotWritable(strObj, "0"); -verifyNotConfigurable(strObj, "0"); - -assert.sameValue(strObj[0], "a"); +verifyProperty(strObj, "0", { + value: "a", + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-13.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-13.js index c4d1fa96be..41ce47b491 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-13.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-13.js @@ -17,9 +17,10 @@ var obj = { Object.freeze(obj); -verifyNotWritable(obj, "0"); -verifyNotConfigurable(obj, "0"); - -assert.sameValue(obj[0], 0); +verifyProperty(obj, "0", { + value: 0, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-14.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-14.js index eecc860739..f14cf55984 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-14.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-14.js @@ -14,8 +14,10 @@ var arrObj = [0, 1, 2]; Object.freeze(arrObj); -verifyNotWritable(arrObj, "0"); -verifyNotConfigurable(arrObj, "0"); -assert.sameValue(arrObj[0], 0); +verifyProperty(arrObj, "0", { + value: 0, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-2.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-2.js index 3bf26de301..94daf9f243 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-2.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-2.js @@ -23,9 +23,10 @@ child.foo = 10; // default [[Configurable]] attribute value of foo: true Object.freeze(child); -verifyNotWritable(child, "foo"); -verifyNotConfigurable(child, "foo"); - -assert.sameValue(child.foo, 10); +verifyProperty(child, "foo", { + value: 10, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-3.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-3.js index 9e70497f78..00faf0bfc8 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-3.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-3.js @@ -29,8 +29,10 @@ Object.defineProperty(child, "foo", { Object.freeze(child); -verifyNotWritable(child, "foo"); -verifyNotConfigurable(child, "foo"); -assert.sameValue(child.foo, 10); +verifyProperty(child, "foo", { + value: 10, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-4.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-4.js index acdfed7f01..be1ed8c528 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-4.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-4.js @@ -18,7 +18,10 @@ Object.defineProperty(obj, "foo", { Object.freeze(obj); -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + configurable: false, +}); + assert.sameValue(obj.foo, 10); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-5.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-5.js index 00ff5bfc63..f08d411009 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-5.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-5.js @@ -28,7 +28,10 @@ Object.defineProperty(child, "foo", { Object.freeze(child); -verifyNotConfigurable(child, "foo"); +verifyProperty(child, "foo", { + configurable: false, +}); + assert.sameValue(child.foo, 10); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-6.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-6.js index 163d0a951e..a1e8b22dac 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-6.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-6.js @@ -32,7 +32,10 @@ Object.defineProperty(child, "foo", { Object.freeze(child); -verifyNotConfigurable(child, "foo"); +verifyProperty(child, "foo", { + configurable: false, +}); + assert.sameValue(child.foo, 10); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-7.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-7.js index c8de353b20..5243d62cec 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-7.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-7.js @@ -17,8 +17,10 @@ argObj.foo = 10; // default [[Configurable]] attribute value of foo: true Object.freeze(argObj); -verifyNotWritable(argObj, "foo"); -verifyNotConfigurable(argObj, "foo"); -assert.sameValue(argObj.foo, 10); +verifyProperty(argObj, "foo", { + value: 10, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-8.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-8.js index f930bdee5f..d7eabe58ec 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-8.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-8.js @@ -15,8 +15,10 @@ strObj.foo = 10; // default [[Configurable]] attribute value of foo: true Object.freeze(strObj); -verifyNotWritable(strObj, "foo"); -verifyNotConfigurable(strObj, "foo"); -assert.sameValue(strObj.foo, 10); +verifyProperty(strObj, "foo", { + value: 10, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-9.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-9.js index 2d2c722646..f79a8ba921 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-9.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-a-9.js @@ -15,9 +15,10 @@ funObj.foo = 10; // default [[Configurable]] attribute value of foo: true Object.freeze(funObj); -verifyNotWritable(funObj, "foo"); -verifyNotConfigurable(funObj, "foo"); - -assert.sameValue(funObj.foo, 10); +verifyProperty(funObj, "foo", { + value: 10, + writable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-b-i-1.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-b-i-1.js index 4c6c953c7b..26e0c0cb37 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-b-i-1.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-b-i-1.js @@ -19,22 +19,12 @@ Object.defineProperty(obj, "foo", { }); Object.freeze(obj); -var desc = Object.getOwnPropertyDescriptor(obj, "foo"); -verifyEqualTo(obj, "foo", 10); - -verifyNotWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); - -if (desc.writable !== false) { - throw new Test262Error('Expected desc.writable === false, actually ' + desc.writable); -} - -if (desc.configurable !== false) { - throw new Test262Error('Expected desc.configurable === false, actually ' + desc.configurable); -} +verifyProperty(obj, "foo", { + value: 10, + writable: false, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-b-i-2.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-b-i-2.js index 2d8a00a53b..bb6fd6bcf2 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-b-i-2.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-b-i-2.js @@ -28,39 +28,18 @@ Object.defineProperty(obj, "foo2", { Object.freeze(obj); -var desc1 = Object.getOwnPropertyDescriptor(obj, "foo1"); -var desc2 = Object.getOwnPropertyDescriptor(obj, "foo2"); - -verifyEqualTo(obj, "foo1", 10); - -verifyNotWritable(obj, "foo1"); - -verifyEnumerable(obj, "foo1"); - -verifyNotConfigurable(obj, "foo1"); - -verifyEqualTo(obj, "foo2", 20); - -verifyNotWritable(obj, "foo2"); - -verifyNotEnumerable(obj, "foo2"); - -verifyNotConfigurable(obj, "foo2"); - -if (desc1.configurable !== false) { - throw new Test262Error('Expected desc1.configurable === false, actually ' + desc1.configurable); -} - -if (desc1.writable !== false) { - throw new Test262Error('Expected desc1.writable === false, actually ' + desc1.writable); -} - -if (desc2.configurable !== false) { - throw new Test262Error('Expected desc2.configurable === false, actually ' + desc2.configurable); -} +verifyProperty(obj, "foo1", { + value: 10, + writable: false, + enumerable: true, + configurable: false, +}); -if (desc2.writable !== false) { - throw new Test262Error('Expected desc2.writable === false, actually ' + desc2.writable); -} +verifyProperty(obj, "foo2", { + value: 20, + writable: false, + enumerable: false, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-1.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-1.js index 219519195c..4969d18425 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-1.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-1.js @@ -21,21 +21,11 @@ Object.defineProperty(obj, "foo", { Object.freeze(obj); -var desc = Object.getOwnPropertyDescriptor(obj, "foo"); - -if (desc.configurable !== false) { - throw new Test262Error("Expected desc.configurable to be false, actually " + desc.configurable); -} -if (desc.writable !== false) { - throw new Test262Error("Expected desc.writable to be false, actually " + desc.writable); -} - -verifyEqualTo(obj, "foo", 10); - -verifyNotWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 10, + writable: false, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-2.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-2.js index af0797a00d..c59e8e068a 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-2.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-2.js @@ -31,17 +31,18 @@ Object.defineProperty(obj, "foo", { Object.freeze(obj); -assert(obj.hasOwnProperty("foo")); -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + configurable: false, +}); assert.sameValue(obj.foo, 10); obj.foo = 12; assert(set_funcCalled); -verifyEnumerable(obj, "foo"); - -var desc = Object.getOwnPropertyDescriptor(obj, "foo"); -assert.sameValue(desc.configurable, false); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-3.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-3.js index 24be086754..9ac2917a53 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-3.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-3.js @@ -37,7 +37,10 @@ Object.defineProperty(obj, "foo2", { Object.freeze(obj); -verifyNotConfigurable(obj, "foo2"); +verifyProperty(obj, "foo2", { + configurable: false, +}); + verifyEqualTo(obj, "foo2", 10); obj.foo2 = 12; @@ -45,26 +48,21 @@ if (!resultSetFun) { throw new Test262Error('Expected obj["foo2"] set() to be called, but was not.'); } -if (!isEnumerable(obj, "foo2")) { - throw new Test262Error('Expected obj["foo2"] to be enumerable.'); -} - -var desc1 = Object.getOwnPropertyDescriptor(obj, "foo1"); -if (desc1.configurable || desc1.writable) { - throw new Test262Error('Expected obj["foo1"] to be non-writable, non-configurable; actually ' + JSON.stringify(desc1)); -} +verifyProperty(obj, "foo2", { + enumerable: true, + configurable: false, +}); var desc2 = Object.getOwnPropertyDescriptor(obj, "foo2"); -if (desc2.configurable || desc2.writable) { +if (desc2.writable) { throw new Test262Error('Expected obj["foo2"] to be non-writable, non-configurable; actually ' + JSON.stringify(desc2)); } -verifyEqualTo(obj, "foo1", 10); - -verifyNotWritable(obj, "foo1"); - -verifyEnumerable(obj, "foo1"); - -verifyNotConfigurable(obj, "foo1"); +verifyProperty(obj, "foo1", { + value: 10, + writable: false, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-4.js b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-4.js index 49390cbf84..f211cbeb73 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-4.js +++ b/js/src/tests/test262/built-ins/Object/freeze/15.2.3.9-2-c-4.js @@ -38,31 +38,30 @@ Object.freeze(obj); verifyEqualTo(obj, "foo2", 10); -verifyNotConfigurable(obj, "foo2"); +verifyProperty(obj, "foo2", { + configurable: false, +}); obj.foo2 = 12; if (!resultSetFun) { throw new Test262Error('Expected obj["foo2"] set() to be called, but was not.'); } -verifyEnumerable(obj, "foo2"); - -var desc1 = Object.getOwnPropertyDescriptor(obj, "foo1"); -if (desc1.configurable || desc1.writable) { - throw new Test262Error('Expected obj["foo1"] to be non-writable, non-configurable; actually ' + JSON.stringify(desc1)); -} +verifyProperty(obj, "foo2", { + enumerable: true, + configurable: false, +}); var desc2 = Object.getOwnPropertyDescriptor(obj, "foo2"); -if (desc2.configurable || desc2.writable) { +if (desc2.writable) { throw new Test262Error('Expected obj["foo2"] to be non-writable, non-configurable; actually ' + JSON.stringify(desc2)); } -verifyEqualTo(obj, "foo1", 10); - -verifyNotWritable(obj, "foo1"); - -verifyEnumerable(obj, "foo1"); - -verifyNotConfigurable(obj, "foo1"); +verifyProperty(obj, "foo1", { + value: 10, + writable: false, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/name.js b/js/src/tests/test262/built-ins/Object/freeze/name.js index 1881d15751..c9f8c5115b 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/name.js +++ b/js/src/tests/test262/built-ins/Object/freeze/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.freeze.name, "freeze"); - -verifyNotEnumerable(Object.freeze, "name"); -verifyNotWritable(Object.freeze, "name"); -verifyConfigurable(Object.freeze, "name"); +verifyProperty(Object.freeze, "name", { + value: "freeze", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/freeze/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/freeze/not-a-constructor.js index 6d928f4f11..d4f1eadcfb 100644 --- a/js/src/tests/test262/built-ins/Object/freeze/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/freeze/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Object.freeze), false, 'isConstructor(Object.free assert.throws(TypeError, () => { new Object.freeze({}); -}, '`new Object.freeze({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/fromEntries/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/fromEntries/not-a-constructor.js index d63a99663e..7c83209db1 100644 --- a/js/src/tests/test262/built-ins/Object/fromEntries/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/fromEntries/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Object.fromEntries), false, 'isConstructor(Object assert.throws(TypeError, () => { new Object.fromEntries([]); -}, '`new Object.fromEntries([])` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptor/name.js b/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptor/name.js index 8752810f81..377656f7dd 100644 --- a/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptor/name.js +++ b/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptor/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.getOwnPropertyDescriptor.name, "getOwnPropertyDescriptor"); - -verifyNotEnumerable(Object.getOwnPropertyDescriptor, "name"); -verifyNotWritable(Object.getOwnPropertyDescriptor, "name"); -verifyConfigurable(Object.getOwnPropertyDescriptor, "name"); +verifyProperty(Object.getOwnPropertyDescriptor, "name", { + value: "getOwnPropertyDescriptor", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptor/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptor/not-a-constructor.js index af851726d6..e48a450826 100644 --- a/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptor/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptor/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Object.getOwnPropertyDescriptor({}, ''); -}, '`new Object.getOwnPropertyDescriptor({}, \'\')` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptors/function-length.js b/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptors/function-length.js index 8c1746ba9c..223cd5b1b4 100644 --- a/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptors/function-length.js +++ b/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptors/function-length.js @@ -8,10 +8,11 @@ author: Jordan Harband includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.getOwnPropertyDescriptors.length, 1, 'Expected Object.getOwnPropertyDescriptors.length to be 1'); - -verifyNotEnumerable(Object.getOwnPropertyDescriptors, 'length'); -verifyNotWritable(Object.getOwnPropertyDescriptors, 'length'); -verifyConfigurable(Object.getOwnPropertyDescriptors, 'length'); +verifyProperty(Object.getOwnPropertyDescriptors, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptors/function-name.js b/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptors/function-name.js index 7037128d72..a718eb883c 100644 --- a/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptors/function-name.js +++ b/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptors/function-name.js @@ -8,14 +8,11 @@ author: Jordan Harband includes: [propertyHelper.js] ---*/ -assert.sameValue( - Object.getOwnPropertyDescriptors.name, - 'getOwnPropertyDescriptors', - 'Expected Object.getOwnPropertyDescriptors.name to be "getOwnPropertyDescriptors"' -); - -verifyNotEnumerable(Object.getOwnPropertyDescriptors, 'name'); -verifyNotWritable(Object.getOwnPropertyDescriptors, 'name'); -verifyConfigurable(Object.getOwnPropertyDescriptors, 'name'); +verifyProperty(Object.getOwnPropertyDescriptors, "name", { + value: "getOwnPropertyDescriptors", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptors/function-property-descriptor.js b/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptors/function-property-descriptor.js index 2182f1234b..1d305b6d83 100644 --- a/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptors/function-property-descriptor.js +++ b/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptors/function-property-descriptor.js @@ -8,8 +8,10 @@ author: Jordan Harband includes: [propertyHelper.js] ---*/ -verifyNotEnumerable(Object, 'getOwnPropertyDescriptors'); -verifyWritable(Object, 'getOwnPropertyDescriptors'); -verifyConfigurable(Object, 'getOwnPropertyDescriptors'); +verifyProperty(Object, "getOwnPropertyDescriptors", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptors/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptors/not-a-constructor.js index 3d03780e66..1ee9f034de 100644 --- a/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptors/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/getOwnPropertyDescriptors/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Object.getOwnPropertyDescriptors({}); -}, '`new Object.getOwnPropertyDescriptors({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/getOwnPropertyNames/name.js b/js/src/tests/test262/built-ins/Object/getOwnPropertyNames/name.js index 9ed3603700..1952cd6272 100644 --- a/js/src/tests/test262/built-ins/Object/getOwnPropertyNames/name.js +++ b/js/src/tests/test262/built-ins/Object/getOwnPropertyNames/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.getOwnPropertyNames.name, "getOwnPropertyNames"); - -verifyNotEnumerable(Object.getOwnPropertyNames, "name"); -verifyNotWritable(Object.getOwnPropertyNames, "name"); -verifyConfigurable(Object.getOwnPropertyNames, "name"); +verifyProperty(Object.getOwnPropertyNames, "name", { + value: "getOwnPropertyNames", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/getOwnPropertyNames/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/getOwnPropertyNames/not-a-constructor.js index 70a205d5a4..7a7cc7ffb3 100644 --- a/js/src/tests/test262/built-ins/Object/getOwnPropertyNames/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/getOwnPropertyNames/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Object.getOwnPropertyNames({}); -}, '`new Object.getOwnPropertyNames({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/getOwnPropertySymbols/length.js b/js/src/tests/test262/built-ins/Object/getOwnPropertySymbols/length.js index 6807e1d8dc..feb50325ca 100644 --- a/js/src/tests/test262/built-ins/Object/getOwnPropertySymbols/length.js +++ b/js/src/tests/test262/built-ins/Object/getOwnPropertySymbols/length.js @@ -22,10 +22,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.getOwnPropertySymbols.length, 1); - -verifyNotEnumerable(Object.getOwnPropertySymbols, "length"); -verifyNotWritable(Object.getOwnPropertySymbols, "length"); -verifyConfigurable(Object.getOwnPropertySymbols, "length"); +verifyProperty(Object.getOwnPropertySymbols, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/getOwnPropertySymbols/name.js b/js/src/tests/test262/built-ins/Object/getOwnPropertySymbols/name.js index 0199dbba7d..811508fbe5 100644 --- a/js/src/tests/test262/built-ins/Object/getOwnPropertySymbols/name.js +++ b/js/src/tests/test262/built-ins/Object/getOwnPropertySymbols/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.getOwnPropertySymbols.name, "getOwnPropertySymbols"); - -verifyNotEnumerable(Object.getOwnPropertySymbols, "name"); -verifyNotWritable(Object.getOwnPropertySymbols, "name"); -verifyConfigurable(Object.getOwnPropertySymbols, "name"); +verifyProperty(Object.getOwnPropertySymbols, "name", { + value: "getOwnPropertySymbols", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/getOwnPropertySymbols/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/getOwnPropertySymbols/not-a-constructor.js index c9a4d86680..1c9a660888 100644 --- a/js/src/tests/test262/built-ins/Object/getOwnPropertySymbols/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/getOwnPropertySymbols/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Object.getOwnPropertySymbols({}); -}, '`new Object.getOwnPropertySymbols({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/getPrototypeOf/name.js b/js/src/tests/test262/built-ins/Object/getPrototypeOf/name.js index ad6ed3dfd7..5760387715 100644 --- a/js/src/tests/test262/built-ins/Object/getPrototypeOf/name.js +++ b/js/src/tests/test262/built-ins/Object/getPrototypeOf/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.getPrototypeOf.name, "getPrototypeOf"); - -verifyNotEnumerable(Object.getPrototypeOf, "name"); -verifyNotWritable(Object.getPrototypeOf, "name"); -verifyConfigurable(Object.getPrototypeOf, "name"); +verifyProperty(Object.getPrototypeOf, "name", { + value: "getPrototypeOf", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/getPrototypeOf/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/getPrototypeOf/not-a-constructor.js index a40dd4beca..9bf94e49a5 100644 --- a/js/src/tests/test262/built-ins/Object/getPrototypeOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/getPrototypeOf/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Object.getPrototypeOf({}); -}, '`new Object.getPrototypeOf({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/groupBy/string.js b/js/src/tests/test262/built-ins/Object/groupBy/string.js new file mode 100644 index 0000000000..6e34359f6d --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/groupBy/string.js @@ -0,0 +1,24 @@ +// Copyright (c) 2023 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-object.groupby +description: Object.groupBy works for string items +info: | + Object.groupBy ( items, callbackfn ) + ... +includes: [compareArray.js] +features: [array-grouping] +---*/ + +const string = '🥰💩🙏😈'; + +const obj = Object.groupBy(string, function (char) { + return char < '🙏' ? 'before' : 'after'; +}); + +assert.compareArray(Object.keys(obj), ['after', 'before']); +assert.compareArray(obj.before, ['💩', '😈']); +assert.compareArray(obj.after, ['🥰', '🙏']); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/hasOwn/descriptor.js b/js/src/tests/test262/built-ins/Object/hasOwn/descriptor.js index 105e9eaa10..88feeea09a 100644 --- a/js/src/tests/test262/built-ins/Object/hasOwn/descriptor.js +++ b/js/src/tests/test262/built-ins/Object/hasOwn/descriptor.js @@ -9,8 +9,10 @@ author: Jamie Kyle features: [Object.hasOwn] ---*/ -verifyWritable(Object, "hasOwn"); -verifyNotEnumerable(Object, "hasOwn"); -verifyConfigurable(Object, "hasOwn"); +verifyProperty(Object, "hasOwn", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/hasOwn/name.js b/js/src/tests/test262/built-ins/Object/hasOwn/name.js index c8532bc559..c421cc6b2b 100644 --- a/js/src/tests/test262/built-ins/Object/hasOwn/name.js +++ b/js/src/tests/test262/built-ins/Object/hasOwn/name.js @@ -21,10 +21,11 @@ author: Jamie Kyle features: [Object.hasOwn] ---*/ -assert.sameValue(Object.hasOwn.name, "hasOwn"); - -verifyNotEnumerable(Object.hasOwn, "name"); -verifyNotWritable(Object.hasOwn, "name"); -verifyConfigurable(Object.hasOwn, "name"); +verifyProperty(Object.hasOwn, "name", { + value: "hasOwn", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/hasOwn/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/hasOwn/not-a-constructor.js index a3badb6c87..a5baf6b30d 100644 --- a/js/src/tests/test262/built-ins/Object/hasOwn/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/hasOwn/not-a-constructor.js @@ -30,6 +30,6 @@ assert.sameValue( assert.throws(TypeError, () => { new Object.hasOwn(''); -}, '`new Object.hasOwn(\'\')` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/is/length.js b/js/src/tests/test262/built-ins/Object/is/length.js index 98483984b9..9218a31356 100644 --- a/js/src/tests/test262/built-ins/Object/is/length.js +++ b/js/src/tests/test262/built-ins/Object/is/length.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.is.length, 2, "The value of `Object.is.length` is `2`"); - -verifyNotEnumerable(Object.is, "length"); -verifyNotWritable(Object.is, "length"); -verifyConfigurable(Object.is, "length"); +verifyProperty(Object.is, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/is/name.js b/js/src/tests/test262/built-ins/Object/is/name.js index f495ccbc12..d614d88d0a 100644 --- a/js/src/tests/test262/built-ins/Object/is/name.js +++ b/js/src/tests/test262/built-ins/Object/is/name.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.is.name, 'is', "The value of `Object.is.name` is `'is'`"); - -verifyNotEnumerable(Object.is, "name"); -verifyNotWritable(Object.is, "name"); -verifyConfigurable(Object.is, "name"); +verifyProperty(Object.is, "name", { + value: "is", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/is/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/is/not-a-constructor.js index 96c90fcc5d..b56849e5f1 100644 --- a/js/src/tests/test262/built-ins/Object/is/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/is/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Object.is), false, 'isConstructor(Object.is) must assert.throws(TypeError, () => { new Object.is(0, 0); -}, '`new Object.is(0, 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/is/object-is.js b/js/src/tests/test262/built-ins/Object/is/object-is.js index 22dcd083aa..0865fb21ad 100644 --- a/js/src/tests/test262/built-ins/Object/is/object-is.js +++ b/js/src/tests/test262/built-ins/Object/is/object-is.js @@ -10,12 +10,12 @@ description: > includes: [propertyHelper.js] ---*/ - assert.sameValue(typeof Object.is, "function"); -assert.sameValue(Object.is.name, "is"); -verifyWritable(Object, "is"); -verifyNotEnumerable(Object, "is"); -verifyConfigurable(Object, "is"); +verifyProperty(Object, "is", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isExtensible/name.js b/js/src/tests/test262/built-ins/Object/isExtensible/name.js index ae6a6e6549..eff74b07fa 100644 --- a/js/src/tests/test262/built-ins/Object/isExtensible/name.js +++ b/js/src/tests/test262/built-ins/Object/isExtensible/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.isExtensible.name, "isExtensible"); - -verifyNotEnumerable(Object.isExtensible, "name"); -verifyNotWritable(Object.isExtensible, "name"); -verifyConfigurable(Object.isExtensible, "name"); +verifyProperty(Object.isExtensible, "name", { + value: "isExtensible", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isExtensible/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/isExtensible/not-a-constructor.js index 56ab6d19e3..b314e5250c 100644 --- a/js/src/tests/test262/built-ins/Object/isExtensible/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/isExtensible/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Object.isExtensible), false, 'isConstructor(Objec assert.throws(TypeError, () => { new Object.isExtensible({}); -}, '`new Object.isExtensible({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/name.js b/js/src/tests/test262/built-ins/Object/isFrozen/name.js index 4b83c75722..d769d8939d 100644 --- a/js/src/tests/test262/built-ins/Object/isFrozen/name.js +++ b/js/src/tests/test262/built-ins/Object/isFrozen/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.isFrozen.name, "isFrozen"); - -verifyNotEnumerable(Object.isFrozen, "name"); -verifyNotWritable(Object.isFrozen, "name"); -verifyConfigurable(Object.isFrozen, "name"); +verifyProperty(Object.isFrozen, "name", { + value: "isFrozen", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isFrozen/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/isFrozen/not-a-constructor.js index 5f8014985b..cc42d1d9e8 100644 --- a/js/src/tests/test262/built-ins/Object/isFrozen/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/isFrozen/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Object.isFrozen), false, 'isConstructor(Object.is assert.throws(TypeError, () => { new Object.isFrozen({}); -}, '`new Object.isFrozen({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isSealed/name.js b/js/src/tests/test262/built-ins/Object/isSealed/name.js index c11f5b4842..54620f96f1 100644 --- a/js/src/tests/test262/built-ins/Object/isSealed/name.js +++ b/js/src/tests/test262/built-ins/Object/isSealed/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.isSealed.name, "isSealed"); - -verifyNotEnumerable(Object.isSealed, "name"); -verifyNotWritable(Object.isSealed, "name"); -verifyConfigurable(Object.isSealed, "name"); +verifyProperty(Object.isSealed, "name", { + value: "isSealed", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/isSealed/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/isSealed/not-a-constructor.js index a02bf5f415..ed39336fd1 100644 --- a/js/src/tests/test262/built-ins/Object/isSealed/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/isSealed/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Object.isSealed), false, 'isConstructor(Object.is assert.throws(TypeError, () => { new Object.isSealed({}); -}, '`new Object.isSealed({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/keys/name.js b/js/src/tests/test262/built-ins/Object/keys/name.js index 4839cf4031..413d847fc8 100644 --- a/js/src/tests/test262/built-ins/Object/keys/name.js +++ b/js/src/tests/test262/built-ins/Object/keys/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.keys.name, "keys"); - -verifyNotEnumerable(Object.keys, "name"); -verifyNotWritable(Object.keys, "name"); -verifyConfigurable(Object.keys, "name"); +verifyProperty(Object.keys, "name", { + value: "keys", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/keys/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/keys/not-a-constructor.js index dc5c3083f2..4dbfa236f6 100644 --- a/js/src/tests/test262/built-ins/Object/keys/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/keys/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Object.keys), false, 'isConstructor(Object.keys) assert.throws(TypeError, () => { new Object.keys({}); -}, '`new Object.keys({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/preventExtensions/name.js b/js/src/tests/test262/built-ins/Object/preventExtensions/name.js index 09e9f7130d..b42ad2df39 100644 --- a/js/src/tests/test262/built-ins/Object/preventExtensions/name.js +++ b/js/src/tests/test262/built-ins/Object/preventExtensions/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.preventExtensions.name, "preventExtensions"); - -verifyNotEnumerable(Object.preventExtensions, "name"); -verifyNotWritable(Object.preventExtensions, "name"); -verifyConfigurable(Object.preventExtensions, "name"); +verifyProperty(Object.preventExtensions, "name", { + value: "preventExtensions", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/preventExtensions/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/preventExtensions/not-a-constructor.js index dac8c6ee18..1b8b5fb864 100644 --- a/js/src/tests/test262/built-ins/Object/preventExtensions/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/preventExtensions/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Object.preventExtensions({}); -}, '`new Object.preventExtensions({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prop-desc.js b/js/src/tests/test262/built-ins/Object/prop-desc.js index 64e7a8969a..512b652cbb 100644 --- a/js/src/tests/test262/built-ins/Object/prop-desc.js +++ b/js/src/tests/test262/built-ins/Object/prop-desc.js @@ -11,8 +11,10 @@ info: | includes: [propertyHelper.js] ---*/ -verifyNotEnumerable(this, "Object"); -verifyWritable(this, "Object"); -verifyConfigurable(this, "Object"); +verifyProperty(this, "Object", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/name.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/name.js index ae01259e26..35d0280902 100644 --- a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/name.js +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.prototype.hasOwnProperty.name, "hasOwnProperty"); - -verifyNotEnumerable(Object.prototype.hasOwnProperty, "name"); -verifyNotWritable(Object.prototype.hasOwnProperty, "name"); -verifyConfigurable(Object.prototype.hasOwnProperty, "name"); +verifyProperty(Object.prototype.hasOwnProperty, "name", { + value: "hasOwnProperty", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/not-a-constructor.js index 07d38e779c..33f4aca473 100644 --- a/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/prototype/hasOwnProperty/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Object.prototype.hasOwnProperty(''); -}, '`new Object.prototype.hasOwnProperty(\'\')` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/isPrototypeOf/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/prototype/isPrototypeOf/not-a-constructor.js index 9de714cba9..e8324db0be 100644 --- a/js/src/tests/test262/built-ins/Object/prototype/isPrototypeOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/prototype/isPrototypeOf/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Object.prototype.isPrototypeOf({}); -}, '`new Object.prototype.isPrototypeOf({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/propertyIsEnumerable/name.js b/js/src/tests/test262/built-ins/Object/prototype/propertyIsEnumerable/name.js index 9054d1f7a5..b6638e42e3 100644 --- a/js/src/tests/test262/built-ins/Object/prototype/propertyIsEnumerable/name.js +++ b/js/src/tests/test262/built-ins/Object/prototype/propertyIsEnumerable/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.prototype.propertyIsEnumerable.name, "propertyIsEnumerable"); - -verifyNotEnumerable(Object.prototype.propertyIsEnumerable, "name"); -verifyNotWritable(Object.prototype.propertyIsEnumerable, "name"); -verifyConfigurable(Object.prototype.propertyIsEnumerable, "name"); +verifyProperty(Object.prototype.propertyIsEnumerable, "name", { + value: "propertyIsEnumerable", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/propertyIsEnumerable/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/prototype/propertyIsEnumerable/not-a-constructor.js index e8bdaf469e..71cb963283 100644 --- a/js/src/tests/test262/built-ins/Object/prototype/propertyIsEnumerable/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/prototype/propertyIsEnumerable/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Object.prototype.propertyIsEnumerable(''); -}, '`new Object.prototype.propertyIsEnumerable(\'\')` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/toLocaleString/name.js b/js/src/tests/test262/built-ins/Object/prototype/toLocaleString/name.js index 5f258165ba..835f5a488b 100644 --- a/js/src/tests/test262/built-ins/Object/prototype/toLocaleString/name.js +++ b/js/src/tests/test262/built-ins/Object/prototype/toLocaleString/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.prototype.toLocaleString.name, "toLocaleString"); - -verifyNotEnumerable(Object.prototype.toLocaleString, "name"); -verifyNotWritable(Object.prototype.toLocaleString, "name"); -verifyConfigurable(Object.prototype.toLocaleString, "name"); +verifyProperty(Object.prototype.toLocaleString, "name", { + value: "toLocaleString", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/toLocaleString/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/prototype/toLocaleString/not-a-constructor.js index 49fc0525db..ed9b6d87dc 100644 --- a/js/src/tests/test262/built-ins/Object/prototype/toLocaleString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/prototype/toLocaleString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Object.prototype.toLocaleString(''); -}, '`new Object.prototype.toLocaleString(\'\')` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/toString/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/prototype/toString/not-a-constructor.js index 54f974d24f..ca2f1b3d64 100644 --- a/js/src/tests/test262/built-ins/Object/prototype/toString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/prototype/toString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Object.prototype.toString(); -}, '`new Object.prototype.toString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/toString/prop-desc.js b/js/src/tests/test262/built-ins/Object/prototype/toString/prop-desc.js index 7d3ac0d66b..6ce7d132aa 100644 --- a/js/src/tests/test262/built-ins/Object/prototype/toString/prop-desc.js +++ b/js/src/tests/test262/built-ins/Object/prototype/toString/prop-desc.js @@ -16,8 +16,10 @@ info: | includes: [propertyHelper.js] ---*/ -verifyWritable(Object.prototype, "toString"); -verifyNotEnumerable(Object.prototype, "toString"); -verifyConfigurable(Object.prototype, "toString"); +verifyProperty(Object.prototype, "toString", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/valueOf/name.js b/js/src/tests/test262/built-ins/Object/prototype/valueOf/name.js index 7648b4002d..08140e27d9 100644 --- a/js/src/tests/test262/built-ins/Object/prototype/valueOf/name.js +++ b/js/src/tests/test262/built-ins/Object/prototype/valueOf/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.prototype.valueOf.name, "valueOf"); - -verifyNotEnumerable(Object.prototype.valueOf, "name"); -verifyNotWritable(Object.prototype.valueOf, "name"); -verifyConfigurable(Object.prototype.valueOf, "name"); +verifyProperty(Object.prototype.valueOf, "name", { + value: "valueOf", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/prototype/valueOf/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/prototype/valueOf/not-a-constructor.js index 6db8b1c516..1aaca96dc8 100644 --- a/js/src/tests/test262/built-ins/Object/prototype/valueOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/prototype/valueOf/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Object.prototype.valueOf(); -}, '`new Object.prototype.valueOf()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/configurable-attribute-all-own-properties-set-from-true-to-false-property-are-unaltered.js b/js/src/tests/test262/built-ins/Object/seal/configurable-attribute-all-own-properties-set-from-true-to-false-property-are-unaltered.js index 4b337ca128..2d8f782d8d 100644 --- a/js/src/tests/test262/built-ins/Object/seal/configurable-attribute-all-own-properties-set-from-true-to-false-property-are-unaltered.js +++ b/js/src/tests/test262/built-ins/Object/seal/configurable-attribute-all-own-properties-set-from-true-to-false-property-are-unaltered.js @@ -40,21 +40,20 @@ if (!preCheck) { throw new Test262Error('Expected preCheck to be true, actually ' + preCheck); } - -verifyEqualTo(obj, "foo1", 10); - -verifyWritable(obj, "foo1"); - -verifyEnumerable(obj, "foo1"); - -verifyNotConfigurable(obj, "foo1"); +verifyProperty(obj, "foo1", { + value: 10, + writable: true, + enumerable: true, + configurable: false, +}); verifyEqualTo(obj, "foo2", get_func()); verifyWritable(obj, "foo2", "variableForHelpVerify"); -verifyEnumerable(obj, "foo2"); - -verifyNotConfigurable(obj, "foo2"); +verifyProperty(obj, "foo2", { + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/configurable-attribute-own-accessor-property-set-from-true-to-false-property-are-unaltered.js b/js/src/tests/test262/built-ins/Object/seal/configurable-attribute-own-accessor-property-set-from-true-to-false-property-are-unaltered.js index 5c28cf68a4..fa49cab540 100644 --- a/js/src/tests/test262/built-ins/Object/seal/configurable-attribute-own-accessor-property-set-from-true-to-false-property-are-unaltered.js +++ b/js/src/tests/test262/built-ins/Object/seal/configurable-attribute-own-accessor-property-set-from-true-to-false-property-are-unaltered.js @@ -37,8 +37,9 @@ verifyEqualTo(obj, "foo", getFunc()); verifyWritable(obj, "foo", "variableForHelpVerify"); -verifyEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/length.js b/js/src/tests/test262/built-ins/Object/seal/length.js index 114de5fd88..515d284d28 100644 --- a/js/src/tests/test262/built-ins/Object/seal/length.js +++ b/js/src/tests/test262/built-ins/Object/seal/length.js @@ -14,10 +14,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.seal.length, 1); - -verifyNotEnumerable(Object.seal, "length"); -verifyNotWritable(Object.seal, "length"); -verifyConfigurable(Object.seal, "length"); +verifyProperty(Object.seal, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/name.js b/js/src/tests/test262/built-ins/Object/seal/name.js index 3b7047d2c1..eb76408886 100644 --- a/js/src/tests/test262/built-ins/Object/seal/name.js +++ b/js/src/tests/test262/built-ins/Object/seal/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.seal.name, "seal"); - -verifyNotEnumerable(Object.seal, "name"); -verifyNotWritable(Object.seal, "name"); -verifyConfigurable(Object.seal, "name"); +verifyProperty(Object.seal, "name", { + value: "seal", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/seal/not-a-constructor.js index 97ade868fe..8ea819dbd5 100644 --- a/js/src/tests/test262/built-ins/Object/seal/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/seal/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Object.seal), false, 'isConstructor(Object.seal) assert.throws(TypeError, () => { new Object.seal(); -}, '`new Object.seal()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-all-own-properties-of-o-are-already-non-configurable.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-all-own-properties-of-o-are-already-non-configurable.js index 563b4d318e..65276afb2b 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-all-own-properties-of-o-are-already-non-configurable.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-all-own-properties-of-o-are-already-non-configurable.js @@ -43,19 +43,20 @@ if (Object.isExtensible(obj)) { throw new Test262Error('Expected obj NOT to be extensible, actually ' + Object.isExtensible(obj)); } -verifyEqualTo(obj, "foo1", 10); - -verifyWritable(obj, "foo1"); - -verifyEnumerable(obj, "foo1"); +verifyProperty(obj, "foo1", { + value: 10, + writable: true, + enumerable: true, + configurable: false, +}); -verifyNotConfigurable(obj, "foo1"); verifyEqualTo(obj, "foo2", get_func()); verifyWritable(obj, "foo2", "variableForHelpVerify"); -verifyEnumerable(obj, "foo2"); - -verifyNotConfigurable(obj, "foo2"); +verifyProperty(obj, "foo2", { + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-configurable-attribute-of-own-data-property-of-o-is-set-from-true-to-false-and-other-attributes-of-the-property-are-unaltered.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-configurable-attribute-of-own-data-property-of-o-is-set-from-true-to-false-and-other-attributes-of-the-property-are-unaltered.js index 0d59c51bca..3ab85abfc6 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-configurable-attribute-of-own-data-property-of-o-is-set-from-true-to-false-and-other-attributes-of-the-property-are-unaltered.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-configurable-attribute-of-own-data-property-of-o-is-set-from-true-to-false-and-other-attributes-of-the-property-are-unaltered.js @@ -25,12 +25,11 @@ if (!preCheck) { throw new Test262Error('Expected preCheck to be true, actually ' + preCheck); } -verifyEqualTo(obj, "foo", 10); - -verifyWritable(obj, "foo"); - -verifyEnumerable(obj, "foo"); - -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + value: 10, + writable: true, + enumerable: true, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-non-enumerable-own-property-of-o-is-sealed.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-non-enumerable-own-property-of-o-is-sealed.js index 02501ec379..ef2a857c7a 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-non-enumerable-own-property-of-o-is-sealed.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-non-enumerable-own-property-of-o-is-sealed.js @@ -18,7 +18,8 @@ Object.defineProperty(obj, "foo", { assert(Object.isExtensible(obj)); Object.seal(obj); -assert(obj.hasOwnProperty("foo")); -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-accessor-property-that-overrides-an-inherited-accessor-property.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-accessor-property-that-overrides-an-inherited-accessor-property.js index 7f5c68979e..7aea052abe 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-accessor-property-that-overrides-an-inherited-accessor-property.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-accessor-property-that-overrides-an-inherited-accessor-property.js @@ -33,7 +33,10 @@ Object.defineProperty(obj, "foo", { assert(Object.isExtensible(obj)); Object.seal(obj); -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + configurable: false, +}); + assert.sameValue(obj.foo, 10); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-accessor-property-that-overrides-an-inherited-data-property.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-accessor-property-that-overrides-an-inherited-data-property.js index e3a3707431..f155e7975f 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-accessor-property-that-overrides-an-inherited-data-property.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-accessor-property-that-overrides-an-inherited-data-property.js @@ -31,7 +31,10 @@ Object.defineProperty(obj, "foo", { assert(Object.isExtensible(obj)); Object.seal(obj); -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + configurable: false, +}); + assert.sameValue(obj.foo, 10); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-accessor-property.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-accessor-property.js index 3704d492ba..43b4e402d1 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-accessor-property.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-accessor-property.js @@ -19,7 +19,10 @@ Object.defineProperty(obj, "foo", { assert(Object.isExtensible(obj)); Object.seal(obj); -verifyNotConfigurable(obj, "foo"); +verifyProperty(obj, "foo", { + configurable: false, +}); + assert.sameValue(obj.foo, 10); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-data-property-that-overrides-an-inherited-accessor-property.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-data-property-that-overrides-an-inherited-accessor-property.js index e146af8558..32125f67c4 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-data-property-that-overrides-an-inherited-accessor-property.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-data-property-that-overrides-an-inherited-accessor-property.js @@ -30,7 +30,9 @@ Object.defineProperty(obj, "foo", { assert(Object.isExtensible(obj)); Object.seal(obj); -verifyNotConfigurable(obj, "foo"); -assert.sameValue(obj.foo, 10); +verifyProperty(obj, "foo", { + value: 10, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-data-property-that-overrides-an-inherited-data-property.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-data-property-that-overrides-an-inherited-data-property.js index e62e3fb902..10127134e7 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-data-property-that-overrides-an-inherited-data-property.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-data-property-that-overrides-an-inherited-data-property.js @@ -25,7 +25,9 @@ Object.defineProperty(obj, "foo", { assert(Object.isExtensible(obj)); Object.seal(obj); -verifyNotConfigurable(obj, "foo"); -assert.sameValue(obj.foo, 10); +verifyProperty(obj, "foo", { + value: 10, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-data-property.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-data-property.js index d19e947979..953710ace7 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-data-property.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-data-property.js @@ -14,7 +14,9 @@ obj.foo = 10; // default [[Configurable]] attribute value of foo: true assert(Object.isExtensible(obj)); Object.seal(obj); -verifyNotConfigurable(obj, "foo"); -assert.sameValue(obj.foo, 10); +verifyProperty(obj, "foo", { + value: 10, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-boolean-object-that-uses-object-s-get-own-property.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-boolean-object-that-uses-object-s-get-own-property.js index 20d4898020..5a2c970b25 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-boolean-object-that-uses-object-s-get-own-property.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-boolean-object-that-uses-object-s-get-own-property.js @@ -16,7 +16,9 @@ obj.foo = 10; assert(Object.isExtensible(obj)); Object.seal(obj); -verifyNotConfigurable(obj, "foo"); -assert.sameValue(obj.foo, 10); +verifyProperty(obj, "foo", { + value: 10, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-date-object-that-uses-object-s-get-own-property.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-date-object-that-uses-object-s-get-own-property.js index 2517e70bc0..77a161b71e 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-date-object-that-uses-object-s-get-own-property.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-date-object-that-uses-object-s-get-own-property.js @@ -16,7 +16,9 @@ obj.foo = 10; assert(Object.isExtensible(obj)); Object.seal(obj); -verifyNotConfigurable(obj, "foo"); -assert.sameValue(obj.foo, 10); +verifyProperty(obj, "foo", { + value: 10, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-function-object-that-uses-object-s-get-own-property.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-function-object-that-uses-object-s-get-own-property.js index 18c786075d..db8ba4f6d3 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-function-object-that-uses-object-s-get-own-property.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-function-object-that-uses-object-s-get-own-property.js @@ -16,7 +16,9 @@ obj.foo = 10; assert(Object.isExtensible(obj)); Object.seal(obj); -verifyNotConfigurable(obj, "foo"); -assert.sameValue(obj.foo, 10); +verifyProperty(obj, "foo", { + value: 10, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-number-object-that-uses-object-s-get-own-property.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-number-object-that-uses-object-s-get-own-property.js index 9db2104ff6..d577097702 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-number-object-that-uses-object-s-get-own-property.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-number-object-that-uses-object-s-get-own-property.js @@ -16,7 +16,9 @@ obj.foo = 10; assert(Object.isExtensible(obj)); Object.seal(obj); -verifyNotConfigurable(obj, "foo"); -assert.sameValue(obj.foo, 10); +verifyProperty(obj, "foo", { + value: 10, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-reg-exp-object-that-uses-object-s-get-own-property.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-reg-exp-object-that-uses-object-s-get-own-property.js index 839ce7dd37..7fefac239a 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-reg-exp-object-that-uses-object-s-get-own-property.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-reg-exp-object-that-uses-object-s-get-own-property.js @@ -16,7 +16,9 @@ obj.foo = 10; assert(Object.isExtensible(obj)); Object.seal(obj); -verifyNotConfigurable(obj, "foo"); -assert.sameValue(obj.foo, 10); +verifyProperty(obj, "foo", { + value: 10, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-string-object-which-implements-its-own-get-own-property.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-string-object-which-implements-its-own-get-own-property.js index 7561754fd0..a3badbcd63 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-string-object-which-implements-its-own-get-own-property.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-a-string-object-which-implements-its-own-get-own-property.js @@ -16,7 +16,9 @@ obj.foo = 10; assert(Object.isExtensible(obj)); Object.seal(obj); -verifyNotConfigurable(obj, "foo"); -assert.sameValue(obj.foo, 10); +verifyProperty(obj, "foo", { + value: 10, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-an-arguments-object-which-implements-its-own-get-own-property.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-an-arguments-object-which-implements-its-own-get-own-property.js index 39853c155f..0b9a0ddc9c 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-an-arguments-object-which-implements-its-own-get-own-property.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-an-arguments-object-which-implements-its-own-get-own-property.js @@ -18,7 +18,9 @@ obj.foo = 10; assert(Object.isExtensible(obj)); Object.seal(obj); -verifyNotConfigurable(obj, "foo"); -assert.sameValue(obj.foo, 10); +verifyProperty(obj, "foo", { + value: 10, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-an-array-object-that-uses-object-s-get-own-property.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-an-array-object-that-uses-object-s-get-own-property.js index 26e19643df..8c7c2fd0fb 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-an-array-object-that-uses-object-s-get-own-property.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-an-array-object-that-uses-object-s-get-own-property.js @@ -16,7 +16,9 @@ obj.foo = 10; assert(Object.isExtensible(obj)); Object.seal(obj); -verifyNotConfigurable(obj, "foo"); -assert.sameValue(obj.foo, 10); +verifyProperty(obj, "foo", { + value: 10, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-an-error-object-that-uses-object-s-get-own-property.js b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-an-error-object-that-uses-object-s-get-own-property.js index 045b2c0248..7989899aa8 100644 --- a/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-an-error-object-that-uses-object-s-get-own-property.js +++ b/js/src/tests/test262/built-ins/Object/seal/object-seal-p-is-own-property-of-an-error-object-that-uses-object-s-get-own-property.js @@ -16,7 +16,9 @@ obj.foo = 10; assert(Object.isExtensible(obj)); Object.seal(obj); -verifyNotConfigurable(obj, "foo"); -assert.sameValue(obj.foo, 10); +verifyProperty(obj, "foo", { + value: 10, + configurable: false, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/setPrototypeOf/length.js b/js/src/tests/test262/built-ins/Object/setPrototypeOf/length.js index f2f8d611b9..7640d3f587 100644 --- a/js/src/tests/test262/built-ins/Object/setPrototypeOf/length.js +++ b/js/src/tests/test262/built-ins/Object/setPrototypeOf/length.js @@ -18,14 +18,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Object.setPrototypeOf.length, - 2, - 'The value of `Object.setPrototypeOf.length` is `2`' -); - -verifyNotEnumerable(Object.setPrototypeOf, 'length'); -verifyNotWritable(Object.setPrototypeOf, 'length'); -verifyConfigurable(Object.setPrototypeOf, 'length'); +verifyProperty(Object.setPrototypeOf, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/setPrototypeOf/name.js b/js/src/tests/test262/built-ins/Object/setPrototypeOf/name.js index 1c9ab55a58..e5a46daee0 100644 --- a/js/src/tests/test262/built-ins/Object/setPrototypeOf/name.js +++ b/js/src/tests/test262/built-ins/Object/setPrototypeOf/name.js @@ -19,14 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - Object.setPrototypeOf.name, - 'setPrototypeOf', - 'The value of `Object.setPrototypeOf.name` is `"setPrototypeOf"`' -); - -verifyNotEnumerable(Object.setPrototypeOf, 'name'); -verifyNotWritable(Object.setPrototypeOf, 'name'); -verifyConfigurable(Object.setPrototypeOf, 'name'); +verifyProperty(Object.setPrototypeOf, "name", { + value: "setPrototypeOf", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/setPrototypeOf/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/setPrototypeOf/not-a-constructor.js index 625f438f4a..da7d13cba6 100644 --- a/js/src/tests/test262/built-ins/Object/setPrototypeOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/setPrototypeOf/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Object.setPrototypeOf({}, {}); -}, '`new Object.setPrototypeOf({}, {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/setPrototypeOf/property-descriptor.js b/js/src/tests/test262/built-ins/Object/setPrototypeOf/property-descriptor.js index 946db0ad9c..9c04d4c683 100644 --- a/js/src/tests/test262/built-ins/Object/setPrototypeOf/property-descriptor.js +++ b/js/src/tests/test262/built-ins/Object/setPrototypeOf/property-descriptor.js @@ -12,8 +12,10 @@ includes: [propertyHelper.js] assert.sameValue(typeof Object.setPrototypeOf, 'function'); -verifyNotEnumerable(Object, 'setPrototypeOf'); -verifyWritable(Object, 'setPrototypeOf'); -verifyConfigurable(Object, 'setPrototypeOf'); +verifyProperty(Object, "setPrototypeOf", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/values/function-length.js b/js/src/tests/test262/built-ins/Object/values/function-length.js index bb3ede0e3c..93d6a66639 100644 --- a/js/src/tests/test262/built-ins/Object/values/function-length.js +++ b/js/src/tests/test262/built-ins/Object/values/function-length.js @@ -8,10 +8,11 @@ author: Jordan Harband includes: [propertyHelper.js] ---*/ -assert.sameValue(Object.values.length, 1, 'Expected Object.values.length to be 1'); - -verifyNotEnumerable(Object.values, 'length'); -verifyNotWritable(Object.values, 'length'); -verifyConfigurable(Object.values, 'length'); +verifyProperty(Object.values, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/values/function-name.js b/js/src/tests/test262/built-ins/Object/values/function-name.js index 6535fd2db4..a008546f02 100644 --- a/js/src/tests/test262/built-ins/Object/values/function-name.js +++ b/js/src/tests/test262/built-ins/Object/values/function-name.js @@ -8,14 +8,11 @@ author: Jordan Harband includes: [propertyHelper.js] ---*/ -assert.sameValue( - Object.values.name, - 'values', - 'Expected Object.values.name to be "values"' -); - -verifyNotEnumerable(Object.values, 'name'); -verifyNotWritable(Object.values, 'name'); -verifyConfigurable(Object.values, 'name'); +verifyProperty(Object.values, "name", { + value: "values", + writable: false, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/values/function-property-descriptor.js b/js/src/tests/test262/built-ins/Object/values/function-property-descriptor.js index ebd062c347..fb6a12c5b9 100644 --- a/js/src/tests/test262/built-ins/Object/values/function-property-descriptor.js +++ b/js/src/tests/test262/built-ins/Object/values/function-property-descriptor.js @@ -8,8 +8,10 @@ author: Jordan Harband includes: [propertyHelper.js] ---*/ -verifyNotEnumerable(Object, 'values'); -verifyWritable(Object, 'values'); -verifyConfigurable(Object, 'values'); +verifyProperty(Object, "values", { + writable: true, + enumerable: false, + configurable: true, +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Object/values/not-a-constructor.js b/js/src/tests/test262/built-ins/Object/values/not-a-constructor.js index 632d285a49..5c647f604f 100644 --- a/js/src/tests/test262/built-ins/Object/values/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Object/values/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Object.values), false, 'isConstructor(Object.valu assert.throws(TypeError, () => { new Object.values({}); -}, '`new Object.values({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/Symbol.species/length.js b/js/src/tests/test262/built-ins/Promise/Symbol.species/length.js index a2556d0a44..72a2e3ce6c 100644 --- a/js/src/tests/test262/built-ins/Promise/Symbol.species/length.js +++ b/js/src/tests/test262/built-ins/Promise/Symbol.species/length.js @@ -25,10 +25,11 @@ features: [Symbol.species] var desc = Object.getOwnPropertyDescriptor(Promise, 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/Promise/all/length.js b/js/src/tests/test262/built-ins/Promise/all/length.js index 7769497c7c..38e64b125d 100644 --- a/js/src/tests/test262/built-ins/Promise/all/length.js +++ b/js/src/tests/test262/built-ins/Promise/all/length.js @@ -18,10 +18,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Promise.all.length, 1); - -verifyNotEnumerable(Promise.all, 'length'); -verifyNotWritable(Promise.all, 'length'); -verifyConfigurable(Promise.all, 'length'); +verifyProperty(Promise.all, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/all/name.js b/js/src/tests/test262/built-ins/Promise/all/name.js index 552ba841dd..7a6ddaa9a4 100644 --- a/js/src/tests/test262/built-ins/Promise/all/name.js +++ b/js/src/tests/test262/built-ins/Promise/all/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Promise.all.name, 'all'); - -verifyNotEnumerable(Promise.all, 'name'); -verifyNotWritable(Promise.all, 'name'); -verifyConfigurable(Promise.all, 'name'); +verifyProperty(Promise.all, "name", { + value: "all", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/all/not-a-constructor.js b/js/src/tests/test262/built-ins/Promise/all/not-a-constructor.js index 9ab0f8e49e..b7c377d84f 100644 --- a/js/src/tests/test262/built-ins/Promise/all/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Promise/all/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Promise.all), false, 'isConstructor(Promise.all) assert.throws(TypeError, () => { new Promise.all([]); -}, '`new Promise.all([])` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/all/resolve-element-function-length.js b/js/src/tests/test262/built-ins/Promise/all/resolve-element-function-length.js index 6a3568870b..4f3f963e28 100644 --- a/js/src/tests/test262/built-ins/Promise/all/resolve-element-function-length.js +++ b/js/src/tests/test262/built-ins/Promise/all/resolve-element-function-length.js @@ -29,10 +29,11 @@ NotPromise.resolve = function(v) { }; Promise.all.call(NotPromise, [thenable]); -assert.sameValue(resolveElementFunction.length, 1); - -verifyNotEnumerable(resolveElementFunction, "length"); -verifyNotWritable(resolveElementFunction, "length"); -verifyConfigurable(resolveElementFunction, "length"); +verifyProperty(resolveElementFunction, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/allSettled/not-a-constructor.js b/js/src/tests/test262/built-ins/Promise/allSettled/not-a-constructor.js index 98dc3d6401..4da60aa86b 100644 --- a/js/src/tests/test262/built-ins/Promise/allSettled/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Promise/allSettled/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Promise.allSettled), false, 'isConstructor(Promis assert.throws(TypeError, () => { new Promise.allSettled(); -}, '`new Promise.allSettled()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/any/not-a-constructor.js b/js/src/tests/test262/built-ins/Promise/any/not-a-constructor.js index 94e37ef3ba..3acdd7ee0c 100644 --- a/js/src/tests/test262/built-ins/Promise/any/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Promise/any/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Promise.any), false, 'isConstructor(Promise.any) assert.throws(TypeError, () => { new Promise.any([1]); -}, '`new Promise.any([1])` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/create-resolving-functions-reject.js b/js/src/tests/test262/built-ins/Promise/create-resolving-functions-reject.js index 05297b7993..294b48491a 100644 --- a/js/src/tests/test262/built-ins/Promise/create-resolving-functions-reject.js +++ b/js/src/tests/test262/built-ins/Promise/create-resolving-functions-reject.js @@ -24,7 +24,7 @@ Promise.prototype.then = function(resolve, reject) { assert.sameValue(isConstructor(reject), false, 'isConstructor(reject) must return false'); assert.throws(TypeError, () => { new reject(); - }, '`new reject()` throws TypeError'); + }); assert.sameValue(reject.length, 1, 'The value of reject.length is 1'); assert.sameValue(reject.name, '', 'The value of reject.name is ""'); diff --git a/js/src/tests/test262/built-ins/Promise/create-resolving-functions-resolve.js b/js/src/tests/test262/built-ins/Promise/create-resolving-functions-resolve.js index c2c4dc60d2..4460e28fcf 100644 --- a/js/src/tests/test262/built-ins/Promise/create-resolving-functions-resolve.js +++ b/js/src/tests/test262/built-ins/Promise/create-resolving-functions-resolve.js @@ -24,7 +24,7 @@ Promise.prototype.then = function(resolve, reject) { assert.sameValue(isConstructor(resolve), false, 'isConstructor(resolve) must return false'); assert.throws(TypeError, () => { new resolve(); - }, '`new resolve()` throws TypeError'); + }); assert.sameValue(resolve.length, 1, 'The value of resolve.length is 1'); assert.sameValue(resolve.name, '', 'The value of resolve.name is ""'); diff --git a/js/src/tests/test262/built-ins/Promise/executor-function-length.js b/js/src/tests/test262/built-ins/Promise/executor-function-length.js index 1aa7f25e45..9867fb08b0 100644 --- a/js/src/tests/test262/built-ins/Promise/executor-function-length.js +++ b/js/src/tests/test262/built-ins/Promise/executor-function-length.js @@ -22,10 +22,11 @@ function NotPromise(executor) { } Promise.resolve.call(NotPromise); -assert.sameValue(executorFunction.length, 2); - -verifyNotEnumerable(executorFunction, "length"); -verifyNotWritable(executorFunction, "length"); -verifyConfigurable(executorFunction, "length"); +verifyProperty(executorFunction, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/executor-function-not-a-constructor.js b/js/src/tests/test262/built-ins/Promise/executor-function-not-a-constructor.js index 5e1f360112..a4002a6ee1 100644 --- a/js/src/tests/test262/built-ins/Promise/executor-function-not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Promise/executor-function-not-a-constructor.js @@ -30,7 +30,7 @@ assert.sameValue(isConstructor(executorFunction), false, 'isConstructor(executor assert.throws(TypeError, () => { new executorFunction(); -}, '`new executorFunction()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/length.js b/js/src/tests/test262/built-ins/Promise/length.js index 52923a039c..2173d41d91 100644 --- a/js/src/tests/test262/built-ins/Promise/length.js +++ b/js/src/tests/test262/built-ins/Promise/length.js @@ -18,10 +18,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Promise.length, 1); - -verifyNotEnumerable(Promise, 'length'); -verifyNotWritable(Promise, 'length'); -verifyConfigurable(Promise, 'length'); +verifyProperty(Promise, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/name.js b/js/src/tests/test262/built-ins/Promise/name.js index 715bc448f2..1b52152e54 100644 --- a/js/src/tests/test262/built-ins/Promise/name.js +++ b/js/src/tests/test262/built-ins/Promise/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Promise.name, 'Promise'); - -verifyNotEnumerable(Promise, 'name'); -verifyNotWritable(Promise, 'name'); -verifyConfigurable(Promise, 'name'); +verifyProperty(Promise, "name", { + value: "Promise", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/prototype/catch/length.js b/js/src/tests/test262/built-ins/Promise/prototype/catch/length.js index 1b487e62d9..aa4a89d144 100644 --- a/js/src/tests/test262/built-ins/Promise/prototype/catch/length.js +++ b/js/src/tests/test262/built-ins/Promise/prototype/catch/length.js @@ -18,10 +18,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Promise.prototype.catch.length, 1); - -verifyNotEnumerable(Promise.prototype.catch, 'length'); -verifyNotWritable(Promise.prototype.catch, 'length'); -verifyConfigurable(Promise.prototype.catch, 'length'); +verifyProperty(Promise.prototype.catch, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/prototype/catch/name.js b/js/src/tests/test262/built-ins/Promise/prototype/catch/name.js index 25a93a3bb9..4df2947d2d 100644 --- a/js/src/tests/test262/built-ins/Promise/prototype/catch/name.js +++ b/js/src/tests/test262/built-ins/Promise/prototype/catch/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Promise.prototype.catch.name, 'catch'); - -verifyNotEnumerable(Promise.prototype.catch, 'name'); -verifyNotWritable(Promise.prototype.catch, 'name'); -verifyConfigurable(Promise.prototype.catch, 'name'); +verifyProperty(Promise.prototype.catch, "name", { + value: "catch", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/prototype/catch/not-a-constructor.js b/js/src/tests/test262/built-ins/Promise/prototype/catch/not-a-constructor.js index 2ff5558742..3afa8a1021 100644 --- a/js/src/tests/test262/built-ins/Promise/prototype/catch/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Promise/prototype/catch/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let p = new Promise(() => {}); new p.catch(); -}, '`let p = new Promise(() => {}); new p.catch()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/prototype/finally/invokes-then-with-function.js b/js/src/tests/test262/built-ins/Promise/prototype/finally/invokes-then-with-function.js index c4597f9cb8..033051d03c 100644 --- a/js/src/tests/test262/built-ins/Promise/prototype/finally/invokes-then-with-function.js +++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/invokes-then-with-function.js @@ -48,7 +48,7 @@ assert.sameValue(resolve.name, '', 'The value of resolve.name is ""'); assert.sameValue(isConstructor(resolve), false, 'isConstructor(resolve) must return false'); assert.throws(TypeError, () => { new resolve(); -}, '`new resolve()` throws TypeError'); +}); assert.sameValue( @@ -62,7 +62,7 @@ assert.sameValue(reject.name, '', 'The value of reject.name is ""'); assert.sameValue(isConstructor(reject), false, 'isConstructor(reject) must return false'); assert.throws(TypeError, () => { new reject(); -}, '`new reject()` throws TypeError'); +}); assert.sameValue(result, returnValue, 'The value of `result` is expected to equal the value of returnValue'); diff --git a/js/src/tests/test262/built-ins/Promise/prototype/finally/name.js b/js/src/tests/test262/built-ins/Promise/prototype/finally/name.js index 82020c1381..ad825c9f53 100644 --- a/js/src/tests/test262/built-ins/Promise/prototype/finally/name.js +++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/name.js @@ -21,10 +21,11 @@ includes: [propertyHelper.js] features: [Promise.prototype.finally] ---*/ -assert.sameValue(Promise.prototype.finally.name, 'finally'); - -verifyNotEnumerable(Promise.prototype.finally, 'name'); -verifyNotWritable(Promise.prototype.finally, 'name'); -verifyConfigurable(Promise.prototype.finally, 'name'); +verifyProperty(Promise.prototype.finally, "name", { + value: "finally", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/prototype/finally/not-a-constructor.js b/js/src/tests/test262/built-ins/Promise/prototype/finally/not-a-constructor.js index 25bb9a6554..61ba99df53 100644 --- a/js/src/tests/test262/built-ins/Promise/prototype/finally/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let p = new Promise(() => {}); new p.finally(); -}, '`let p = new Promise(() => {}); new p.finally()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/prototype/finally/rejected-observable-then-calls-argument.js b/js/src/tests/test262/built-ins/Promise/prototype/finally/rejected-observable-then-calls-argument.js index 4d183bf248..49cb4840ff 100644 --- a/js/src/tests/test262/built-ins/Promise/prototype/finally/rejected-observable-then-calls-argument.js +++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/rejected-observable-then-calls-argument.js @@ -59,7 +59,7 @@ Promise.prototype.then = function(resolve, reject) { assert.sameValue(isConstructor(reject), false, 'isConstructor(reject) must return false'); assert.throws(TypeError, () => { new reject(); - }, '`new reject()` throws TypeError'); + }); assert.sameValue(arguments.length, 2, '`then` invoked with two arguments'); } diff --git a/js/src/tests/test262/built-ins/Promise/prototype/finally/resolved-observable-then-calls-argument.js b/js/src/tests/test262/built-ins/Promise/prototype/finally/resolved-observable-then-calls-argument.js index ab7eedb192..0f9fc558c5 100644 --- a/js/src/tests/test262/built-ins/Promise/prototype/finally/resolved-observable-then-calls-argument.js +++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/resolved-observable-then-calls-argument.js @@ -35,7 +35,7 @@ Promise.prototype.then = function(resolve) { assert.sameValue(isConstructor(resolve), false, 'isConstructor(resolve) must return false'); assert.throws(TypeError, () => { new resolve(); - }, '`new resolve()` throws TypeError'); + }); assert.sameValue( resolve.length, diff --git a/js/src/tests/test262/built-ins/Promise/prototype/then/length.js b/js/src/tests/test262/built-ins/Promise/prototype/then/length.js index 1e865b0460..2ada466b80 100644 --- a/js/src/tests/test262/built-ins/Promise/prototype/then/length.js +++ b/js/src/tests/test262/built-ins/Promise/prototype/then/length.js @@ -18,10 +18,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Promise.prototype.then.length, 2); - -verifyNotEnumerable(Promise.prototype.then, 'length'); -verifyNotWritable(Promise.prototype.then, 'length'); -verifyConfigurable(Promise.prototype.then, 'length'); +verifyProperty(Promise.prototype.then, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/prototype/then/name.js b/js/src/tests/test262/built-ins/Promise/prototype/then/name.js index b1c97f9956..82402ea992 100644 --- a/js/src/tests/test262/built-ins/Promise/prototype/then/name.js +++ b/js/src/tests/test262/built-ins/Promise/prototype/then/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Promise.prototype.then.name, 'then'); - -verifyNotEnumerable(Promise.prototype.then, 'name'); -verifyNotWritable(Promise.prototype.then, 'name'); -verifyConfigurable(Promise.prototype.then, 'name'); +verifyProperty(Promise.prototype.then, "name", { + value: "then", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/prototype/then/not-a-constructor.js b/js/src/tests/test262/built-ins/Promise/prototype/then/not-a-constructor.js index d943772f86..d04c89e111 100644 --- a/js/src/tests/test262/built-ins/Promise/prototype/then/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Promise/prototype/then/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let p = new Promise(() => {}); new p.then(); -}, '`let p = new Promise(() => {}); new p.then()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/race/length.js b/js/src/tests/test262/built-ins/Promise/race/length.js index 0fa1f53d8e..7807708403 100644 --- a/js/src/tests/test262/built-ins/Promise/race/length.js +++ b/js/src/tests/test262/built-ins/Promise/race/length.js @@ -18,10 +18,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Promise.race.length, 1); - -verifyNotEnumerable(Promise.race, 'length'); -verifyNotWritable(Promise.race, 'length'); -verifyConfigurable(Promise.race, 'length'); +verifyProperty(Promise.race, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/race/name.js b/js/src/tests/test262/built-ins/Promise/race/name.js index e88d3384ef..d4644e0992 100644 --- a/js/src/tests/test262/built-ins/Promise/race/name.js +++ b/js/src/tests/test262/built-ins/Promise/race/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Promise.race.name, 'race'); - -verifyNotEnumerable(Promise.race, 'name'); -verifyNotWritable(Promise.race, 'name'); -verifyConfigurable(Promise.race, 'name'); +verifyProperty(Promise.race, "name", { + value: "race", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/race/not-a-constructor.js b/js/src/tests/test262/built-ins/Promise/race/not-a-constructor.js index a6e0f33d59..732dd53f1d 100644 --- a/js/src/tests/test262/built-ins/Promise/race/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Promise/race/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Promise.race), false, 'isConstructor(Promise.race assert.throws(TypeError, () => { new Promise.race([]); -}, '`new Promise.race([])` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/reject-function-length.js b/js/src/tests/test262/built-ins/Promise/reject-function-length.js index 76bcb1f5c3..ef48faf0e7 100644 --- a/js/src/tests/test262/built-ins/Promise/reject-function-length.js +++ b/js/src/tests/test262/built-ins/Promise/reject-function-length.js @@ -19,10 +19,11 @@ new Promise(function(resolve, reject) { rejectFunction = reject; }); -assert.sameValue(rejectFunction.length, 1); - -verifyNotEnumerable(rejectFunction, "length"); -verifyNotWritable(rejectFunction, "length"); -verifyConfigurable(rejectFunction, "length"); +verifyProperty(rejectFunction, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/reject/length.js b/js/src/tests/test262/built-ins/Promise/reject/length.js index 1773dfca57..af9c16e33c 100644 --- a/js/src/tests/test262/built-ins/Promise/reject/length.js +++ b/js/src/tests/test262/built-ins/Promise/reject/length.js @@ -18,10 +18,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Promise.reject.length, 1); - -verifyNotEnumerable(Promise.reject, 'length'); -verifyNotWritable(Promise.reject, 'length'); -verifyConfigurable(Promise.reject, 'length'); +verifyProperty(Promise.reject, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/reject/name.js b/js/src/tests/test262/built-ins/Promise/reject/name.js index eb0e4c630f..12db66b706 100644 --- a/js/src/tests/test262/built-ins/Promise/reject/name.js +++ b/js/src/tests/test262/built-ins/Promise/reject/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Promise.reject.name, 'reject'); - -verifyNotEnumerable(Promise.reject, 'name'); -verifyNotWritable(Promise.reject, 'name'); -verifyConfigurable(Promise.reject, 'name'); +verifyProperty(Promise.reject, "name", { + value: "reject", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/reject/not-a-constructor.js b/js/src/tests/test262/built-ins/Promise/reject/not-a-constructor.js index 1fa8864edb..9cccfa8e4d 100644 --- a/js/src/tests/test262/built-ins/Promise/reject/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Promise/reject/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Promise.reject), false, 'isConstructor(Promise.re assert.throws(TypeError, () => { new Promise.reject(); -}, '`new Promise.reject()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/resolve-function-length.js b/js/src/tests/test262/built-ins/Promise/resolve-function-length.js index 9d6ae8ea9e..acac1fef91 100644 --- a/js/src/tests/test262/built-ins/Promise/resolve-function-length.js +++ b/js/src/tests/test262/built-ins/Promise/resolve-function-length.js @@ -19,10 +19,11 @@ new Promise(function(resolve, reject) { resolveFunction = resolve; }); -assert.sameValue(resolveFunction.length, 1); - -verifyNotEnumerable(resolveFunction, "length"); -verifyNotWritable(resolveFunction, "length"); -verifyConfigurable(resolveFunction, "length"); +verifyProperty(resolveFunction, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/resolve/length.js b/js/src/tests/test262/built-ins/Promise/resolve/length.js index a73283a4b2..64ae9e9130 100644 --- a/js/src/tests/test262/built-ins/Promise/resolve/length.js +++ b/js/src/tests/test262/built-ins/Promise/resolve/length.js @@ -18,10 +18,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Promise.resolve.length, 1); - -verifyNotEnumerable(Promise.resolve, 'length'); -verifyNotWritable(Promise.resolve, 'length'); -verifyConfigurable(Promise.resolve, 'length'); +verifyProperty(Promise.resolve, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/resolve/name.js b/js/src/tests/test262/built-ins/Promise/resolve/name.js index b9644562b6..21a6aa62a1 100644 --- a/js/src/tests/test262/built-ins/Promise/resolve/name.js +++ b/js/src/tests/test262/built-ins/Promise/resolve/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Promise.resolve.name, 'resolve'); - -verifyNotEnumerable(Promise.resolve, 'name'); -verifyNotWritable(Promise.resolve, 'name'); -verifyConfigurable(Promise.resolve, 'name'); +verifyProperty(Promise.resolve, "name", { + value: "resolve", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/resolve/not-a-constructor.js b/js/src/tests/test262/built-ins/Promise/resolve/not-a-constructor.js index e455743938..97e23b1d57 100644 --- a/js/src/tests/test262/built-ins/Promise/resolve/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Promise/resolve/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Promise.resolve), false, 'isConstructor(Promise.r assert.throws(TypeError, () => { new Promise.resolve(); -}, '`new Promise.resolve()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Proxy/create-target-is-not-a-constructor.js b/js/src/tests/test262/built-ins/Proxy/create-target-is-not-a-constructor.js index 2bd3fe46c5..47551407f6 100644 --- a/js/src/tests/test262/built-ins/Proxy/create-target-is-not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Proxy/create-target-is-not-a-constructor.js @@ -28,6 +28,6 @@ proxy(); // the Proxy object is callable assert.sameValue(isConstructor(proxy), false, 'isConstructor(proxy) must return false'); assert.throws(TypeError, () => { new proxy(); -}, '`new proxy()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Proxy/length.js b/js/src/tests/test262/built-ins/Proxy/length.js index 9bacc49713..01b9b1407e 100644 --- a/js/src/tests/test262/built-ins/Proxy/length.js +++ b/js/src/tests/test262/built-ins/Proxy/length.js @@ -11,10 +11,11 @@ includes: [propertyHelper.js] features: [Proxy] ---*/ -assert.sameValue(Proxy.length, 2, "The value of `Proxy.length` is `2`"); - -verifyNotEnumerable(Proxy, "length"); -verifyNotWritable(Proxy, "length"); -verifyConfigurable(Proxy, "length"); +verifyProperty(Proxy, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Proxy/name.js b/js/src/tests/test262/built-ins/Proxy/name.js index 31d3ec097d..abdf0dda73 100644 --- a/js/src/tests/test262/built-ins/Proxy/name.js +++ b/js/src/tests/test262/built-ins/Proxy/name.js @@ -11,10 +11,11 @@ includes: [propertyHelper.js] features: [Proxy] ---*/ -assert.sameValue(Proxy.name, "Proxy", "The value of `Proxy.name` is `'Proxy'`"); - -verifyNotEnumerable(Proxy, "name"); -verifyNotWritable(Proxy, "name"); -verifyConfigurable(Proxy, "name"); +verifyProperty(Proxy, "name", { + value: "Proxy", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Proxy/revocable/length.js b/js/src/tests/test262/built-ins/Proxy/revocable/length.js index 8c1b055371..1b5dfc85c3 100644 --- a/js/src/tests/test262/built-ins/Proxy/revocable/length.js +++ b/js/src/tests/test262/built-ins/Proxy/revocable/length.js @@ -23,10 +23,11 @@ includes: [propertyHelper.js] features: [Proxy] ---*/ -assert.sameValue(Proxy.revocable.length, 2); - -verifyNotEnumerable(Proxy.revocable, "length"); -verifyNotWritable(Proxy.revocable, "length"); -verifyConfigurable(Proxy.revocable, "length"); +verifyProperty(Proxy.revocable, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Proxy/revocable/name.js b/js/src/tests/test262/built-ins/Proxy/revocable/name.js index 0e7ce54890..71690c482b 100644 --- a/js/src/tests/test262/built-ins/Proxy/revocable/name.js +++ b/js/src/tests/test262/built-ins/Proxy/revocable/name.js @@ -20,10 +20,11 @@ includes: [propertyHelper.js] features: [Proxy] ---*/ -assert.sameValue(Proxy.revocable.name, "revocable"); - -verifyNotEnumerable(Proxy.revocable, "name"); -verifyNotWritable(Proxy.revocable, "name"); -verifyConfigurable(Proxy.revocable, "name"); +verifyProperty(Proxy.revocable, "name", { + value: "revocable", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Proxy/revocable/not-a-constructor.js b/js/src/tests/test262/built-ins/Proxy/revocable/not-a-constructor.js index 0d1e9bdff5..95fb044f82 100644 --- a/js/src/tests/test262/built-ins/Proxy/revocable/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Proxy/revocable/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Proxy.revocable), false, 'isConstructor(Proxy.rev assert.throws(TypeError, () => { new Proxy.revocable({}, {}); -}, '`new Proxy.revocable({}, {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Proxy/revocable/revocation-function-length.js b/js/src/tests/test262/built-ins/Proxy/revocable/revocation-function-length.js index ac59134301..2460658438 100644 --- a/js/src/tests/test262/built-ins/Proxy/revocable/revocation-function-length.js +++ b/js/src/tests/test262/built-ins/Proxy/revocable/revocation-function-length.js @@ -17,10 +17,11 @@ features: [Proxy] var revocationFunction = Proxy.revocable({}, {}).revoke; -assert.sameValue(revocationFunction.length, 0); - -verifyNotEnumerable(revocationFunction, "length"); -verifyNotWritable(revocationFunction, "length"); -verifyConfigurable(revocationFunction, "length"); +verifyProperty(revocationFunction, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Proxy/revocable/revocation-function-not-a-constructor.js b/js/src/tests/test262/built-ins/Proxy/revocable/revocation-function-not-a-constructor.js index 643c7e57c2..40fdf658ea 100644 --- a/js/src/tests/test262/built-ins/Proxy/revocable/revocation-function-not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Proxy/revocable/revocation-function-not-a-constructor.js @@ -23,7 +23,7 @@ assert.sameValue( assert.sameValue(isConstructor(revocationFunction), false, 'isConstructor(revocationFunction) must return false'); assert.throws(TypeError, () => { new revocationFunction(); -}, '`new revocationFunction()` throws TypeError'); +}); diff --git a/js/src/tests/test262/built-ins/Reflect/apply/length.js b/js/src/tests/test262/built-ins/Reflect/apply/length.js index 3499bc3355..2b65f5502e 100644 --- a/js/src/tests/test262/built-ins/Reflect/apply/length.js +++ b/js/src/tests/test262/built-ins/Reflect/apply/length.js @@ -8,13 +8,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.apply.length, 3, - 'The value of `Reflect.apply.length` is `3`' -); - -verifyNotEnumerable(Reflect.apply, 'length'); -verifyNotWritable(Reflect.apply, 'length'); -verifyConfigurable(Reflect.apply, 'length'); +verifyProperty(Reflect.apply, "length", { + value: 3, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/apply/name.js b/js/src/tests/test262/built-ins/Reflect/apply/name.js index 5da83c4d24..d574475c5b 100644 --- a/js/src/tests/test262/built-ins/Reflect/apply/name.js +++ b/js/src/tests/test262/built-ins/Reflect/apply/name.js @@ -13,13 +13,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.apply.name, 'apply', - 'The value of `Reflect.apply.name` is `"apply"`' -); - -verifyNotEnumerable(Reflect.apply, 'name'); -verifyNotWritable(Reflect.apply, 'name'); -verifyConfigurable(Reflect.apply, 'name'); +verifyProperty(Reflect.apply, "name", { + value: "apply", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/apply/not-a-constructor.js b/js/src/tests/test262/built-ins/Reflect/apply/not-a-constructor.js index 4e4aa65254..8809107995 100644 --- a/js/src/tests/test262/built-ins/Reflect/apply/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Reflect/apply/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Reflect.apply), false, 'isConstructor(Reflect.app assert.throws(TypeError, () => { new Reflect.apply(() => {}, undefined, []); -}, '`new Reflect.apply(() => {}, undefined, [])` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/construct/length.js b/js/src/tests/test262/built-ins/Reflect/construct/length.js index 72e142753f..07b9663e53 100644 --- a/js/src/tests/test262/built-ins/Reflect/construct/length.js +++ b/js/src/tests/test262/built-ins/Reflect/construct/length.js @@ -12,13 +12,11 @@ includes: [propertyHelper.js] features: [Reflect, Reflect.construct] ---*/ -assert.sameValue( - Reflect.construct.length, 2, - 'The value of `Reflect.construct.length` is `2`' -); - -verifyNotEnumerable(Reflect.construct, 'length'); -verifyNotWritable(Reflect.construct, 'length'); -verifyConfigurable(Reflect.construct, 'length'); +verifyProperty(Reflect.construct, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/construct/name.js b/js/src/tests/test262/built-ins/Reflect/construct/name.js index ff1d6c51c5..61f2e5e74c 100644 --- a/js/src/tests/test262/built-ins/Reflect/construct/name.js +++ b/js/src/tests/test262/built-ins/Reflect/construct/name.js @@ -13,13 +13,11 @@ includes: [propertyHelper.js] features: [Reflect, Reflect.construct] ---*/ -assert.sameValue( - Reflect.construct.name, 'construct', - 'The value of `Reflect.construct.name` is `"construct"`' -); - -verifyNotEnumerable(Reflect.construct, 'name'); -verifyNotWritable(Reflect.construct, 'name'); -verifyConfigurable(Reflect.construct, 'name'); +verifyProperty(Reflect.construct, "name", { + value: "construct", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/construct/not-a-constructor.js b/js/src/tests/test262/built-ins/Reflect/construct/not-a-constructor.js index 16b99500a9..6d0f286fbb 100644 --- a/js/src/tests/test262/built-ins/Reflect/construct/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Reflect/construct/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Reflect.construct), false, 'isConstructor(Reflect assert.throws(TypeError, () => { new Reflect.construct(Function, [], Function); -}, '`new Reflect.construct(Function, [], Function)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/defineProperty/length.js b/js/src/tests/test262/built-ins/Reflect/defineProperty/length.js index 2b5b742918..f83f561d79 100644 --- a/js/src/tests/test262/built-ins/Reflect/defineProperty/length.js +++ b/js/src/tests/test262/built-ins/Reflect/defineProperty/length.js @@ -8,13 +8,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.defineProperty.length, 3, - 'The value of `Reflect.defineProperty.length` is `3`' -); - -verifyNotEnumerable(Reflect.defineProperty, 'length'); -verifyNotWritable(Reflect.defineProperty, 'length'); -verifyConfigurable(Reflect.defineProperty, 'length'); +verifyProperty(Reflect.defineProperty, "length", { + value: 3, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/defineProperty/name.js b/js/src/tests/test262/built-ins/Reflect/defineProperty/name.js index 5315b9d272..29214c37b5 100644 --- a/js/src/tests/test262/built-ins/Reflect/defineProperty/name.js +++ b/js/src/tests/test262/built-ins/Reflect/defineProperty/name.js @@ -13,13 +13,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.defineProperty.name, 'defineProperty', - 'The value of `Reflect.defineProperty.name` is `"defineProperty"`' -); - -verifyNotEnumerable(Reflect.defineProperty, 'name'); -verifyNotWritable(Reflect.defineProperty, 'name'); -verifyConfigurable(Reflect.defineProperty, 'name'); +verifyProperty(Reflect.defineProperty, "name", { + value: "defineProperty", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/defineProperty/not-a-constructor.js b/js/src/tests/test262/built-ins/Reflect/defineProperty/not-a-constructor.js index c878ad4756..a343891cdc 100644 --- a/js/src/tests/test262/built-ins/Reflect/defineProperty/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Reflect/defineProperty/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Reflect.defineProperty({}, ''); -}, '`new Reflect.defineProperty({}, \'\')` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/deleteProperty/length.js b/js/src/tests/test262/built-ins/Reflect/deleteProperty/length.js index f340de07b5..c4f219e377 100644 --- a/js/src/tests/test262/built-ins/Reflect/deleteProperty/length.js +++ b/js/src/tests/test262/built-ins/Reflect/deleteProperty/length.js @@ -8,13 +8,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.deleteProperty.length, 2, - 'The value of `Reflect.deleteProperty.length` is `2`' -); - -verifyNotEnumerable(Reflect.deleteProperty, 'length'); -verifyNotWritable(Reflect.deleteProperty, 'length'); -verifyConfigurable(Reflect.deleteProperty, 'length'); +verifyProperty(Reflect.deleteProperty, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/deleteProperty/name.js b/js/src/tests/test262/built-ins/Reflect/deleteProperty/name.js index 8f6a2ead5b..a3f31b0b6a 100644 --- a/js/src/tests/test262/built-ins/Reflect/deleteProperty/name.js +++ b/js/src/tests/test262/built-ins/Reflect/deleteProperty/name.js @@ -13,13 +13,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.deleteProperty.name, 'deleteProperty', - 'The value of `Reflect.deleteProperty.name` is `"deleteProperty"`' -); - -verifyNotEnumerable(Reflect.deleteProperty, 'name'); -verifyNotWritable(Reflect.deleteProperty, 'name'); -verifyConfigurable(Reflect.deleteProperty, 'name'); +verifyProperty(Reflect.deleteProperty, "name", { + value: "deleteProperty", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/deleteProperty/not-a-constructor.js b/js/src/tests/test262/built-ins/Reflect/deleteProperty/not-a-constructor.js index afbc5ae119..53fd473101 100644 --- a/js/src/tests/test262/built-ins/Reflect/deleteProperty/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Reflect/deleteProperty/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Reflect.deleteProperty({}, ''); -}, '`new Reflect.deleteProperty({}, \'\')` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/get/length.js b/js/src/tests/test262/built-ins/Reflect/get/length.js index 615f35d6cc..7a2caa9205 100644 --- a/js/src/tests/test262/built-ins/Reflect/get/length.js +++ b/js/src/tests/test262/built-ins/Reflect/get/length.js @@ -12,13 +12,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.get.length, 2, - 'The value of `Reflect.get.length` is `2`' -); - -verifyNotEnumerable(Reflect.get, 'length'); -verifyNotWritable(Reflect.get, 'length'); -verifyConfigurable(Reflect.get, 'length'); +verifyProperty(Reflect.get, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/get/name.js b/js/src/tests/test262/built-ins/Reflect/get/name.js index d474d98e0f..1d573c56ac 100644 --- a/js/src/tests/test262/built-ins/Reflect/get/name.js +++ b/js/src/tests/test262/built-ins/Reflect/get/name.js @@ -13,13 +13,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.get.name, 'get', - 'The value of `Reflect.get.name` is `"get"`' -); - -verifyNotEnumerable(Reflect.get, 'name'); -verifyNotWritable(Reflect.get, 'name'); -verifyConfigurable(Reflect.get, 'name'); +verifyProperty(Reflect.get, "name", { + value: "get", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/get/not-a-constructor.js b/js/src/tests/test262/built-ins/Reflect/get/not-a-constructor.js index 73635058ff..66b468dc80 100644 --- a/js/src/tests/test262/built-ins/Reflect/get/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Reflect/get/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Reflect.get), false, 'isConstructor(Reflect.get) assert.throws(TypeError, () => { new Reflect.get({}, ''); -}, '`new Reflect.get({}, \'\')` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/getOwnPropertyDescriptor/length.js b/js/src/tests/test262/built-ins/Reflect/getOwnPropertyDescriptor/length.js index 47bc4d2b9b..bce7e7cfb5 100644 --- a/js/src/tests/test262/built-ins/Reflect/getOwnPropertyDescriptor/length.js +++ b/js/src/tests/test262/built-ins/Reflect/getOwnPropertyDescriptor/length.js @@ -8,13 +8,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.getOwnPropertyDescriptor.length, 2, - 'The value of `Reflect.getOwnPropertyDescriptor.length` is `2`' -); - -verifyNotEnumerable(Reflect.getOwnPropertyDescriptor, 'length'); -verifyNotWritable(Reflect.getOwnPropertyDescriptor, 'length'); -verifyConfigurable(Reflect.getOwnPropertyDescriptor, 'length'); +verifyProperty(Reflect.getOwnPropertyDescriptor, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/getOwnPropertyDescriptor/name.js b/js/src/tests/test262/built-ins/Reflect/getOwnPropertyDescriptor/name.js index 521736be82..6b4925d2e0 100644 --- a/js/src/tests/test262/built-ins/Reflect/getOwnPropertyDescriptor/name.js +++ b/js/src/tests/test262/built-ins/Reflect/getOwnPropertyDescriptor/name.js @@ -13,13 +13,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.getOwnPropertyDescriptor.name, 'getOwnPropertyDescriptor', - 'The value of `Reflect.getOwnPropertyDescriptor.name` is `"getOwnPropertyDescriptor"`' -); - -verifyNotEnumerable(Reflect.getOwnPropertyDescriptor, 'name'); -verifyNotWritable(Reflect.getOwnPropertyDescriptor, 'name'); -verifyConfigurable(Reflect.getOwnPropertyDescriptor, 'name'); +verifyProperty(Reflect.getOwnPropertyDescriptor, "name", { + value: "getOwnPropertyDescriptor", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/getOwnPropertyDescriptor/not-a-constructor.js b/js/src/tests/test262/built-ins/Reflect/getOwnPropertyDescriptor/not-a-constructor.js index 62c4d5511e..02ccf0f7af 100644 --- a/js/src/tests/test262/built-ins/Reflect/getOwnPropertyDescriptor/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Reflect/getOwnPropertyDescriptor/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Reflect.getOwnPropertyDescriptor({}, ''); -}, '`new Reflect.getOwnPropertyDescriptor({}, \'\')` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/getPrototypeOf/length.js b/js/src/tests/test262/built-ins/Reflect/getPrototypeOf/length.js index 30e3ba0e5d..66203e4532 100644 --- a/js/src/tests/test262/built-ins/Reflect/getPrototypeOf/length.js +++ b/js/src/tests/test262/built-ins/Reflect/getPrototypeOf/length.js @@ -8,13 +8,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.getPrototypeOf.length, 1, - 'The value of `Reflect.getPrototypeOf.length` is `1`' -); - -verifyNotEnumerable(Reflect.getPrototypeOf, 'length'); -verifyNotWritable(Reflect.getPrototypeOf, 'length'); -verifyConfigurable(Reflect.getPrototypeOf, 'length'); +verifyProperty(Reflect.getPrototypeOf, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/getPrototypeOf/name.js b/js/src/tests/test262/built-ins/Reflect/getPrototypeOf/name.js index 6d6e1df287..8384aa8e67 100644 --- a/js/src/tests/test262/built-ins/Reflect/getPrototypeOf/name.js +++ b/js/src/tests/test262/built-ins/Reflect/getPrototypeOf/name.js @@ -13,13 +13,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.getPrototypeOf.name, 'getPrototypeOf', - 'The value of `Reflect.getPrototypeOf.name` is `"getPrototypeOf"`' -); - -verifyNotEnumerable(Reflect.getPrototypeOf, 'name'); -verifyNotWritable(Reflect.getPrototypeOf, 'name'); -verifyConfigurable(Reflect.getPrototypeOf, 'name'); +verifyProperty(Reflect.getPrototypeOf, "name", { + value: "getPrototypeOf", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/getPrototypeOf/not-a-constructor.js b/js/src/tests/test262/built-ins/Reflect/getPrototypeOf/not-a-constructor.js index 6ce18c7913..199f3bd72a 100644 --- a/js/src/tests/test262/built-ins/Reflect/getPrototypeOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Reflect/getPrototypeOf/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Reflect.getPrototypeOf({}); -}, '`new Reflect.getPrototypeOf({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/has/length.js b/js/src/tests/test262/built-ins/Reflect/has/length.js index a5a0fc4a0b..5779efca57 100644 --- a/js/src/tests/test262/built-ins/Reflect/has/length.js +++ b/js/src/tests/test262/built-ins/Reflect/has/length.js @@ -8,13 +8,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.has.length, 2, - 'The value of `Reflect.has.length` is `2`' -); - -verifyNotEnumerable(Reflect.has, 'length'); -verifyNotWritable(Reflect.has, 'length'); -verifyConfigurable(Reflect.has, 'length'); +verifyProperty(Reflect.has, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/has/name.js b/js/src/tests/test262/built-ins/Reflect/has/name.js index 62e68d8983..3b1a3db14f 100644 --- a/js/src/tests/test262/built-ins/Reflect/has/name.js +++ b/js/src/tests/test262/built-ins/Reflect/has/name.js @@ -13,13 +13,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.has.name, 'has', - 'The value of `Reflect.has.name` is `"has"`' -); - -verifyNotEnumerable(Reflect.has, 'name'); -verifyNotWritable(Reflect.has, 'name'); -verifyConfigurable(Reflect.has, 'name'); +verifyProperty(Reflect.has, "name", { + value: "has", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/has/not-a-constructor.js b/js/src/tests/test262/built-ins/Reflect/has/not-a-constructor.js index 714c8ef861..0e7fa26991 100644 --- a/js/src/tests/test262/built-ins/Reflect/has/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Reflect/has/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Reflect.has), false, 'isConstructor(Reflect.has) assert.throws(TypeError, () => { new Reflect.has(); -}, '`new Reflect.has()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/isExtensible/length.js b/js/src/tests/test262/built-ins/Reflect/isExtensible/length.js index 31dd4d802a..61f564113e 100644 --- a/js/src/tests/test262/built-ins/Reflect/isExtensible/length.js +++ b/js/src/tests/test262/built-ins/Reflect/isExtensible/length.js @@ -8,13 +8,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.isExtensible.length, 1, - 'The value of `Reflect.isExtensible.length` is `1`' -); - -verifyNotEnumerable(Reflect.isExtensible, 'length'); -verifyNotWritable(Reflect.isExtensible, 'length'); -verifyConfigurable(Reflect.isExtensible, 'length'); +verifyProperty(Reflect.isExtensible, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/isExtensible/name.js b/js/src/tests/test262/built-ins/Reflect/isExtensible/name.js index 04ba531667..ef8820258b 100644 --- a/js/src/tests/test262/built-ins/Reflect/isExtensible/name.js +++ b/js/src/tests/test262/built-ins/Reflect/isExtensible/name.js @@ -13,13 +13,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.isExtensible.name, 'isExtensible', - 'The value of `Reflect.isExtensible.name` is `"isExtensible"`' -); - -verifyNotEnumerable(Reflect.isExtensible, 'name'); -verifyNotWritable(Reflect.isExtensible, 'name'); -verifyConfigurable(Reflect.isExtensible, 'name'); +verifyProperty(Reflect.isExtensible, "name", { + value: "isExtensible", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/isExtensible/not-a-constructor.js b/js/src/tests/test262/built-ins/Reflect/isExtensible/not-a-constructor.js index e45a445b84..a8205bf113 100644 --- a/js/src/tests/test262/built-ins/Reflect/isExtensible/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Reflect/isExtensible/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Reflect.isExtensible), false, 'isConstructor(Refl assert.throws(TypeError, () => { new Reflect.isExtensible({}); -}, '`new Reflect.isExtensible({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/ownKeys/length.js b/js/src/tests/test262/built-ins/Reflect/ownKeys/length.js index 7f84f0b49a..6f83f2ce49 100644 --- a/js/src/tests/test262/built-ins/Reflect/ownKeys/length.js +++ b/js/src/tests/test262/built-ins/Reflect/ownKeys/length.js @@ -8,13 +8,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.ownKeys.length, 1, - 'The value of `Reflect.ownKeys.length` is `1`' -); - -verifyNotEnumerable(Reflect.ownKeys, 'length'); -verifyNotWritable(Reflect.ownKeys, 'length'); -verifyConfigurable(Reflect.ownKeys, 'length'); +verifyProperty(Reflect.ownKeys, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/ownKeys/name.js b/js/src/tests/test262/built-ins/Reflect/ownKeys/name.js index 77a757dfc5..1de47e9efc 100644 --- a/js/src/tests/test262/built-ins/Reflect/ownKeys/name.js +++ b/js/src/tests/test262/built-ins/Reflect/ownKeys/name.js @@ -13,13 +13,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.ownKeys.name, 'ownKeys', - 'The value of `Reflect.ownKeys.name` is `"ownKeys"`' -); - -verifyNotEnumerable(Reflect.ownKeys, 'name'); -verifyNotWritable(Reflect.ownKeys, 'name'); -verifyConfigurable(Reflect.ownKeys, 'name'); +verifyProperty(Reflect.ownKeys, "name", { + value: "ownKeys", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/ownKeys/not-a-constructor.js b/js/src/tests/test262/built-ins/Reflect/ownKeys/not-a-constructor.js index 9419d7cdd5..384ceb94df 100644 --- a/js/src/tests/test262/built-ins/Reflect/ownKeys/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Reflect/ownKeys/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Reflect.ownKeys), false, 'isConstructor(Reflect.o assert.throws(TypeError, () => { new Reflect.ownKeys({}); -}, '`new Reflect.ownKeys({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/preventExtensions/length.js b/js/src/tests/test262/built-ins/Reflect/preventExtensions/length.js index ee474224bf..35fa687d4c 100644 --- a/js/src/tests/test262/built-ins/Reflect/preventExtensions/length.js +++ b/js/src/tests/test262/built-ins/Reflect/preventExtensions/length.js @@ -8,13 +8,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.preventExtensions.length, 1, - 'The value of `Reflect.preventExtensions.length` is `1`' -); - -verifyNotEnumerable(Reflect.preventExtensions, 'length'); -verifyNotWritable(Reflect.preventExtensions, 'length'); -verifyConfigurable(Reflect.preventExtensions, 'length'); +verifyProperty(Reflect.preventExtensions, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/preventExtensions/name.js b/js/src/tests/test262/built-ins/Reflect/preventExtensions/name.js index 802a6efbb6..62148cd873 100644 --- a/js/src/tests/test262/built-ins/Reflect/preventExtensions/name.js +++ b/js/src/tests/test262/built-ins/Reflect/preventExtensions/name.js @@ -13,13 +13,11 @@ includes: [propertyHelper.js] features: [Reflect] ---*/ -assert.sameValue( - Reflect.preventExtensions.name, 'preventExtensions', - 'The value of `Reflect.preventExtensions.name` is `"preventExtensions"`' -); - -verifyNotEnumerable(Reflect.preventExtensions, 'name'); -verifyNotWritable(Reflect.preventExtensions, 'name'); -verifyConfigurable(Reflect.preventExtensions, 'name'); +verifyProperty(Reflect.preventExtensions, "name", { + value: "preventExtensions", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/preventExtensions/not-a-constructor.js b/js/src/tests/test262/built-ins/Reflect/preventExtensions/not-a-constructor.js index 9157e1a265..ae86ac9ee5 100644 --- a/js/src/tests/test262/built-ins/Reflect/preventExtensions/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Reflect/preventExtensions/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Reflect.preventExtensions({}); -}, '`new Reflect.preventExtensions({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/set/length.js b/js/src/tests/test262/built-ins/Reflect/set/length.js index e8e0d537c7..cab048f500 100644 --- a/js/src/tests/test262/built-ins/Reflect/set/length.js +++ b/js/src/tests/test262/built-ins/Reflect/set/length.js @@ -12,13 +12,11 @@ includes: [propertyHelper.js] features: [Reflect, Reflect.set] ---*/ -assert.sameValue( - Reflect.set.length, 3, - 'The value of `Reflect.set.length` is `3`' -); - -verifyNotEnumerable(Reflect.set, 'length'); -verifyNotWritable(Reflect.set, 'length'); -verifyConfigurable(Reflect.set, 'length'); +verifyProperty(Reflect.set, "length", { + value: 3, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/set/name.js b/js/src/tests/test262/built-ins/Reflect/set/name.js index 999e652586..26db6f5186 100644 --- a/js/src/tests/test262/built-ins/Reflect/set/name.js +++ b/js/src/tests/test262/built-ins/Reflect/set/name.js @@ -13,13 +13,11 @@ includes: [propertyHelper.js] features: [Reflect, Reflect.set] ---*/ -assert.sameValue( - Reflect.set.name, 'set', - 'The value of `Reflect.set.name` is `"set"`' -); - -verifyNotEnumerable(Reflect.set, 'name'); -verifyNotWritable(Reflect.set, 'name'); -verifyConfigurable(Reflect.set, 'name'); +verifyProperty(Reflect.set, "name", { + value: "set", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/set/not-a-constructor.js b/js/src/tests/test262/built-ins/Reflect/set/not-a-constructor.js index c632ce534f..ae57a7c824 100644 --- a/js/src/tests/test262/built-ins/Reflect/set/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Reflect/set/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Reflect.set), false, 'isConstructor(Reflect.set) assert.throws(TypeError, () => { new Reflect.set({}); -}, '`new Reflect.set({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/setPrototypeOf/length.js b/js/src/tests/test262/built-ins/Reflect/setPrototypeOf/length.js index 51e4fff9c4..4b7b768317 100644 --- a/js/src/tests/test262/built-ins/Reflect/setPrototypeOf/length.js +++ b/js/src/tests/test262/built-ins/Reflect/setPrototypeOf/length.js @@ -8,13 +8,11 @@ includes: [propertyHelper.js] features: [Reflect, Reflect.setPrototypeOf] ---*/ -assert.sameValue( - Reflect.setPrototypeOf.length, 2, - 'The value of `Reflect.setPrototypeOf.length` is `2`' -); - -verifyNotEnumerable(Reflect.setPrototypeOf, 'length'); -verifyNotWritable(Reflect.setPrototypeOf, 'length'); -verifyConfigurable(Reflect.setPrototypeOf, 'length'); +verifyProperty(Reflect.setPrototypeOf, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/setPrototypeOf/name.js b/js/src/tests/test262/built-ins/Reflect/setPrototypeOf/name.js index bbbca0a855..3c89e4b12f 100644 --- a/js/src/tests/test262/built-ins/Reflect/setPrototypeOf/name.js +++ b/js/src/tests/test262/built-ins/Reflect/setPrototypeOf/name.js @@ -12,13 +12,11 @@ includes: [propertyHelper.js] features: [Reflect, Reflect.setPrototypeOf] ---*/ -assert.sameValue( - Reflect.setPrototypeOf.name, 'setPrototypeOf', - 'The value of `Reflect.setPrototypeOf.name` is `"setPrototypeOf"`' -); - -verifyNotEnumerable(Reflect.setPrototypeOf, 'name'); -verifyNotWritable(Reflect.setPrototypeOf, 'name'); -verifyConfigurable(Reflect.setPrototypeOf, 'name'); +verifyProperty(Reflect.setPrototypeOf, "name", { + value: "setPrototypeOf", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/setPrototypeOf/not-a-constructor.js b/js/src/tests/test262/built-ins/Reflect/setPrototypeOf/not-a-constructor.js index e7e1f90120..ff732d9e5b 100644 --- a/js/src/tests/test262/built-ins/Reflect/setPrototypeOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Reflect/setPrototypeOf/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new Reflect.setPrototypeOf({}, {}); -}, '`new Reflect.setPrototypeOf({}, {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/Symbol.species/length.js b/js/src/tests/test262/built-ins/RegExp/Symbol.species/length.js index c38cb495a3..5330173b20 100644 --- a/js/src/tests/test262/built-ins/RegExp/Symbol.species/length.js +++ b/js/src/tests/test262/built-ins/RegExp/Symbol.species/length.js @@ -25,10 +25,11 @@ features: [Symbol.species] var desc = Object.getOwnPropertyDescriptor(RegExp, 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/RegExp/Symbol.species/symbol-species-name.js b/js/src/tests/test262/built-ins/RegExp/Symbol.species/symbol-species-name.js index c7069365a6..5502462c6e 100644 --- a/js/src/tests/test262/built-ins/RegExp/Symbol.species/symbol-species-name.js +++ b/js/src/tests/test262/built-ins/RegExp/Symbol.species/symbol-species-name.js @@ -15,13 +15,11 @@ includes: [propertyHelper.js] var descriptor = Object.getOwnPropertyDescriptor(RegExp, 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/RegExp/early-err-modifiers-code-point-repeat-i-1.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-code-point-repeat-i-1.js new file mode 100644 index 0000000000..cc4d99e0cd --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-code-point-repeat-i-1.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?ii:a)", ""); +}, 'RegExp("(?ii:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-code-point-repeat-i-2.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-code-point-repeat-i-2.js new file mode 100644 index 0000000000..24a85269ad --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-code-point-repeat-i-2.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?imsi:a)", ""); +}, 'RegExp("(?imsi:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-arbitrary.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-arbitrary.js new file mode 100644 index 0000000000..d67bb46e14 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-arbitrary.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?1:a)", ""); +}, 'RegExp("(?1:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-combining-i.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-combining-i.js new file mode 100644 index 0000000000..d309c29c20 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-combining-i.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?iͥ:a)", ""); +}, 'RegExp("(?iͥ:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-combining-m.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-combining-m.js new file mode 100644 index 0000000000..38d57aca09 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-combining-m.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?mͫ:a)", ""); +}, 'RegExp("(?mͫ:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-combining-s.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-combining-s.js new file mode 100644 index 0000000000..325d6cce13 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-combining-s.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?s̀:a)", ""); +}, 'RegExp("(?s̀:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-d.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-d.js new file mode 100644 index 0000000000..27d3dcc71a --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-d.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?d:a)", ""); +}, 'RegExp("(?d:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-g.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-g.js new file mode 100644 index 0000000000..e2805673f2 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-g.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?g:a)", ""); +}, 'RegExp("(?g:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-non-display-1.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-non-display-1.js new file mode 100644 index 0000000000..d2d2223eb2 Binary files /dev/null and b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-non-display-1.js differ diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-non-display-2.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-non-display-2.js new file mode 100644 index 0000000000..9e05cb67f3 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-non-display-2.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?s‎:a)", ""); +}, 'RegExp("(?s‎:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-non-flag.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-non-flag.js new file mode 100644 index 0000000000..87ee26e9ca --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-non-flag.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?Q:a)", ""); +}, 'RegExp("(?Q:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-u.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-u.js new file mode 100644 index 0000000000..82c45b61f2 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-u.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?u:a)", ""); +}, 'RegExp("(?u:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-uppercase-I.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-uppercase-I.js new file mode 100644 index 0000000000..17e23af60b --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-uppercase-I.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?I:a)", ""); +}, 'RegExp("(?I:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-y.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-y.js new file mode 100644 index 0000000000..829ec8a69f --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-y.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?y:a)", ""); +}, 'RegExp("(?y:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-zwj.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-zwj.js new file mode 100644 index 0000000000..e7877d64c1 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-zwj.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?s‍:a)", ""); +}, 'RegExp("(?s‍:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-zwnbsp.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-zwnbsp.js new file mode 100644 index 0000000000..0a44ee1551 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-zwnbsp.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?s:a)", ""); +}, 'RegExp("(?s:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-zwnj.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-zwnj.js new file mode 100644 index 0000000000..233c5aa9dd --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-other-code-point-zwnj.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?s‌:a)", ""); +}, 'RegExp("(?s‌:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-case-fold-i.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-case-fold-i.js new file mode 100644 index 0000000000..bbe8e845e2 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-case-fold-i.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?I:a)", "i"); +}, 'RegExp("(?I:a)", "i"): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-case-fold-m.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-case-fold-m.js new file mode 100644 index 0000000000..61068122a5 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-case-fold-m.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?M:a)", "i"); +}, 'RegExp("(?M:a)", "i"): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-case-fold-s.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-case-fold-s.js new file mode 100644 index 0000000000..464666a010 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-case-fold-s.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?S:a)", "i"); +}, 'RegExp("(?S:a)", "i"): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-unicode-case-fold-i.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-unicode-case-fold-i.js new file mode 100644 index 0000000000..3140f4e4de --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-unicode-case-fold-i.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case-folded to "i", "m", or "s" (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?İ:a)", "iu"); +}, 'RegExp("(?İ:a)", "iu"): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-unicode-case-fold-s.js b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-unicode-case-fold-s.js new file mode 100644 index 0000000000..939793f5ed --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/early-err-modifiers-should-not-unicode-case-fold-s.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case-folded to "i", "m", or "s" (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?ſ:a)", "u"); +}, 'RegExp("(?ſ:a)", "u"): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/length.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/length.js index ea84d3ce40..b8c3c34a02 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/length.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/length.js @@ -19,10 +19,11 @@ includes: [propertyHelper.js] features: [Symbol.match] ---*/ -assert.sameValue(RegExp.prototype[Symbol.match].length, 1); - -verifyNotEnumerable(RegExp.prototype[Symbol.match], 'length'); -verifyNotWritable(RegExp.prototype[Symbol.match], 'length'); -verifyConfigurable(RegExp.prototype[Symbol.match], 'length'); +verifyProperty(RegExp.prototype[Symbol.match], "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/name.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/name.js index 2c676dba2f..a0629a0c73 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/name.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/name.js @@ -17,10 +17,11 @@ includes: [propertyHelper.js] features: [Symbol.match] ---*/ -assert.sameValue(RegExp.prototype[Symbol.match].name, '[Symbol.match]'); - -verifyNotEnumerable(RegExp.prototype[Symbol.match], 'name'); -verifyNotWritable(RegExp.prototype[Symbol.match], 'name'); -verifyConfigurable(RegExp.prototype[Symbol.match], 'name'); +verifyProperty(RegExp.prototype[Symbol.match], "name", { + value: "[Symbol.match]", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/not-a-constructor.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/not-a-constructor.js index f56be3391f..727add9892 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.match/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let re = new RegExp(''); new re[Symbol.match](); -}, '`let re = new RegExp(\'\'); new re[Symbol.match]()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/length.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/length.js index ec522ab2f5..70284e43e6 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/length.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/length.js @@ -23,10 +23,11 @@ includes: [propertyHelper.js] features: [Symbol.matchAll] ---*/ -assert.sameValue(RegExp.prototype[Symbol.matchAll].length, 1); - -verifyNotEnumerable(RegExp.prototype[Symbol.matchAll], 'length'); -verifyNotWritable(RegExp.prototype[Symbol.matchAll], 'length'); -verifyConfigurable(RegExp.prototype[Symbol.matchAll], 'length'); +verifyProperty(RegExp.prototype[Symbol.matchAll], "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/name.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/name.js index f9a1e9bf87..4ce81b923f 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/name.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/name.js @@ -21,10 +21,11 @@ includes: [propertyHelper.js] features: [Symbol.matchAll] ---*/ -assert.sameValue(RegExp.prototype[Symbol.matchAll].name, '[Symbol.matchAll]'); - -verifyNotEnumerable(RegExp.prototype[Symbol.matchAll], 'name'); -verifyNotWritable(RegExp.prototype[Symbol.matchAll], 'name'); -verifyConfigurable(RegExp.prototype[Symbol.matchAll], 'name'); +verifyProperty(RegExp.prototype[Symbol.matchAll], "name", { + value: "[Symbol.matchAll]", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/not-a-constructor.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/not-a-constructor.js index 03009bf3de..956881d1c6 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.matchAll/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let re = new RegExp(''); new re[Symbol.matchAll](); -}, '`let re = new RegExp(\'\'); new re[Symbol.matchAll]()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/length.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/length.js index fe89e2265b..7dce30b819 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/length.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/length.js @@ -19,10 +19,11 @@ includes: [propertyHelper.js] features: [Symbol.replace] ---*/ -assert.sameValue(RegExp.prototype[Symbol.replace].length, 2); - -verifyNotEnumerable(RegExp.prototype[Symbol.replace], 'length'); -verifyNotWritable(RegExp.prototype[Symbol.replace], 'length'); -verifyConfigurable(RegExp.prototype[Symbol.replace], 'length'); +verifyProperty(RegExp.prototype[Symbol.replace], "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/name.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/name.js index 5d6dbb13e7..512c11a769 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/name.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/name.js @@ -17,10 +17,11 @@ includes: [propertyHelper.js] features: [Symbol.replace] ---*/ -assert.sameValue(RegExp.prototype[Symbol.replace].name, '[Symbol.replace]'); - -verifyNotEnumerable(RegExp.prototype[Symbol.replace], 'name'); -verifyNotWritable(RegExp.prototype[Symbol.replace], 'name'); -verifyConfigurable(RegExp.prototype[Symbol.replace], 'name'); +verifyProperty(RegExp.prototype[Symbol.replace], "name", { + value: "[Symbol.replace]", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/not-a-constructor.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/not-a-constructor.js index 8fe7bd03bb..07c7a0b7a1 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.replace/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let re = new RegExp(''); new re[Symbol.replace](); -}, '`let re = new RegExp(\'\'); new re[Symbol.replace]()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.search/length.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.search/length.js index 86a0b3051c..5be85a3bf4 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.search/length.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.search/length.js @@ -20,10 +20,11 @@ features: [Symbol.search] includes: [propertyHelper.js] ---*/ -assert.sameValue(RegExp.prototype[Symbol.search].length, 1); - -verifyNotEnumerable(RegExp.prototype[Symbol.search], 'length'); -verifyNotWritable(RegExp.prototype[Symbol.search], 'length'); -verifyConfigurable(RegExp.prototype[Symbol.search], 'length'); +verifyProperty(RegExp.prototype[Symbol.search], "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.search/name.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.search/name.js index 08a4452f48..4f3861d650 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.search/name.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.search/name.js @@ -17,10 +17,11 @@ features: [Symbol.search] includes: [propertyHelper.js] ---*/ -assert.sameValue(RegExp.prototype[Symbol.search].name, '[Symbol.search]'); - -verifyNotEnumerable(RegExp.prototype[Symbol.search], 'name'); -verifyNotWritable(RegExp.prototype[Symbol.search], 'name'); -verifyConfigurable(RegExp.prototype[Symbol.search], 'name'); +verifyProperty(RegExp.prototype[Symbol.search], "name", { + value: "[Symbol.search]", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.search/not-a-constructor.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.search/not-a-constructor.js index 0403b2e6da..8d13663998 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.search/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.search/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let re = new RegExp(''); new re[Symbol.search](); -}, '`let re = new RegExp(\'\'); new re[Symbol.search]()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.split/length.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.split/length.js index 546f056ca0..5fe2ff49c4 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.split/length.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.split/length.js @@ -17,10 +17,11 @@ includes: [propertyHelper.js] features: [Symbol.split] ---*/ -assert.sameValue(RegExp.prototype[Symbol.split].length, 2); - -verifyNotEnumerable(RegExp.prototype[Symbol.split], 'length'); -verifyNotWritable(RegExp.prototype[Symbol.split], 'length'); -verifyConfigurable(RegExp.prototype[Symbol.split], 'length'); +verifyProperty(RegExp.prototype[Symbol.split], "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.split/name.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.split/name.js index aac4f253a1..5284f94f57 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.split/name.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.split/name.js @@ -17,10 +17,11 @@ includes: [propertyHelper.js] features: [Symbol.split] ---*/ -assert.sameValue(RegExp.prototype[Symbol.split].name, '[Symbol.split]'); - -verifyNotEnumerable(RegExp.prototype[Symbol.split], 'name'); -verifyNotWritable(RegExp.prototype[Symbol.split], 'name'); -verifyConfigurable(RegExp.prototype[Symbol.split], 'name'); +verifyProperty(RegExp.prototype[Symbol.split], "name", { + value: "[Symbol.split]", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.split/not-a-constructor.js b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.split/not-a-constructor.js index 4623db96ba..88094c421a 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.split/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/Symbol.split/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let re = new RegExp(''); new re[Symbol.split](); -}, '`let re = new RegExp(\'\'); new re[Symbol.split]()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/exec/name.js b/js/src/tests/test262/built-ins/RegExp/prototype/exec/name.js index 89d0243a20..ef865729a9 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/exec/name.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/exec/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(RegExp.prototype.exec.name, "exec"); - -verifyNotEnumerable(RegExp.prototype.exec, "name"); -verifyNotWritable(RegExp.prototype.exec, "name"); -verifyConfigurable(RegExp.prototype.exec, "name"); +verifyProperty(RegExp.prototype.exec, "name", { + value: "exec", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/exec/not-a-constructor.js b/js/src/tests/test262/built-ins/RegExp/prototype/exec/not-a-constructor.js index c4492952dd..9578cd6777 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/exec/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/exec/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let re = new RegExp(''); new re.exec(); -}, '`let re = new RegExp(\'\'); new re.exec()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/global/length.js b/js/src/tests/test262/built-ins/RegExp/prototype/global/length.js index d2802441f3..181dc3f2c4 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/global/length.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/global/length.js @@ -24,10 +24,11 @@ includes: [propertyHelper.js] var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "global"); -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/RegExp/prototype/global/name.js b/js/src/tests/test262/built-ins/RegExp/prototype/global/name.js index ba8ace9def..fb76ce7121 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/global/name.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/global/name.js @@ -14,13 +14,11 @@ includes: [propertyHelper.js] var descriptor = Object.getOwnPropertyDescriptor(RegExp.prototype, 'global'); -assert.sameValue( - descriptor.get.name, - 'get global' -); - -verifyNotEnumerable(descriptor.get, 'name'); -verifyNotWritable(descriptor.get, 'name'); -verifyConfigurable(descriptor.get, 'name'); +verifyProperty(descriptor.get, "name", { + value: "get global", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/length.js b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/length.js index 3707ec5ad1..fcb51bc8d7 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/length.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/length.js @@ -24,10 +24,11 @@ includes: [propertyHelper.js] var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "ignoreCase"); -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/RegExp/prototype/ignoreCase/name.js b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/name.js index 1f3894cbbe..4f7dc92846 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/name.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/name.js @@ -14,13 +14,11 @@ includes: [propertyHelper.js] var descriptor = Object.getOwnPropertyDescriptor(RegExp.prototype, 'ignoreCase'); -assert.sameValue( - descriptor.get.name, - 'get ignoreCase' -); - -verifyNotEnumerable(descriptor.get, 'name'); -verifyNotWritable(descriptor.get, 'name'); -verifyConfigurable(descriptor.get, 'name'); +verifyProperty(descriptor.get, "name", { + value: "get ignoreCase", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/multiline/length.js b/js/src/tests/test262/built-ins/RegExp/prototype/multiline/length.js index 08105090e0..c79cb88c99 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/multiline/length.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/multiline/length.js @@ -24,10 +24,11 @@ includes: [propertyHelper.js] var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "multiline"); -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/RegExp/prototype/multiline/name.js b/js/src/tests/test262/built-ins/RegExp/prototype/multiline/name.js index 674dec6f70..3fd0e3bce7 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/multiline/name.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/multiline/name.js @@ -14,13 +14,11 @@ includes: [propertyHelper.js] var descriptor = Object.getOwnPropertyDescriptor(RegExp.prototype, 'multiline'); -assert.sameValue( - descriptor.get.name, - 'get multiline' -); - -verifyNotEnumerable(descriptor.get, 'name'); -verifyNotWritable(descriptor.get, 'name'); -verifyConfigurable(descriptor.get, 'name'); +verifyProperty(descriptor.get, "name", { + value: "get multiline", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/sticky/length.js b/js/src/tests/test262/built-ins/RegExp/prototype/sticky/length.js index 220cf0a901..178f62270b 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/sticky/length.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/sticky/length.js @@ -24,10 +24,11 @@ includes: [propertyHelper.js] var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "sticky"); -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/RegExp/prototype/sticky/name.js b/js/src/tests/test262/built-ins/RegExp/prototype/sticky/name.js index 8fa5b1ac0f..b1c2120e47 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/sticky/name.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/sticky/name.js @@ -14,13 +14,11 @@ includes: [propertyHelper.js] var descriptor = Object.getOwnPropertyDescriptor(RegExp.prototype, 'sticky'); -assert.sameValue( - descriptor.get.name, - 'get sticky' -); - -verifyNotEnumerable(descriptor.get, 'name'); -verifyNotWritable(descriptor.get, 'name'); -verifyConfigurable(descriptor.get, 'name'); +verifyProperty(descriptor.get, "name", { + value: "get sticky", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/test/name.js b/js/src/tests/test262/built-ins/RegExp/prototype/test/name.js index 7ee8a9a2e7..dcfb6f1e1a 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/test/name.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/test/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(RegExp.prototype.test.name, "test"); - -verifyNotEnumerable(RegExp.prototype.test, "name"); -verifyNotWritable(RegExp.prototype.test, "name"); -verifyConfigurable(RegExp.prototype.test, "name"); +verifyProperty(RegExp.prototype.test, "name", { + value: "test", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/test/not-a-constructor.js b/js/src/tests/test262/built-ins/RegExp/prototype/test/not-a-constructor.js index ee6ce0aeaf..60422aca55 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/test/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/test/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let re = new RegExp(''); new re.test(); -}, '`let re = new RegExp(\'\'); new re.test()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/toString/name.js b/js/src/tests/test262/built-ins/RegExp/prototype/toString/name.js index 91fe5a8809..46da2536c2 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/toString/name.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/toString/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(RegExp.prototype.toString.name, "toString"); - -verifyNotEnumerable(RegExp.prototype.toString, "name"); -verifyNotWritable(RegExp.prototype.toString, "name"); -verifyConfigurable(RegExp.prototype.toString, "name"); +verifyProperty(RegExp.prototype.toString, "name", { + value: "toString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/toString/not-a-constructor.js b/js/src/tests/test262/built-ins/RegExp/prototype/toString/not-a-constructor.js index f064aaf64d..76b48034ed 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/toString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/toString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let re = new RegExp(''); new re.toString(); -}, '`let re = new RegExp(\'\'); new re.toString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/unicode/length.js b/js/src/tests/test262/built-ins/RegExp/prototype/unicode/length.js index 127e2d0428..c661157d48 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/unicode/length.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/unicode/length.js @@ -21,10 +21,11 @@ includes: [propertyHelper.js] var getter = Object.getOwnPropertyDescriptor(RegExp.prototype, 'unicode').get; -assert.sameValue(getter.length, 0); - -verifyNotEnumerable(getter, 'length'); -verifyNotWritable(getter, 'length'); -verifyConfigurable(getter, 'length'); +verifyProperty(getter, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/unicode/name.js b/js/src/tests/test262/built-ins/RegExp/prototype/unicode/name.js index 1e1858b46d..a152d919b5 100644 --- a/js/src/tests/test262/built-ins/RegExp/prototype/unicode/name.js +++ b/js/src/tests/test262/built-ins/RegExp/prototype/unicode/name.js @@ -28,10 +28,11 @@ includes: [propertyHelper.js] var getter = Object.getOwnPropertyDescriptor(RegExp.prototype, 'unicode').get; -assert.sameValue(getter.name, 'get unicode'); - -verifyNotEnumerable(getter, 'name'); -verifyNotWritable(getter, 'name'); -verifyConfigurable(getter, 'name'); +verifyProperty(getter, "name", { + value: "get unicode", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-dotAll-does-not-affect-dotAll-property.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-dotAll-does-not-affect-dotAll-property.js new file mode 100644 index 0000000000..7edf9b90a4 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-dotAll-does-not-affect-dotAll-property.js @@ -0,0 +1,49 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding dotAll (`s`) modifier does not affect RegExp instance `dotAll` property. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?s:)/; +assert(!re1.dotAll, "RegExp instance dotAll flag should not be set"); + +var re2 = new RegExp("(?s:)"); +assert(!re2.dotAll, "RegExp instance dotAll flag should not be set"); + +var re3 = /(?s-:)/; +assert(!re3.dotAll, "RegExp instance dotAll flag should not be set"); + +var re4 = new RegExp("(?s-:)"); +assert(!re4.dotAll, "RegExp instance dotAll flag should not be set"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-dotAll-does-not-affect-ignoreCase-flag.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-dotAll-does-not-affect-ignoreCase-flag.js new file mode 100644 index 0000000000..1ebb730625 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-dotAll-does-not-affect-ignoreCase-flag.js @@ -0,0 +1,67 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding dotAll (`s`) modifier in group should not affect ignoreCase (`i`) flag. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?s:.es)/; +assert(re1.test("aes"), "s should match s in modified group"); +assert(re1.test("\nes"), "s should match s in modified group"); +assert(!re1.test("aeS"), "s should not match S in modified group"); +assert(!re1.test("\neS"), "s should not match S in modified group"); + +var re2 = /(?s:.es)/i; +assert(re2.test("aes"), "s should match s in modified group"); +assert(re2.test("aeS"), "s should match S in modified group"); +assert(re2.test("\nes"), "s should match s in modified group"); +assert(re2.test("\neS"), "s should match S in modified group"); + +var re3 = /(?s-:.es)/; +assert(re3.test("aes"), "s should match s in modified group"); +assert(re3.test("\nes"), "s should match s in modified group"); +assert(!re3.test("aeS"), "s should not match S in modified group"); +assert(!re3.test("\neS"), "s should not match S in modified group"); + +var re4 = /(?s-:.es)/i; +assert(re4.test("aes"), "s should match s in modified group"); +assert(re4.test("aeS"), "s should match S in modified group"); +assert(re4.test("\nes"), "s should match s in modified group"); +assert(re4.test("\neS"), "s should match S in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-dotAll-does-not-affect-multiline-flag.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-dotAll-does-not-affect-multiline-flag.js new file mode 100644 index 0000000000..2f9adf75e3 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-dotAll-does-not-affect-multiline-flag.js @@ -0,0 +1,59 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding dotAll (`s`) modifier in group should not affect multiline (`m`) flag. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?s:.es$)/; +assert(re1.test("\nes"), ". should match newline in modified group"); +assert(!re1.test("\nes\nz"), "$ should not match newline in modified group"); + +var re2 = /(?s:.es$)/m; +assert(re2.test("\nes"), ". should match newline in modified group"); +assert(re2.test("\nes\nz"), "$ should match newline in modified group"); + +var re3 = /(?s-:.es$)/; +assert(re3.test("\nes"), ". should match newline in modified group"); +assert(!re3.test("\nes\nz"), "$ should not match newline in modified group"); + +var re4 = /(?s-:.es$)/m; +assert(re4.test("\nes"), ". should match newline in modified group"); +assert(re4.test("\nes\nz"), "$ should match newline in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-dotAll.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-dotAll.js new file mode 100644 index 0000000000..8c163adf54 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-dotAll.js @@ -0,0 +1,105 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + dotAll (`s`) modifier can be added via `(?s:)` or `(?s-:)`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?s:^.$)/; +assert(re1.test("a"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("3"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("π"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("\u2027"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("\u0085"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("\v"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re1.test("\f"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re1.test("\u180E"), "Pattern character '.' should match non-line terminators in modified group"); +assert(!re1.test("\u{10300}"), "Supplementary plane not matched by a single ."); +assert(re1.test("\n"), "Pattern character '.' should match line terminators in modified group"); +assert(re1.test("\r"), "Pattern character '.' should match line terminators in modified group"); +assert(re1.test("\u2028"), "Pattern character '.' should match line terminators in modified group"); +assert(re1.test("\u2029"), "Pattern character '.' should match line terminators in modified group"); +assert(re1.test("\uD800"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("\uDFFF"), "Pattern character '.' should match non-line terminators in modified group"); + +var re2 = new RegExp("(?s:^.$)"); +assert(re2.test("a"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("3"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("π"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("\u2027"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("\u0085"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("\v"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re2.test("\f"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re2.test("\u180E"), "Pattern character '.' should match non-line terminators in modified group"); +assert(!re2.test("\u{10300}"), "Supplementary plane not matched by a single ."); +assert(re2.test("\n"), "Pattern character '.' should match line terminators in modified group"); +assert(re2.test("\r"), "Pattern character '.' should match line terminators in modified group"); +assert(re2.test("\u2028"), "Pattern character '.' should match line terminators in modified group"); +assert(re2.test("\u2029"), "Pattern character '.' should match line terminators in modified group"); +assert(re2.test("\uD800"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("\uDFFF"), "Pattern character '.' should match non-line terminators in modified group"); + +var re3 = /(?s-:^.$)/; +assert(re3.test("a"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re3.test("3"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re3.test("π"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re3.test("\u2027"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re3.test("\u0085"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re3.test("\v"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re3.test("\f"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re3.test("\u180E"), "Pattern character '.' should match non-line terminators in modified group"); +assert(!re3.test("\u{10300}"), "Supplementary plane not matched by a single ."); +assert(re3.test("\n"), "Pattern character '.' should match line terminators in modified group"); +assert(re3.test("\r"), "Pattern character '.' should match line terminators in modified group"); +assert(re3.test("\u2028"), "Pattern character '.' should match line terminators in modified group"); +assert(re3.test("\u2029"), "Pattern character '.' should match line terminators in modified group"); +assert(re3.test("\uD800"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re3.test("\uDFFF"), "Pattern character '.' should match non-line terminators in modified group"); + +var re4 = new RegExp("(?s-:^.$)"); +assert(re4.test("a"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re4.test("3"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re4.test("π"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re4.test("\u2027"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re4.test("\u0085"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re4.test("\v"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re4.test("\f"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re4.test("\u180E"), "Pattern character '.' should match non-line terminators in modified group"); +assert(!re4.test("\u{10300}"), "Supplementary plane not matched by a single ."); +assert(re4.test("\n"), "Pattern character '.' should match line terminators in modified group"); +assert(re4.test("\r"), "Pattern character '.' should match line terminators in modified group"); +assert(re4.test("\u2028"), "Pattern character '.' should match line terminators in modified group"); +assert(re4.test("\u2029"), "Pattern character '.' should match line terminators in modified group"); +assert(re4.test("\uD800"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re4.test("\uDFFF"), "Pattern character '.' should match non-line terminators in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-backreferences.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-backreferences.js new file mode 100644 index 0000000000..53e9ecb991 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-backreferences.js @@ -0,0 +1,55 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding ignoreCase (`i`) modifier in group affects backreferences in group. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(a)(?i:\1)/; +assert(!re1.test("AA"), "a should not match first A"); +assert(!re1.test("Aa"), "a should not match A"); +assert(re1.test("aa"), "a matches first a, so \\1 should match second a"); +assert(re1.test("aA"), "a matches a, so \\1 should match A (ignores case)"); + +var re2 = /(a)(?i-:\1)/; +assert(!re2.test("AA"), "a should not match first A"); +assert(!re2.test("Aa"), "a should not match A"); +assert(re2.test("aa"), "a matches first a, so \\1 should match second a"); +assert(re2.test("aA"), "a matches a, so \\1 should match A (ignores case)"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-characterClasses.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-characterClasses.js new file mode 100644 index 0000000000..75c50a97fa --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-characterClasses.js @@ -0,0 +1,67 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding ignoreCase (`i`) modifier in group affects character classes in group. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?i:[ab])c/; +assert(re1.test("ac"), "[ab] should match a"); +assert(re1.test("Ac"), "[ab] should match A"); +assert(re1.test("bc"), "[ab] should match b"); +assert(re1.test("Bc"), "[ab] should match B"); + +var re2 = /(?i-:[ab])c/; +assert(re2.test("ac"), "[ab] should match a"); +assert(re2.test("Ac"), "[ab] should match A"); +assert(re2.test("bc"), "[ab] should match b"); +assert(re2.test("Bc"), "[ab] should match B"); + +var re3 = /(?i:[^ab])c/; +assert(!re3.test("ac"), "[^ab] should not match a"); +assert(!re3.test("Ac"), "[^ab] should not match A"); +assert(!re3.test("bc"), "[^ab] should not match b"); +assert(!re3.test("Bc"), "[^ab] should not match B"); + +var re4 = /(?i-:[^ab])c/; +assert(!re4.test("ac"), "[^ab] should not match a"); +assert(!re4.test("Ac"), "[^ab] should not match A"); +assert(!re4.test("bc"), "[^ab] should not match b"); +assert(!re4.test("Bc"), "[^ab] should not match B"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-characterEscapes.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-characterEscapes.js new file mode 100644 index 0000000000..98fa435027 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-characterEscapes.js @@ -0,0 +1,67 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding ignoreCase (`i`) modifier in group affects character escapes in group. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?i:\x61)b/; +assert(re1.test("ab"), "\\x61 should match a"); +assert(re1.test("Ab"), "\\x61 should match A"); + +var re2 = /(?i:\u0061)b/; +assert(re2.test("ab"), "\\u0061 should match a"); +assert(re2.test("Ab"), "\\u0061 should match A"); + +var re3 = /(?i:\u{0061})b/u; +assert(re3.test("ab"), "\\u0061 should match a"); +assert(re3.test("Ab"), "\\u0061 should match A"); + +var re4 = /(?i-:\x61)b/; +assert(re4.test("ab"), "\\x61 should match a"); +assert(re4.test("Ab"), "\\x61 should match A"); + +var re5 = /(?i-:\u0061)b/; +assert(re5.test("ab"), "\\u0061 should match a"); +assert(re5.test("Ab"), "\\u0061 should match A"); + +var re6 = /(?i-:\u{0061})b/u; +assert(re6.test("ab"), "\\u0061 should match a"); +assert(re6.test("Ab"), "\\u0061 should match A"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-lower-b.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-lower-b.js new file mode 100644 index 0000000000..a3f5b9f009 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-lower-b.js @@ -0,0 +1,77 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding ignoreCase (`i`) modifier affects matching for `\b`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + + GetWordCharacters ( modifiers ) + The abstract operation GetWordCharacters takes argument modifiers (a Modifiers Record) and returns a CharSet. It performs the following steps when called: + + 1. Let wordCharacters be the mathematical set that is the union of all sixty-three characters in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" (letters, numbers, and U+005F (LOW LINE) in the Unicode Basic Latin block) and all characters c for which c is not in that set but Canonicalize(c, modifiers) is. + 2. Return wordCharacters. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?i:\b)/; +assert(re1.test("A"), "\\b should match after A"); +assert(re1.test("a"), "\\b should match after a"); +assert(re1.test("z"), "\\b should match after z"); +assert(re1.test("Z"), "\\b should match after Z"); + +var re2 = /(?i:\b)/u; +assert(re2.test("A"), "\\b should match after A"); +assert(re2.test("a"), "\\b should match after a"); +assert(re2.test("z"), "\\b should match after z"); +assert(re2.test("Z"), "\\b should match after Z"); +assert(re2.test("\u017f"), "\\b should match after \u017f"); +assert(re2.test("\u212a"), "\\b should match after \u212a"); + +var re3 = /(?i-:\b)/; +assert(re3.test("A"), "\\b should match after A"); +assert(re3.test("a"), "\\b should match after a"); +assert(re3.test("z"), "\\b should match after z"); +assert(re3.test("Z"), "\\b should match after Z"); + +var re4 = /(?i-:\b)/u; +assert(re4.test("A"), "\\b should match after A"); +assert(re4.test("a"), "\\b should match after a"); +assert(re4.test("z"), "\\b should match after z"); +assert(re4.test("Z"), "\\b should match after Z"); +assert(re4.test("\u017f"), "\\b should match after \u017f"); +assert(re4.test("\u212a"), "\\b should match after \u212a"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-lower-p.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-lower-p.js new file mode 100644 index 0000000000..41788082ee --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-lower-p.js @@ -0,0 +1,61 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding ignoreCase (`i`) modifier affects matching for `\p{}`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + + GetWordCharacters ( modifiers ) + The abstract operation GetWordCharacters takes argument modifiers (a Modifiers Record) and returns a CharSet. It performs the following steps when called: + + 1. Let wordCharacters be the mathematical set that is the union of all sixty-three characters in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" (letters, numbers, and U+005F (LOW LINE) in the Unicode Basic Latin block) and all characters c for which c is not in that set but Canonicalize(c, modifiers) is. + 2. Return wordCharacters. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?i:\p{Lu})/u; +assert(re1.test("A"), "\\p{Lu} should match A"); +assert(re1.test("a"), "\\p{Lu} should match a (ignores case)"); +assert(re1.test("Z"), "\\p{Lu} should match Z"); +assert(re1.test("z"), "\\p{Lu} should match z (ignores case)"); + +var re2 = /(?i-:\p{Lu})/u; +assert(re2.test("A"), "\\p{Lu} should match A"); +assert(re2.test("a"), "\\p{Lu} should match a (ignores case)"); +assert(re2.test("Z"), "\\p{Lu} should match Z"); +assert(re2.test("z"), "\\p{Lu} should match z (ignores case)"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-lower-w.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-lower-w.js new file mode 100644 index 0000000000..324961d782 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-lower-w.js @@ -0,0 +1,77 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding ignoreCase (`i`) modifier affects matching for `\w`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + + GetWordCharacters ( modifiers ) + The abstract operation GetWordCharacters takes argument modifiers (a Modifiers Record) and returns a CharSet. It performs the following steps when called: + + 1. Let wordCharacters be the mathematical set that is the union of all sixty-three characters in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" (letters, numbers, and U+005F (LOW LINE) in the Unicode Basic Latin block) and all characters c for which c is not in that set but Canonicalize(c, modifiers) is. + 2. Return wordCharacters. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?i:\w)/; +assert(re1.test("A"), "\\w should match A"); +assert(re1.test("a"), "\\w should match a"); +assert(re1.test("z"), "\\w should match z"); +assert(re1.test("Z"), "\\w should match Z"); + +var re2 = /(?i:\w)/u; +assert(re2.test("A"), "\\w should match A"); +assert(re2.test("a"), "\\w should match a"); +assert(re2.test("z"), "\\w should match z"); +assert(re2.test("Z"), "\\w should match Z"); +assert(re2.test("\u017f"), "\\w should match \u017f"); +assert(re2.test("\u212a"), "\\w should match \u212a"); + +var re3 = /(?i-:\w)/; +assert(re3.test("A"), "\\w should match A"); +assert(re3.test("a"), "\\w should match a"); +assert(re3.test("z"), "\\w should match z"); +assert(re3.test("Z"), "\\w should match Z"); + +var re4 = /(?i-:\w)/u; +assert(re4.test("A"), "\\w should match A"); +assert(re4.test("a"), "\\w should match a"); +assert(re4.test("z"), "\\w should match z"); +assert(re4.test("Z"), "\\w should match Z"); +assert(re4.test("\u017f"), "\\w should match \u017f"); +assert(re4.test("\u212a"), "\\w should match \u212a"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-upper-b.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-upper-b.js new file mode 100644 index 0000000000..ffb346277f --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-upper-b.js @@ -0,0 +1,57 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding ignoreCase (`i`) modifier affects matching for `\B`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + + GetWordCharacters ( modifiers ) + The abstract operation GetWordCharacters takes argument modifiers (a Modifiers Record) and returns a CharSet. It performs the following steps when called: + + 1. Let wordCharacters be the mathematical set that is the union of all sixty-three characters in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" (letters, numbers, and U+005F (LOW LINE) in the Unicode Basic Latin block) and all characters c for which c is not in that set but Canonicalize(c, modifiers) is. + 2. Return wordCharacters. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?i:Z\B)/u; +assert(re1.test("Z\u017f"), "\\B should match between Z and \u017f"); +assert(re1.test("Z\u212a"), "\\B should match between Z and \u212a"); + +var re2 = /(?i-:Z\B)/u; +assert(re2.test("Z\u017f"), "\\B should match between Z and \u017f"); +assert(re2.test("Z\u212a"), "\\B should match between Z and \u212a"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-upper-p.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-upper-p.js new file mode 100644 index 0000000000..d5f30655cb --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-upper-p.js @@ -0,0 +1,63 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding ignoreCase (`i`) modifier affects matching for `\P{}`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + + GetWordCharacters ( modifiers ) + The abstract operation GetWordCharacters takes argument modifiers (a Modifiers Record) and returns a CharSet. It performs the following steps when called: + + 1. Let wordCharacters be the mathematical set that is the union of all sixty-three characters in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" (letters, numbers, and U+005F (LOW LINE) in the Unicode Basic Latin block) and all characters c for which c is not in that set but Canonicalize(c, modifiers) is. + 2. Return wordCharacters. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?i:\P{Lu})/u; +assert(re1.test("A"), "\\P{Lu} should match A (ignores case)"); +assert(re1.test("a"), "\\P{Lu} should match a"); +assert(re1.test("Z"), "\\P{Lu} should match Z (ignores case)"); +assert(re1.test("z"), "\\P{Lu} should match z"); +assert(re1.test("0"), "\\P{Lu} should match 0"); + +var re2 = /(?i-:\P{Lu})/u; +assert(re2.test("A"), "\\P{Lu} should match A (ignores case)"); +assert(re2.test("a"), "\\P{Lu} should match a"); +assert(re2.test("Z"), "\\P{Lu} should match Z (ignores case)"); +assert(re2.test("z"), "\\P{Lu} should match z"); +assert(re2.test("0"), "\\P{Lu} should match 0"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-upper-w.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-upper-w.js new file mode 100644 index 0000000000..a0c527efa2 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-affects-slash-upper-w.js @@ -0,0 +1,57 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding ignoreCase (`i`) modifier affects matching for `\W`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + + GetWordCharacters ( modifiers ) + The abstract operation GetWordCharacters takes argument modifiers (a Modifiers Record) and returns a CharSet. It performs the following steps when called: + + 1. Let wordCharacters be the mathematical set that is the union of all sixty-three characters in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" (letters, numbers, and U+005F (LOW LINE) in the Unicode Basic Latin block) and all characters c for which c is not in that set but Canonicalize(c, modifiers) is. + 2. Return wordCharacters. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?i:\W)/u; +assert(!re1.test("\u017f"), "\\W should not match \u017f"); +assert(!re1.test("\u212a"), "\\W should not match \u212a"); + +var re2 = /(?i-:\W)/u; +assert(!re2.test("\u017f"), "\\W should not match \u017f"); +assert(!re2.test("\u212a"), "\\W should not match \u212a"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-does-not-affect-dotAll-flag.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-does-not-affect-dotAll-flag.js new file mode 100644 index 0000000000..999598c492 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-does-not-affect-dotAll-flag.js @@ -0,0 +1,67 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding ignoreCase (`i`) modifier in group should not affect dotAll (`s`) flag. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?i:.es)/; +assert(re1.test("aes"), ". should match a in modified group"); +assert(re1.test("aeS"), ". should match a in modified group"); +assert(!re1.test("\nes"), ". should not match newline in modified group"); +assert(!re1.test("\neS"), ". should not match newline in modified group"); + +var re2 = /(?i:.es)/s; +assert(re2.test("aes"), ". should match a in modified group"); +assert(re2.test("aeS"), ". should match a in modified group"); +assert(re2.test("\nes"), ". should match newline in modified group"); +assert(re2.test("\neS"), ". should match newline in modified group"); + +var re3 = /(?i-:.es)/; +assert(re3.test("aes"), ". should match a in modified group"); +assert(re3.test("aeS"), ". should match a in modified group"); +assert(!re3.test("\nes"), ". should not match newline in modified group"); +assert(!re3.test("\neS"), ". should not match newline in modified group"); + +var re4 = /(?i-:.es)/s; +assert(re4.test("aes"), ". should match a in modified group"); +assert(re4.test("aeS"), ". should match a in modified group"); +assert(re4.test("\nes"), ". should match newline in modified group"); +assert(re4.test("\neS"), ". should match newline in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-does-not-affect-ignoreCase-property.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-does-not-affect-ignoreCase-property.js new file mode 100644 index 0000000000..24da245c46 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-does-not-affect-ignoreCase-property.js @@ -0,0 +1,55 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding ignoreCase (`i`) modifier does not affect RegExp instance `ignoreCase` property. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?i:)/; +assert(!re1.ignoreCase, "RegExp instance ignoreCase property should not be set"); + +var re2 = new RegExp("(?i:)"); +assert(!re2.ignoreCase, "RegExp instance ignoreCase property should not be set"); + +var re3 = /(?i-:)/; +assert(!re3.ignoreCase, "RegExp instance ignoreCase property should not be set"); + +var re4 = new RegExp("(?i-:)"); +assert(!re4.ignoreCase, "RegExp instance ignoreCase property should not be set"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-does-not-affect-multiline-flag.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-does-not-affect-multiline-flag.js new file mode 100644 index 0000000000..692cfd9f2f --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase-does-not-affect-multiline-flag.js @@ -0,0 +1,67 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding ignoreCase (`i`) modifier in group should not affect multiline (`m`) flag. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?i:es$)/; +assert(re1.test("es"), "s should match s in modified group"); +assert(re1.test("eS"), "s should match S in modified group"); +assert(!re1.test("es\nz"), "$ should not match newline in modified group"); +assert(!re1.test("eS\nz"), "$ should not match newline in modified group"); + +var re2 = /(?i:es$)/m; +assert(re2.test("es"), "s should match s in modified group"); +assert(re2.test("eS"), "s should match S in modified group"); +assert(re2.test("es\nz"), "$ should match newline in modified group"); +assert(re2.test("eS\nz"), "$ should match newline in modified group"); + +var re3 = /(?i-:es$)/; +assert(re3.test("es"), "s should match s in modified group"); +assert(re3.test("eS"), "s should match S in modified group"); +assert(!re3.test("es\nz"), "$ should not match newline in modified group"); +assert(!re3.test("eS\nz"), "$ should not match newline in modified group"); + +var re4 = /(?i-:es$)/m; +assert(re4.test("es"), "s should match s in modified group"); +assert(re4.test("eS"), "s should match S in modified group"); +assert(re4.test("es\nz"), "$ should match newline in modified group"); +assert(re4.test("eS\nz"), "$ should match newline in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase.js new file mode 100644 index 0000000000..bd07e7aa22 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-ignoreCase.js @@ -0,0 +1,47 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + ignoreCase (`i`) modifier can be added via `(?i:)` or `(?i-:)`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?i:a)b/; +assert(!re1.test("AB"), "b should not match B in AB"); +assert(re1.test("Ab"), "a should match A in AB"); +assert(re1.test("ab"), "should match AB"); + +var re2 = new RegExp("(?i:a)b"); +assert(!re2.test("AB"), "b should not match B in AB"); +assert(re2.test("Ab"), "a should match A in AB"); +assert(re2.test("ab"), "should match AB"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-multiline-does-not-affect-dotAll-flag.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-multiline-does-not-affect-dotAll-flag.js new file mode 100644 index 0000000000..c065d293ac --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-multiline-does-not-affect-dotAll-flag.js @@ -0,0 +1,59 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding multiline (`m`) modifier in group should not affect dotAll (`s`) flag. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?m:es.$)/; +assert(re1.test("esz\n"), "$ should match newline in modified group"); +assert(!re1.test("es\n\n"), ". should not match newline in modified group"); + +var re2 = /(?m:es.$)/s; +assert(re2.test("esz\n"), "$ should match newline in modified group"); +assert(re2.test("es\n\n"), ". should match newline in modified group"); + +var re3 = /(?m-:es.$)/; +assert(re3.test("esz\n"), "$ should match newline in modified group"); +assert(!re3.test("es\n\n"), ". should not match newline in modified group"); + +var re4 = /(?m-:es.$)/s; +assert(re4.test("esz\n"), "$ should match newline in modified group"); +assert(re4.test("es\n\n"), ". should match newline in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-multiline-does-not-affect-ignoreCase-flag.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-multiline-does-not-affect-ignoreCase-flag.js new file mode 100644 index 0000000000..b8b33e9c22 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-multiline-does-not-affect-ignoreCase-flag.js @@ -0,0 +1,67 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding multiline (`m`) modifier in group should not affect ignoreCase (`i`) flag. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?m:es$)/; +assert(re1.test("es"), "s should match s in modified group"); +assert(!re1.test("eS"), "s should not match S in modified group"); +assert(re1.test("es\nz"), "$ should match newline in modified group"); +assert(!re1.test("eS\nz"), "s should not match S in modified group"); + +var re2 = /(?m:es$)/i; +assert(re2.test("es"), "s should match s in modified group"); +assert(re2.test("eS"), "s should match S in modified group"); +assert(re2.test("es\nz"), "$ should match newline in modified group"); +assert(re2.test("eS\nz"), "$ should match newline in modified group"); + +var re3 = /(?m-:es$)/; +assert(re3.test("es"), "s should match s in modified group"); +assert(!re3.test("eS"), "s should not match S in modified group"); +assert(re3.test("es\nz"), "$ should match newline in modified group"); +assert(!re3.test("eS\nz"), "s should not match S in modified group"); + +var re4 = /(?m-:es$)/i; +assert(re4.test("es"), "s should match s in modified group"); +assert(re4.test("eS"), "s should match S in modified group"); +assert(re4.test("es\nz"), "$ should match newline in modified group"); +assert(re4.test("eS\nz"), "$ should match newline in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-multiline-does-not-affect-multiline-property.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-multiline-does-not-affect-multiline-property.js new file mode 100644 index 0000000000..3b960f5a6c --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-multiline-does-not-affect-multiline-property.js @@ -0,0 +1,49 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Adding multiline (`m`) modifier does not affect RegExp instance `multiline` property. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?m:)/; +assert(!re1.multiline, "RegExp instance multiline flag should not be set"); + +var re2 = new RegExp("(?m:)"); +assert(!re2.multiline, "RegExp instance multiline flag should not be set"); + +var re3 = /(?m-:)/; +assert(!re3.multiline, "RegExp instance multiline flag should not be set"); + +var re4 = new RegExp("(?m-:)"); +assert(!re4.multiline, "RegExp instance multiline flag should not be set"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-multiline.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-multiline.js new file mode 100644 index 0000000000..ee1d0a65cc --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-multiline.js @@ -0,0 +1,49 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + multiline (`m`) modifier can be added via `(?m:)` or `(?m-:)`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?m:es$)/; +assert(re1.test("es\ns"), "$ should match newline in modified group"); + +var re2 = new RegExp("(?m:es$)"); +assert(re2.test("es\ns"), "$ should match newline in modified group"); + +var re3 = /(?m-:es$)/; +assert(re3.test("es\ns"), "$ should match newline in modified group"); + +var re4 = new RegExp("(?m-:es$)"); +assert(re4.test("es\ns"), "$ should match newline in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-remove-modifiers.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-remove-modifiers.js new file mode 100644 index 0000000000..68e4761cfc --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/add-remove-modifiers.js @@ -0,0 +1,45 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Modifiers can be both added and removed via `(?ims-ims:)`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?m-i:^a$)/i; +assert(!re1.test("A\n"), "Should not match 'A\\n'"); +assert(re1.test("a\n"), "Should match 'a\\n'"); + +var re2 = new RegExp("(?m-i:^a$)", "i"); +assert(!re2.test("A\n"), "Should not match 'A\\n'"); +assert(re2.test("a\n"), "Should match 'a\\n'"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/browser.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/changing-dotAll-flag-does-not-affect-dotAll-modifier.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/changing-dotAll-flag-does-not-affect-dotAll-modifier.js new file mode 100644 index 0000000000..b275621155 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/changing-dotAll-flag-does-not-affect-dotAll-modifier.js @@ -0,0 +1,77 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + New dotAll (`s`) flag from RegExp constructor does not affect dotAll modifier in group. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = new RegExp(/(?s:^.$)/s, ""); +assert(re1.test("a"), "Pattern character '.' still should match non-line terminators in modified group"); +assert(re1.test("3"), "Pattern character '.' still should match non-line terminators in modified group"); +assert(re1.test("π"), "Pattern character '.' still should match non-line terminators in modified group"); +assert(re1.test("\u2027"), "Pattern character '.' still should match non-line terminators in modified group"); +assert(re1.test("\u0085"), "Pattern character '.' still should match non-line terminators in modified group"); +assert(re1.test("\v"), "Pattern character '.' still should match mon-line terminators in modified group"); +assert(re1.test("\f"), "Pattern character '.' still should match mon-line terminators in modified group"); +assert(re1.test("\u180E"), "Pattern character '.' still should match non-line terminators in modified group"); +assert(!re1.test("\u{10300}"), "Supplementary plane still not matched by a single ."); +assert(re1.test("\n"), "Pattern character '.' still should match line terminators in modified group"); +assert(re1.test("\r"), "Pattern character '.' still should match line terminators in modified group"); +assert(re1.test("\u2028"), "Pattern character '.' still should match line terminators in modified group"); +assert(re1.test("\u2029"), "Pattern character '.' still should match line terminators in modified group"); +assert(re1.test("\uD800"), "Pattern character '.' still should match non-line terminators in modified group"); +assert(re1.test("\uDFFF"), "Pattern character '.' still should match non-line terminators in modified group"); + +var re2 = new RegExp(/(?-s:^.$)/, "s"); +assert(re2.test("a"), "Pattern character '.' still should match non-line terminators in modified group"); +assert(re2.test("3"), "Pattern character '.' still should match non-line terminators in modified group"); +assert(re2.test("π"), "Pattern character '.' still should match non-line terminators in modified group"); +assert(re2.test("\u2027"), "Pattern character '.' still should match non-line terminators in modified group"); +assert(re2.test("\u0085"), "Pattern character '.' still should match non-line terminators in modified group"); +assert(re2.test("\v"), "Pattern character '.' still should match mon-line terminators in modified group"); +assert(re2.test("\f"), "Pattern character '.' still should match mon-line terminators in modified group"); +assert(re2.test("\u180E"), "Pattern character '.' still should match non-line terminators in modified group"); +assert(!re2.test("\u{10300}"), "Supplementary plane still not matched by a single ."); +assert(!re2.test("\n"), "Pattern character '.' still should not match '\\n' in modified group"); +assert(!re2.test("\r"), "Pattern character '.' still should not match '\\r' in modified group"); +assert(!re2.test("\u2028"), "Pattern character '.' still should not match '\\u2028' in modified group"); +assert(!re2.test("\u2029"), "Pattern character '.' still should not match '\\u2029' in modified group"); +assert(re2.test("\uD800"), "Pattern character '.' still should match non-line terminators in modified group"); +assert(re2.test("\uDFFF"), "Pattern character '.' still should match non-line terminators in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/changing-ignoreCase-flag-does-not-affect-ignoreCase-modifier.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/changing-ignoreCase-flag-does-not-affect-ignoreCase-modifier.js new file mode 100644 index 0000000000..8db72f0742 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/changing-ignoreCase-flag-does-not-affect-ignoreCase-modifier.js @@ -0,0 +1,55 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + New ignoreCase (`i`) flag from RegExp constructor does not affect ignoreCase modifier in group. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = new RegExp(/(?i:aB)/i, ""); +assert(re1.test("AB"), "still should ignore case in modified group"); +assert(re1.test("Ab"), "still should ignore case in modified group"); +assert(re1.test("aB"), "still should ignore case in modified group"); +assert(re1.test("ab"), "still should ignore case in modified group"); + +var re2 = new RegExp(/(?-i:aB)/, "i"); +assert(!re2.test("AB"), "still should preserve case in modified group"); +assert(!re2.test("Ab"), "still should preserve case in modified group"); +assert(!re2.test("ab"), "still should preserve case in modified group"); +assert(re2.test("aB"), "still should preserve case in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/changing-multiline-flag-does-not-affect-multiline-modifier.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/changing-multiline-flag-does-not-affect-multiline-modifier.js new file mode 100644 index 0000000000..b890200b21 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/changing-multiline-flag-does-not-affect-multiline-modifier.js @@ -0,0 +1,51 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + New multiline (`m`) flag from RegExp constructor does not affect multiline modifier in group. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = new RegExp(/(?m:es$)/m, ""); +assert(re1.test("es"), "$ still should match end of input in modified group"); +assert(re1.test("es\ns"), "$ still should match newline in modified group"); + +var re2 = new RegExp(/^(?-m:es$)/, "m"); +assert(re2.test("es"), "$ still should match end of input in modified group"); +assert(!re2.test("es\ns"), "$ still should not match newline in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nested-add-remove-modifiers.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nested-add-remove-modifiers.js new file mode 100644 index 0000000000..f2e1052643 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nested-add-remove-modifiers.js @@ -0,0 +1,45 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Modifiers can be nested. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?m:^(?-i:a)$)/i; +assert(!re1.test("A\n"), "Should not match 'A\\n'"); +assert(re1.test("a\n"), "Should match 'a\\n'"); + +var re2 = new RegExp("(?m:^(?-i:a)$)", "i"); +assert(!re2.test("A\n"), "Should not match 'A\\n'"); +assert(re2.test("a\n"), "Should match 'a\\n'"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-add-dotAll-within-remove-dotAll.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-add-dotAll-within-remove-dotAll.js new file mode 100644 index 0000000000..26b7d760b4 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-add-dotAll-within-remove-dotAll.js @@ -0,0 +1,71 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Can add multiline (`m`) modifier for group nested within a group that removes multiline modifier. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-s:(?s:^.$))/s; +assert(re1.test("a"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("3"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("π"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("\u2027"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("\u0085"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("\v"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re1.test("\f"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re1.test("\u180E"), "Pattern character '.' should match non-line terminators in modified group"); +assert(!re1.test("\u{10300}"), "Supplementary plane not matched by a single ."); +assert(re1.test("\n"), "Pattern character '.' should match line terminators in modified group"); +assert(re1.test("\r"), "Pattern character '.' should match line terminators in modified group"); +assert(re1.test("\u2028"), "Pattern character '.' should match line terminators in modified group"); +assert(re1.test("\u2029"), "Pattern character '.' should match line terminators in modified group"); +assert(re1.test("\uD800"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("\uDFFF"), "Pattern character '.' should match non-line terminators in modified group"); + +var re2 = /(?-s:(?s-:^.$))/s; +assert(re2.test("a"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("3"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("π"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("\u2027"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("\u0085"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("\v"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re2.test("\f"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re2.test("\u180E"), "Pattern character '.' should match non-line terminators in modified group"); +assert(!re2.test("\u{10300}"), "Supplementary plane not matched by a single ."); +assert(re2.test("\n"), "Pattern character '.' should match line terminators in modified group"); +assert(re2.test("\r"), "Pattern character '.' should match line terminators in modified group"); +assert(re2.test("\u2028"), "Pattern character '.' should match line terminators in modified group"); +assert(re2.test("\u2029"), "Pattern character '.' should match line terminators in modified group"); +assert(re2.test("\uD800"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("\uDFFF"), "Pattern character '.' should match non-line terminators in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-add-ignoreCase-within-remove-ignoreCase.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-add-ignoreCase-within-remove-ignoreCase.js new file mode 100644 index 0000000000..04103802c6 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-add-ignoreCase-within-remove-ignoreCase.js @@ -0,0 +1,45 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Can add ignoreCase (`i`) modifier for group nested within a group that removes ignoreCase modifier. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-i:a(?i:b))c/i; +assert(!re1.test("ABC"), "a should not match A in ABC"); +assert(!re1.test("ABc"), "a should not match A in ABc"); +assert(!re1.test("Abc"), "a should not match A in Abc"); +assert(re1.test("aBc"), "b should match B in aBc"); +assert(re1.test("abC"), "c should match C in abC"); +assert(re1.test("abc"), "should match abc"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-add-multiline-within-remove-multiline.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-add-multiline-within-remove-multiline.js new file mode 100644 index 0000000000..dcf7504067 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-add-multiline-within-remove-multiline.js @@ -0,0 +1,47 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Can add multiline (`m`) modifier for group nested within a group that removes multiline modifier. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-m:es(?m:$)|js$)/m; +assert(re1.test("es\ns"), "$ should match newline in modified group"); +assert(re1.test("js"), "$ should match end of input in nested modified group"); +assert(!re1.test("js\ns"), "$ should not match newline in nested modified group"); + +var re2 = /(?-m:es(?m-:$)|js$)/m; +assert(re2.test("es\ns"), "$ should match newline in modified group"); +assert(re2.test("js"), "$ should match end of input in nested modified group"); +assert(!re2.test("js\ns"), "$ should not match newline in nested modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-remove-dotAll-within-add-dotAll.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-remove-dotAll-within-add-dotAll.js new file mode 100644 index 0000000000..e62290bedd --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-remove-dotAll-within-add-dotAll.js @@ -0,0 +1,71 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Can remove multiline (`m`) modifier for group nested within a group that adds multiline modifier. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?s:(?-s:^.$))/; +assert(re1.test("a"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("3"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("π"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("\u2027"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("\u0085"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("\v"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re1.test("\f"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re1.test("\u180E"), "Pattern character '.' should match non-line terminators in modified group"); +assert(!re1.test("\u{10300}"), "Supplementary plane not matched by a single ."); +assert(!re1.test("\n"), "Pattern character '.' should not match '\\n' in modified group"); +assert(!re1.test("\r"), "Pattern character '.' should not match '\\r' in modified group"); +assert(!re1.test("\u2028"), "Pattern character '.' should not match '\\u2028' in modified group"); +assert(!re1.test("\u2029"), "Pattern character '.' should not match '\\u2029' in modified group"); +assert(re1.test("\uD800"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("\uDFFF"), "Pattern character '.' should match non-line terminators in modified group"); + +var re2 = /(?s-:(?-s:^.$))/; +assert(re2.test("a"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("3"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("π"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("\u2027"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("\u0085"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("\v"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re2.test("\f"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re2.test("\u180E"), "Pattern character '.' should match non-line terminators in modified group"); +assert(!re2.test("\u{10300}"), "Supplementary plane not matched by a single ."); +assert(!re2.test("\n"), "Pattern character '.' should not match '\\n' in modified group"); +assert(!re2.test("\r"), "Pattern character '.' should not match '\\r' in modified group"); +assert(!re2.test("\u2028"), "Pattern character '.' should not match '\\u2028' in modified group"); +assert(!re2.test("\u2029"), "Pattern character '.' should not match '\\u2029' in modified group"); +assert(re2.test("\uD800"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("\uDFFF"), "Pattern character '.' should match non-line terminators in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-remove-ignoreCase-within-add-ignoreCase.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-remove-ignoreCase-within-add-ignoreCase.js new file mode 100644 index 0000000000..6b260ab2cc --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-remove-ignoreCase-within-add-ignoreCase.js @@ -0,0 +1,45 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Can remove ignoreCase (`i`) modifier for group nested within a group that adds ignoreCase modifier. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-i:a(?i:b))c/i; +assert(!re1.test("ABC"), "a should not match A in ABC"); +assert(!re1.test("ABc"), "a should not match A in ABc"); +assert(!re1.test("Abc"), "a should not match A in Abc"); +assert(re1.test("aBc"), "b should match B in aBc"); +assert(re1.test("abC"), "c should match C in abC"); +assert(re1.test("abc"), "should match abc"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-remove-multiline-within-add-multiline.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-remove-multiline-within-add-multiline.js new file mode 100644 index 0000000000..b7aa1b9895 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/nesting-remove-multiline-within-add-multiline.js @@ -0,0 +1,47 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Can remove multiline (`m`) modifier for group nested within a group that adds multiline modifier. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?m:es$|(?-m:js$))/; +assert(re1.test("es\ns"), "first $ should match newline in modified group"); +assert(re1.test("js"), "second $ should match end of input in nested modified group"); +assert(!re1.test("js\ns"), "second $ should not match newline in nested modified group"); + +var re2 = /(?m-:es$|(?-m:js$))/; +assert(re2.test("es\ns"), "first $ should match newline in modified group"); +assert(re2.test("js"), "second $ should match end of input in nested modified group"); +assert(!re2.test("js\ns"), "second $ should not match newline in nested modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-dotAll-does-not-affect-dotAll-property.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-dotAll-does-not-affect-dotAll-property.js new file mode 100644 index 0000000000..23e607be8d --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-dotAll-does-not-affect-dotAll-property.js @@ -0,0 +1,43 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing dotAll (`s`) modifier does not affect RegExp instance `dotAll` property. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-s:^.$)/s; +assert(re1.dotAll, "RegExp instance dotAll flag should still be set"); + +var re2 = new RegExp("(?-s:^.$)", "s"); +assert(re2.dotAll, "RegExp instance dotAll flag should still be set"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-dotAll-does-not-affect-ignoreCase-flag.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-dotAll-does-not-affect-ignoreCase-flag.js new file mode 100644 index 0000000000..2ccd21b4e2 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-dotAll-does-not-affect-ignoreCase-flag.js @@ -0,0 +1,49 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing dotAll (`s`) modifier in group should not affect ignoreCase (`i`) flag. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-s:.es)/s; +assert(re1.test("aes"), "s should match s in modified group"); +assert(!re1.test("aeS"), "s should not match S in modified group"); +assert(!re1.test("\nes"), ". should not match newline in modified group"); +assert(!re1.test("\neS"), ". should not match newline in modified group"); + +var re2 = /(?-s:.es)/si; +assert(re2.test("aes"), "s should match s in modified group"); +assert(re2.test("aeS"), "s should match S in modified group"); +assert(!re2.test("\nes"), ". should not match newline in modified group"); +assert(!re2.test("\neS"), ". should not match newline in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-dotAll-does-not-affect-multiline-flag.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-dotAll-does-not-affect-multiline-flag.js new file mode 100644 index 0000000000..1f73afc52c --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-dotAll-does-not-affect-multiline-flag.js @@ -0,0 +1,49 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing dotAll (`s`) modifier in group should not affect multiline (`m`) flag. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-s:.es$)/s; +assert(re1.test("aes"), ". should match a in modified group"); +assert(!re1.test("aes\nz"), "$ should not match newline in modified group"); +assert(!re1.test("\nes"), ". should not match newline in modified group"); +assert(!re1.test("\nes\nz"), "$ should not match newline in modified group"); + +var re2 = /(?-s:.es$)/sm; +assert(re2.test("aes"), ". should match a in modified group"); +assert(re2.test("aes\nz"), "$ should match newline in modified group"); +assert(!re2.test("\nes"), ". should not match newline in modified group"); +assert(!re2.test("\nes\nz"), ". should not match newline in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-dotAll.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-dotAll.js new file mode 100644 index 0000000000..8abed77808 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-dotAll.js @@ -0,0 +1,71 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + dotAll (`s`) modifier can be added via `(?s:)` or `(?s-:)`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-s:^.$)/s; +assert(re1.test("a"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("3"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("π"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("\u2027"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("\u0085"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("\v"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re1.test("\f"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re1.test("\u180E"), "Pattern character '.' should match non-line terminators in modified group"); +assert(!re1.test("\u{10300}"), "Supplementary plane not matched by a single ."); +assert(!re1.test("\n"), "Pattern character '.' should not match '\\n' in modified group"); +assert(!re1.test("\r"), "Pattern character '.' should not match '\\r' in modified group"); +assert(!re1.test("\u2028"), "Pattern character '.' should not match '\\u2028' in modified group"); +assert(!re1.test("\u2029"), "Pattern character '.' should not match '\\u2029' in modified group"); +assert(re1.test("\uD800"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re1.test("\uDFFF"), "Pattern character '.' should match non-line terminators in modified group"); + +var re2 = new RegExp("(?-s:^.$)", "s"); +assert(re2.test("a"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("3"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("π"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("\u2027"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("\u0085"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("\v"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re2.test("\f"), "Pattern character '.' should match mon-line terminators in modified group"); +assert(re2.test("\u180E"), "Pattern character '.' should match non-line terminators in modified group"); +assert(!re2.test("\u{10300}"), "Supplementary plane not matched by a single ."); +assert(!re2.test("\n"), "Pattern character '.' should not match '\\n' in modified group"); +assert(!re2.test("\r"), "Pattern character '.' should not match '\\r' in modified group"); +assert(!re2.test("\u2028"), "Pattern character '.' should not match '\\u2028' in modified group"); +assert(!re2.test("\u2029"), "Pattern character '.' should not match '\\u2029' in modified group"); +assert(re2.test("\uD800"), "Pattern character '.' should match non-line terminators in modified group"); +assert(re2.test("\uDFFF"), "Pattern character '.' should match non-line terminators in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-backreferences.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-backreferences.js new file mode 100644 index 0000000000..1d1767651b --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-backreferences.js @@ -0,0 +1,43 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing ignoreCase (`i`) modifier in group affects backreferences in group. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(a)(?-i:\1)/i; +assert(re1.test("AA"), "a matches first A, so \\1 should match second A"); +assert(!re1.test("aA"), "a matches a, so \\1 should not match A (preserves case)"); +assert(!re1.test("Aa"), "a matches A, so \\1 should not match a (preserves case)"); +assert(re1.test("aa"), "a matches first a, so \\1 should match second a"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-characterClasses.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-characterClasses.js new file mode 100644 index 0000000000..fbe2d16256 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-characterClasses.js @@ -0,0 +1,55 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing ignoreCase (`i`) modifier in group affects character classes in group. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-i:[ab])c/i; +assert(re1.test("ac"), "[ab] should match a"); +assert(!re1.test("Ac"), "[ab] should not match A"); +assert(re1.test("bc"), "[ab] should match b"); +assert(!re1.test("Bc"), "[ab] should not match B"); + +var re2 = /(?-i:[^ab])c/i; +assert(!re2.test("ac"), "[^ab] should not match a"); +assert(re2.test("Ac"), "[^ab] should match A"); +assert(!re2.test("bc"), "[^ab] should not match b"); +assert(re2.test("Bc"), "[^ab] should match B"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-characterEscapes.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-characterEscapes.js new file mode 100644 index 0000000000..1edb2d2124 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-characterEscapes.js @@ -0,0 +1,52 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing ignoreCase (`i`) modifier in group affects character escapes in group. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-i:\x61)b/i; +assert(re1.test("ab"), "\\x61 should match a"); +assert(re1.test("aB"), "b should match B"); +assert(!re1.test("Ab"), "\\x61 should not match A"); + +var re2 = /(?-i:\u0061)b/i; +assert(re2.test("ab"), "\\u0061 should match a"); +assert(re2.test("aB"), "b should match B"); +assert(!re2.test("Ab"), "\\u0061 should not match A"); + +var re3 = /(?-i:\u{0061})b/iu; +assert(re3.test("ab"), "\\u0061 should match a"); +assert(re3.test("aB"), "b should match B"); +assert(!re3.test("Ab"), "\\u0061 should not match A"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-lower-b.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-lower-b.js new file mode 100644 index 0000000000..b8b51d794b --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-lower-b.js @@ -0,0 +1,53 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing ignoreCase (`i`) modifier affects matching for `\b`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + + GetWordCharacters ( modifiers ) + The abstract operation GetWordCharacters takes argument modifiers (a Modifiers Record) and returns a CharSet. It performs the following steps when called: + + 1. Let wordCharacters be the mathematical set that is the union of all sixty-three characters in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" (letters, numbers, and U+005F (LOW LINE) in the Unicode Basic Latin block) and all characters c for which c is not in that set but Canonicalize(c, modifiers) is. + 2. Return wordCharacters. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-i:\b)/ui; +assert(!re1.test("\u017f"), "\\b should not match after \u017f"); +assert(!re1.test("\u212a"), "\\b should not match after \u212a"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-lower-p.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-lower-p.js new file mode 100644 index 0000000000..2a0167b689 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-lower-p.js @@ -0,0 +1,55 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing ignoreCase (`i`) modifier affects matching for `\p{}`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + + GetWordCharacters ( modifiers ) + The abstract operation GetWordCharacters takes argument modifiers (a Modifiers Record) and returns a CharSet. It performs the following steps when called: + + 1. Let wordCharacters be the mathematical set that is the union of all sixty-three characters in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" (letters, numbers, and U+005F (LOW LINE) in the Unicode Basic Latin block) and all characters c for which c is not in that set but Canonicalize(c, modifiers) is. + 2. Return wordCharacters. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-i:\p{Lu})/ui; +assert(re1.test("A"), "\\p{Lu} should match A"); +assert(!re1.test("a"), "\\p{Lu} should not match a"); +assert(re1.test("Z"), "\\p{Lu} should match Z"); +assert(!re1.test("z"), "\\p{Lu} should not match z"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-lower-w.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-lower-w.js new file mode 100644 index 0000000000..e8686f2e9d --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-lower-w.js @@ -0,0 +1,53 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing ignoreCase (`i`) modifier affects matching for `\w`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + + GetWordCharacters ( modifiers ) + The abstract operation GetWordCharacters takes argument modifiers (a Modifiers Record) and returns a CharSet. It performs the following steps when called: + + 1. Let wordCharacters be the mathematical set that is the union of all sixty-three characters in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" (letters, numbers, and U+005F (LOW LINE) in the Unicode Basic Latin block) and all characters c for which c is not in that set but Canonicalize(c, modifiers) is. + 2. Return wordCharacters. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-i:\w)/ui; +assert(!re1.test("\u017f"), "\\w should not match \u017f"); +assert(!re1.test("\u212a"), "\\w should not match \u212a"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-upper-b.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-upper-b.js new file mode 100644 index 0000000000..9ed611bbe9 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-upper-b.js @@ -0,0 +1,53 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing ignoreCase (`i`) modifier affects matching for `\B`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + + GetWordCharacters ( modifiers ) + The abstract operation GetWordCharacters takes argument modifiers (a Modifiers Record) and returns a CharSet. It performs the following steps when called: + + 1. Let wordCharacters be the mathematical set that is the union of all sixty-three characters in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" (letters, numbers, and U+005F (LOW LINE) in the Unicode Basic Latin block) and all characters c for which c is not in that set but Canonicalize(c, modifiers) is. + 2. Return wordCharacters. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-i:Z\B)/ui; +assert(!re1.test("Z\u017f"), "\\B should not match between Z and \u017f"); +assert(!re1.test("Z\u212a"), "\\B should not match between Z and \u212a"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-upper-p.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-upper-p.js new file mode 100644 index 0000000000..c764e66610 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-upper-p.js @@ -0,0 +1,56 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing ignoreCase (`i`) modifier affects matching for `\P{}`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + + GetWordCharacters ( modifiers ) + The abstract operation GetWordCharacters takes argument modifiers (a Modifiers Record) and returns a CharSet. It performs the following steps when called: + + 1. Let wordCharacters be the mathematical set that is the union of all sixty-three characters in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" (letters, numbers, and U+005F (LOW LINE) in the Unicode Basic Latin block) and all characters c for which c is not in that set but Canonicalize(c, modifiers) is. + 2. Return wordCharacters. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-i:\P{Lu})/ui; +assert(!re1.test("A"), "\\P{Lu} should not match A"); +assert(re1.test("a"), "\\P{Lu} should match a"); +assert(!re1.test("Z"), "\\P{Lu} should not match Z"); +assert(re1.test("z"), "\\P{Lu} should match z"); +assert(re1.test("0"), "\\P{Lu} should match 0"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-upper-w.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-upper-w.js new file mode 100644 index 0000000000..fe2a24a2a2 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-affects-slash-upper-w.js @@ -0,0 +1,53 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing ignoreCase (`i`) modifier affects matching for `\W`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + + GetWordCharacters ( modifiers ) + The abstract operation GetWordCharacters takes argument modifiers (a Modifiers Record) and returns a CharSet. It performs the following steps when called: + + 1. Let wordCharacters be the mathematical set that is the union of all sixty-three characters in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_" (letters, numbers, and U+005F (LOW LINE) in the Unicode Basic Latin block) and all characters c for which c is not in that set but Canonicalize(c, modifiers) is. + 2. Return wordCharacters. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-i:\W)/ui; +assert(re1.test("\u017f"), "\\W should match \u017f"); +assert(re1.test("\u212a"), "\\W should match \u212a"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-does-not-affect-dotAll-flag.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-does-not-affect-dotAll-flag.js new file mode 100644 index 0000000000..f66c8f0857 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-does-not-affect-dotAll-flag.js @@ -0,0 +1,49 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing ignoreCase (`i`) modifier in group should not affect dotAll (`s`) flag. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-i:.es)/i; +assert(re1.test("aes"), "s should match s in modified group"); +assert(!re1.test("aeS"), "s should not match S in modified group"); +assert(!re1.test("\nes"), ". should not match newline in modified group"); +assert(!re1.test("\neS"), ". should not match newline in modified group"); + +var re2 = /(?-i:.es)/is; +assert(re2.test("aes"), "s should match s in modified group"); +assert(!re2.test("aeS"), "s should not match S in modified group"); +assert(re2.test("\nes"), ". should match newline in modified group"); +assert(!re2.test("\neS"), "s should not match S in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-does-not-affect-ignoreCase-property.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-does-not-affect-ignoreCase-property.js new file mode 100644 index 0000000000..4b68807d35 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-does-not-affect-ignoreCase-property.js @@ -0,0 +1,49 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing ignoreCase (`i`) modifier does not affect RegExp instance `ignoreCase` property. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-i:)/i; +assert(re1.ignoreCase, "RegExp instance ignoreCase property should still be set"); + +var re2 = new RegExp("(?-i:)", "i"); +assert(re2.ignoreCase, "RegExp instance ignoreCase property should still be set"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-does-not-affect-multiline-flag.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-does-not-affect-multiline-flag.js new file mode 100644 index 0000000000..26bc3278b1 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase-does-not-affect-multiline-flag.js @@ -0,0 +1,49 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing ignoreCase (`i`) modifier in group should not affect multiline (`m`) flag. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-i:es$)/i; +assert(re1.test("es"), "s should match s in modified group"); +assert(!re1.test("eS"), "s should not match S in modified group"); +assert(!re1.test("es\nz"), "$ should not match newline in modified group"); +assert(!re1.test("eS\nz"), "s should not match S in modified group"); + +var re2 = /(?-i:es$)/im; +assert(re2.test("es"), "s should match s in modified group"); +assert(!re2.test("eS"), "s should not match S in modified group"); +assert(re2.test("es\nz"), "$ should match newline in modified group"); +assert(!re2.test("eS\nz"), "s should not match S in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase.js new file mode 100644 index 0000000000..87fa013049 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-ignoreCase.js @@ -0,0 +1,49 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + ignoreCase (`i`) modifier can be removed via `(?i:)` or `(?i-:)`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-i:fo)o/i; +assert(!re1.test("FOO"), "Pattern should not match as modified group does not ignore case"); +assert(!re1.test("FOo"), "Pattern should not match as modified group does not ignore case"); +assert(re1.test("foo"), "Pattern should not ignore case in modified group"); +assert(re1.test("foO"), "Pattern should not ignore case in modified group"); + +var re2 = new RegExp("(?-i:fo)o", "i"); +assert(!re2.test("FOO"), "Pattern should not match as modified group does not ignore case"); +assert(!re2.test("FOo"), "Pattern should not match as modified group does not ignore case"); +assert(re2.test("foo"), "Pattern should not ignore case in modified group"); +assert(re2.test("foO"), "Pattern should not ignore case in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-multiline-does-not-affect-dotAll-flag.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-multiline-does-not-affect-dotAll-flag.js new file mode 100644 index 0000000000..b28b545cc0 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-multiline-does-not-affect-dotAll-flag.js @@ -0,0 +1,49 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing multiline (`m`) modifier in group should not affect dotAll (`s`) flag. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-m:es.$)/m; +assert(re1.test("esz"), ". should match z in modified group"); +assert(!re1.test("es\n"), ". should not match newline in modified group"); +assert(!re1.test("esz\n"), "$ should not match newline in modified group"); +assert(!re1.test("es\n\n"), "$ should not match newline in modified group"); + +var re2 = /(?-m:es.$)/ms; +assert(re2.test("esz"), ". should match z in modified group"); +assert(re2.test("es\n"), ". should match newline in modified group"); +assert(!re2.test("esz\n"), "$ should not match newline in modified group"); +assert(!re2.test("es\n\n"), "$ should not match newline in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-multiline-does-not-affect-ignoreCase-flag.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-multiline-does-not-affect-ignoreCase-flag.js new file mode 100644 index 0000000000..a482105dee --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-multiline-does-not-affect-ignoreCase-flag.js @@ -0,0 +1,49 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing multiline (`m`) modifier in group should not affect ignoreCase (`i`) flag. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-m:es$)/m; +assert(re1.test("es"), "s should match s in modified group"); +assert(!re1.test("eS"), "s should not match S in modified group"); +assert(!re1.test("es\nz"), "$ should not match newline in modified group"); +assert(!re1.test("eS\nz"), "s should not match S in modified group"); + +var re2 = /(?-m:es$)/mi; +assert(re2.test("es"), "s should match s in modified group"); +assert(re2.test("eS"), "s should match S in modified group"); +assert(!re2.test("es\nz"), "$ should not match newline in modified group"); +assert(!re2.test("eS\nz"), "$ should not match newline in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-multiline-does-not-affect-multiline-property.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-multiline-does-not-affect-multiline-property.js new file mode 100644 index 0000000000..885ae9b242 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-multiline-does-not-affect-multiline-property.js @@ -0,0 +1,43 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Removing multiline (`m`) modifier does not affect RegExp instance `multiline` property. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /(?-m:)/m; +assert(re1.multiline, "RegExp instance multiline flag should still be set"); + +var re2 = new RegExp("(?-m:)", "m"); +assert(re2.multiline, "RegExp instance multiline flag should still be set"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-multiline.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-multiline.js new file mode 100644 index 0000000000..730888a662 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/remove-multiline.js @@ -0,0 +1,45 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + multiline (`m`) modifier can be removed via `(?-m:)`. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +var re1 = /^(?-m:es$)/m; +assert(!re1.test("\nes\ns"), "$ should not match newline in modified group"); +assert(re1.test("\nes"), "$ should match end of input in modified group"); + +var re2 = new RegExp("^(?-m:es$)", "m"); +assert(!re2.test("\nes\ns"), "$ should not match newline in modified group"); +assert(re2.test("\nes"), "$ should match end of input in modified group"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/shell.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/browser.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/shell.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-and-remove-modifiers-can-have-empty-remove-modifiers.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-and-remove-modifiers-can-have-empty-remove-modifiers.js new file mode 100644 index 0000000000..9d5fd6c879 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-and-remove-modifiers-can-have-empty-remove-modifiers.js @@ -0,0 +1,68 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Modifiers syntax `(?ims-:)` is legal. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +/(?i-:)/; +/(?is-:)/; +/(?im-:)/; +/(?s-:)/; +/(?si-:)/; +/(?sm-:)/; +/(?m-:)/; +/(?mi-:)/; +/(?ms-:)/; +/(?ims-:)/; +/(?ism-:)/; +/(?sim-:)/; +/(?smi-:)/; +/(?mis-:)/; +/(?msi-:)/; +new RegExp("(?i-:)"); +new RegExp("(?is-:)"); +new RegExp("(?im-:)"); +new RegExp("(?s-:)"); +new RegExp("(?si-:)"); +new RegExp("(?sm-:)"); +new RegExp("(?m-:)"); +new RegExp("(?mi-:)"); +new RegExp("(?ms-:)"); +new RegExp("(?ims-:)"); +new RegExp("(?ism-:)"); +new RegExp("(?sim-:)"); +new RegExp("(?smi-:)"); +new RegExp("(?mis-:)"); +new RegExp("(?msi-:)"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-and-remove-modifiers.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-and-remove-modifiers.js new file mode 100644 index 0000000000..728d47d3a0 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-and-remove-modifiers.js @@ -0,0 +1,74 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Modifiers syntax `(?im-s:)` (and similar) is legal, as long as they do not overlap. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +/(?i-s:)/; +/(?i-sm:)/; +/(?i-m:)/; +/(?i-ms:)/; +/(?s-i:)/; +/(?s-im:)/; +/(?s-m:)/; +/(?s-mi:)/; +/(?m-i:)/; +/(?m-is:)/; +/(?m-s:)/; +/(?m-si:)/; +/(?is-m:)/; +/(?im-s:)/; +/(?si-m:)/; +/(?sm-i:)/; +/(?mi-s:)/; +/(?ms-i:)/; +new RegExp("(?i-s:)"); +new RegExp("(?i-sm:)"); +new RegExp("(?i-m:)"); +new RegExp("(?i-ms:)"); +new RegExp("(?s-i:)"); +new RegExp("(?s-im:)"); +new RegExp("(?s-m:)"); +new RegExp("(?s-mi:)"); +new RegExp("(?m-i:)"); +new RegExp("(?m-is:)"); +new RegExp("(?m-s:)"); +new RegExp("(?m-si:)"); +new RegExp("(?is-m:)"); +new RegExp("(?im-s:)"); +new RegExp("(?si-m:)"); +new RegExp("(?sm-i:)"); +new RegExp("(?mi-s:)"); +new RegExp("(?ms-i:)"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-modifiers-when-nested.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-modifiers-when-nested.js new file mode 100644 index 0000000000..278633d304 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-modifiers-when-nested.js @@ -0,0 +1,44 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Modifiers syntax `(?ims:)` is legal, even when modifiers are already set via an outer non-capturing group. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +/(?i:(?i:))/; +/(?s:(?s:))/; +/(?m:(?m:))/; +new RegExp("(?i:(?i:))"); +new RegExp("(?s:(?s:))"); +new RegExp("(?m:(?m:))"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-modifiers-when-not-set-as-flags.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-modifiers-when-not-set-as-flags.js new file mode 100644 index 0000000000..e288c833c6 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-modifiers-when-not-set-as-flags.js @@ -0,0 +1,68 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Modifiers syntax `(?ims:)` is legal. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +/(?i:)/; +/(?is:)/; +/(?im:)/; +/(?s:)/; +/(?si:)/; +/(?sm:)/; +/(?m:)/; +/(?mi:)/; +/(?ms:)/; +/(?ims:)/; +/(?ism:)/; +/(?sim:)/; +/(?smi:)/; +/(?mis:)/; +/(?msi:)/; +new RegExp("(?i:)"); +new RegExp("(?is:)"); +new RegExp("(?im:)"); +new RegExp("(?s:)"); +new RegExp("(?si:)"); +new RegExp("(?sm:)"); +new RegExp("(?m:)"); +new RegExp("(?mi:)"); +new RegExp("(?ms:)"); +new RegExp("(?ims:)"); +new RegExp("(?ism:)"); +new RegExp("(?sim:)"); +new RegExp("(?smi:)"); +new RegExp("(?mis:)"); +new RegExp("(?msi:)"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-modifiers-when-set-as-flags.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-modifiers-when-set-as-flags.js new file mode 100644 index 0000000000..f1d5cedc83 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/add-modifiers-when-set-as-flags.js @@ -0,0 +1,46 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Modifiers syntax `(?ims:)` is legal, even when modifiers are already set via flags. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by RegularExpressionFlags. + 2. Let removeModifiers be the empty String. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), removeModifiers). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +/(?i:)/i; +/(?s:)/s; +/(?m:)/m; +/(?ims:)/ims; +new RegExp("(?i:)", "i"); +new RegExp("(?s:)", "s"); +new RegExp("(?m:)", "m"); +new RegExp("(?ims:)", "ims"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/browser.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/remove-modifiers-when-nested.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/remove-modifiers-when-nested.js new file mode 100644 index 0000000000..90d5e5e606 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/remove-modifiers-when-nested.js @@ -0,0 +1,44 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Modifiers syntax `(?-ims:)` is legal, even when modifiers are already cleared via an outer non-capturing group. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +/(?-i:(?-i:))/; +/(?-s:(?-s:))/; +/(?-m:(?-m:))/; +new RegExp("(?-i:(?-i:))"); +new RegExp("(?-s:(?-s:))"); +new RegExp("(?-m:(?-m:))"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/remove-modifiers-when-not-set-as-flags.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/remove-modifiers-when-not-set-as-flags.js new file mode 100644 index 0000000000..397e94ce6b --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/remove-modifiers-when-not-set-as-flags.js @@ -0,0 +1,68 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Modifiers syntax `(?-ims:)` is legal, even when not set as flags. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +/(?-i:)/; +/(?-is:)/; +/(?-im:)/; +/(?-s:)/; +/(?-si:)/; +/(?-sm:)/; +/(?-m:)/; +/(?-mi:)/; +/(?-ms:)/; +/(?-ims:)/; +/(?-ism:)/; +/(?-smi:)/; +/(?-sim:)/; +/(?-mis:)/; +/(?-msi:)/; +new RegExp("(?-i:)"); +new RegExp("(?-is:)"); +new RegExp("(?-im:)"); +new RegExp("(?-s:)"); +new RegExp("(?-si:)"); +new RegExp("(?-sm:)"); +new RegExp("(?-m:)"); +new RegExp("(?-mi:)"); +new RegExp("(?-ms:)"); +new RegExp("(?-ims:)"); +new RegExp("(?-ism:)"); +new RegExp("(?-smi:)"); +new RegExp("(?-sim:)"); +new RegExp("(?-mis:)"); +new RegExp("(?-msi:)"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/remove-modifiers-when-set-as-flags.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/remove-modifiers-when-set-as-flags.js new file mode 100644 index 0000000000..1b96c747a8 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/remove-modifiers-when-set-as-flags.js @@ -0,0 +1,68 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright 2023 Ron Buckton. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Ron Buckton +description: > + Modifiers syntax `(?-ims:)` is legal. +info: | + Runtime Semantics: CompileAtom + The syntax-directed operation CompileAtom takes arguments direction (forward or backward) and modifiers (a Modifiers Record) and returns a Matcher. + + Atom :: `(` `?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)` + 1. Let addModifiers be the source text matched by the first RegularExpressionFlags. + 2. Let removeModifiers be the source text matched by the second RegularExpressionFlags. + 3. Let newModifiers be UpdateModifiers(modifiers, CodePointsToString(addModifiers), CodePointsToString(removeModifiers)). + 4. Return CompileSubpattern of Disjunction with arguments direction and newModifiers. + + UpdateModifiers ( modifiers, add, remove ) + The abstract operation UpdateModifiers takes arguments modifiers (a Modifiers Record), add (a String), and remove (a String) and returns a Modifiers. It performs the following steps when called: + + 1. Let dotAll be modifiers.[[DotAll]]. + 2. Let ignoreCase be modifiers.[[IgnoreCase]]. + 3. Let multiline be modifiers.[[Multiline]]. + 4. If add contains "s", set dotAll to true. + 5. If add contains "i", set ignoreCase to true. + 6. If add contains "m", set multiline to true. + 7. If remove contains "s", set dotAll to false. + 8. If remove contains "i", set ignoreCase to false. + 9. If remove contains "m", set multiline to false. + 10. Return the Modifiers Record { [[DotAll]]: dotAll, [[IgnoreCase]]: ignoreCase, [[Multiline]]: multiline }. + +esid: sec-compileatom +features: [regexp-modifiers] +---*/ + +/(?-i:)/i; +/(?-is:)/is; +/(?-im:)/im; +/(?-s:)/s; +/(?-si:)/si; +/(?-sm:)/sm; +/(?-m:)/m; +/(?-mi:)/mi; +/(?-ms:)/ms; +/(?-ims:)/ims; +/(?-ism:)/ism; +/(?-sim:)/sim; +/(?-smi:)/smi; +/(?-mis:)/mis; +/(?-msi:)/msi; +new RegExp("(?-i:)", "i"); +new RegExp("(?-is:)", "is"); +new RegExp("(?-im:)", "im"); +new RegExp("(?-s:)", "s"); +new RegExp("(?-si:)", "si"); +new RegExp("(?-sm:)", "sm"); +new RegExp("(?-m:)", "m"); +new RegExp("(?-mi:)", "mi"); +new RegExp("(?-ms:)", "ms"); +new RegExp("(?-ims:)", "ims"); +new RegExp("(?-ism:)", "ism"); +new RegExp("(?-sim:)", "sim"); +new RegExp("(?-smi:)", "smi"); +new RegExp("(?-mis:)", "mis"); +new RegExp("(?-msi:)", "msi"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/shell.js b/js/src/tests/test262/built-ins/RegExp/regexp-modifiers/syntax/valid/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-i.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-i.js new file mode 100644 index 0000000000..36e5757c2c --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-i.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?i-i:a)", ""); +}, 'RegExp("(?i-i:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-m.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-m.js new file mode 100644 index 0000000000..96df538289 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-m.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?m-m:a)", ""); +}, 'RegExp("(?m-m:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-multi-duplicate.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-multi-duplicate.js new file mode 100644 index 0000000000..c566dd7a84 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-multi-duplicate.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?ims-m:a)", ""); +}, 'RegExp("(?ims-m:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-s-escape.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-s-escape.js new file mode 100644 index 0000000000..3efc2308c1 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-s-escape.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?\u{0073}-s:a)", ""); +}, 'RegExp("(?\u{0073}-s:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-s.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-s.js new file mode 100644 index 0000000000..b745f7f6aa --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-add-remove-s.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?s-s:a)", ""); +}, 'RegExp("(?s-s:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-both-empty.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-both-empty.js new file mode 100644 index 0000000000..5ce55095fc --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-both-empty.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by the first RegularExpressionFlags and the source text matched by the second RegularExpressionFlags are both empty. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-:a)", ""); +}, 'RegExp("(?-:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-code-point-repeat-i-1.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-code-point-repeat-i-1.js new file mode 100644 index 0000000000..3aa6a30d89 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-code-point-repeat-i-1.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-ii:a)", ""); +}, 'RegExp("(?-ii:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-code-point-repeat-i-2.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-code-point-repeat-i-2.js new file mode 100644 index 0000000000..d494df0113 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-code-point-repeat-i-2.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-imsi:a)", ""); +}, 'RegExp("(?-imsi:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-arbitrary.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-arbitrary.js new file mode 100644 index 0000000000..f5e3b26dd1 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-arbitrary.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-1:a)", ""); +}, 'RegExp("(?-1:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-combining-i.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-combining-i.js new file mode 100644 index 0000000000..8a2eb982b4 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-combining-i.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-iͥ:a)", ""); +}, 'RegExp("(?-iͥ:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-combining-m.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-combining-m.js new file mode 100644 index 0000000000..086271affb --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-combining-m.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-mͫ:a)", ""); +}, 'RegExp("(?-mͫ:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-combining-s.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-combining-s.js new file mode 100644 index 0000000000..ccf4152844 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-combining-s.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-s̀:a)", ""); +}, 'RegExp("(?-s̀:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-d.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-d.js new file mode 100644 index 0000000000..c8ee295463 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-d.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-d:a)", ""); +}, 'RegExp("(?-d:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-g.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-g.js new file mode 100644 index 0000000000..9e52eb067f --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-g.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-g:a)", ""); +}, 'RegExp("(?-g:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-non-display-1.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-non-display-1.js new file mode 100644 index 0000000000..8ae9398003 Binary files /dev/null and b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-non-display-1.js differ diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-non-display-2.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-non-display-2.js new file mode 100644 index 0000000000..888fd17adc --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-non-display-2.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-s‎:a)", ""); +}, 'RegExp("(?-s‎:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-non-flag.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-non-flag.js new file mode 100644 index 0000000000..fa899733ff --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-non-flag.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-Q:a)", ""); +}, 'RegExp("(?-Q:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-u.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-u.js new file mode 100644 index 0000000000..9174df4eaa --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-u.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-u:a)", ""); +}, 'RegExp("(?-u:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-uppercase-I.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-uppercase-I.js new file mode 100644 index 0000000000..f51bdcd561 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-uppercase-I.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-I:a)", ""); +}, 'RegExp("(?-I:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-y.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-y.js new file mode 100644 index 0000000000..c5f981ef7b --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-y.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-y:a)", ""); +}, 'RegExp("(?-y:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-zwj.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-zwj.js new file mode 100644 index 0000000000..6dc54400f7 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-zwj.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-s‍:a)", ""); +}, 'RegExp("(?-s‍:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-zwnbsp.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-zwnbsp.js new file mode 100644 index 0000000000..626fcead1b --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-zwnbsp.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-s:a)", ""); +}, 'RegExp("(?-s:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-zwnj.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-zwnj.js new file mode 100644 index 0000000000..eac16a0439 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-other-code-point-zwnj.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-s‌:a)", ""); +}, 'RegExp("(?-s‌:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-i.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-i.js new file mode 100644 index 0000000000..36e5757c2c --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-i.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?i-i:a)", ""); +}, 'RegExp("(?i-i:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-m.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-m.js new file mode 100644 index 0000000000..96df538289 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-m.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?m-m:a)", ""); +}, 'RegExp("(?m-m:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-multi-duplicate.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-multi-duplicate.js new file mode 100644 index 0000000000..8e9c608e4a --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-multi-duplicate.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?m-ims:a)", ""); +}, 'RegExp("(?m-ims:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-s-escape.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-s-escape.js new file mode 100644 index 0000000000..3bb3e4a89f --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-s-escape.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?s-\u{0073}:a)", ""); +}, 'RegExp("(?s-\u{0073}:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-s.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-s.js new file mode 100644 index 0000000000..b745f7f6aa --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-add-remove-s.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?s-s:a)", ""); +}, 'RegExp("(?s-s:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-code-point-repeat-i-1.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-code-point-repeat-i-1.js new file mode 100644 index 0000000000..1aee0a56f2 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-code-point-repeat-i-1.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?ii-:a)", ""); +}, 'RegExp("(?ii-:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-code-point-repeat-i-2.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-code-point-repeat-i-2.js new file mode 100644 index 0000000000..8ae4960441 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-code-point-repeat-i-2.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?imsi-:a)", ""); +}, 'RegExp("(?imsi-:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-arbitrary.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-arbitrary.js new file mode 100644 index 0000000000..70e24b4e22 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-arbitrary.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?1-:a)", ""); +}, 'RegExp("(?1-:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-combining-i.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-combining-i.js new file mode 100644 index 0000000000..7cf8d11d2c --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-combining-i.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?iͥ-:a)", ""); +}, 'RegExp("(?iͥ-:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-combining-m.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-combining-m.js new file mode 100644 index 0000000000..5023bcb573 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-combining-m.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?mͫ-:a)", ""); +}, 'RegExp("(?mͫ-:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-combining-s.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-combining-s.js new file mode 100644 index 0000000000..f2edc9f211 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-combining-s.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?s̀-:a)", ""); +}, 'RegExp("(?s̀-:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-d.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-d.js new file mode 100644 index 0000000000..ccbda94c89 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-d.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?d-:a)", ""); +}, 'RegExp("(?d-:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-g.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-g.js new file mode 100644 index 0000000000..f89699072b --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-g.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?g-:a)", ""); +}, 'RegExp("(?g-:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-non-display-1.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-non-display-1.js new file mode 100644 index 0000000000..16c0162a9a Binary files /dev/null and b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-non-display-1.js differ diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-non-display-2.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-non-display-2.js new file mode 100644 index 0000000000..9b8d348b31 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-non-display-2.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?s‎-:a)", ""); +}, 'RegExp("(?s‎-:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-non-flag.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-non-flag.js new file mode 100644 index 0000000000..d52249217c --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-non-flag.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?Q-:a)", ""); +}, 'RegExp("(?Q-:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-u.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-u.js new file mode 100644 index 0000000000..1f7d261897 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-u.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?u-:a)", ""); +}, 'RegExp("(?u-:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-uppercase-I.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-uppercase-I.js new file mode 100644 index 0000000000..a9d284f5c2 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-uppercase-I.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?I-:a)", ""); +}, 'RegExp("(?I-:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-y.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-y.js new file mode 100644 index 0000000000..bc13bdfb1c --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-y.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?y-:a)", ""); +}, 'RegExp("(?y-:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-zwj.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-zwj.js new file mode 100644 index 0000000000..4b16df3743 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-zwj.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?s‍-:a)", ""); +}, 'RegExp("(?s‍-:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-zwnbsp.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-zwnbsp.js new file mode 100644 index 0000000000..f1a4373aef --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-zwnbsp.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?s-:a)", ""); +}, 'RegExp("(?s-:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-zwnj.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-zwnj.js new file mode 100644 index 0000000000..11c119eae4 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-other-code-point-zwnj.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?s‌-:a)", ""); +}, 'RegExp("(?s‌-:a)", ""): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-case-fold-i.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-case-fold-i.js new file mode 100644 index 0000000000..667d2408bb --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-case-fold-i.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?I-:a)", "i"); +}, 'RegExp("(?I-:a)", "i"): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-case-fold-m.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-case-fold-m.js new file mode 100644 index 0000000000..4fb69935ed --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-case-fold-m.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?M-:a)", "i"); +}, 'RegExp("(?M-:a)", "i"): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-case-fold-s.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-case-fold-s.js new file mode 100644 index 0000000000..f678b0c532 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-case-fold-s.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?S-:a)", "i"); +}, 'RegExp("(?S-:a)", "i"): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-unicode-case-fold-i.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-unicode-case-fold-i.js new file mode 100644 index 0000000000..fedb79a4f2 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-unicode-case-fold-i.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case-folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?İ-:a)", "iu"); +}, 'RegExp("(?İ-:a)", "iu"): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-unicode-case-fold-s.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-unicode-case-fold-s.js new file mode 100644 index 0000000000..0cd8418bae --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-reverse-should-not-unicode-case-fold-s.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case-folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?ſ-:a)", "u"); +}, 'RegExp("(?ſ-:a)", "u"): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-case-fold-i.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-case-fold-i.js new file mode 100644 index 0000000000..4021cd675e --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-case-fold-i.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-I:a)", "i"); +}, 'RegExp("(?-I:a)", "i"): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-case-fold-m.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-case-fold-m.js new file mode 100644 index 0000000000..9dff9ce51a --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-case-fold-m.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-M:a)", "i"); +}, 'RegExp("(?-M:a)", "i"): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-case-fold-s.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-case-fold-s.js new file mode 100644 index 0000000000..0a78e61909 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-case-fold-s.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-S:a)", "i"); +}, 'RegExp("(?-S:a)", "i"): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-unicode-case-fold-i.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-unicode-case-fold-i.js new file mode 100644 index 0000000000..7f38b553f2 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-unicode-case-fold-i.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case-folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-İ:a)", "iu"); +}, 'RegExp("(?-İ:a)", "iu"): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-unicode-case-fold-s.js b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-unicode-case-fold-s.js new file mode 100644 index 0000000000..f826ffe544 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/syntax-err-arithmetic-modifiers-should-not-unicode-case-fold-s.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case-folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +assert.throws(SyntaxError, function () { + RegExp("(?-ſ:a)", "u"); +}, 'RegExp("(?-ſ:a)", "u"): '); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/length.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/length.js index da310cd3f2..552d81019e 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/length.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/length.js @@ -26,10 +26,11 @@ features: [Symbol.matchAll] var RegExpStringIteratorProto = Object.getPrototypeOf(/./[Symbol.matchAll]('')); -assert.sameValue(RegExpStringIteratorProto.next.length, 0); - -verifyNotEnumerable(RegExpStringIteratorProto.next, 'length'); -verifyNotWritable(RegExpStringIteratorProto.next, 'length'); -verifyConfigurable(RegExpStringIteratorProto.next, 'length'); +verifyProperty(RegExpStringIteratorProto.next, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/name.js b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/name.js index bd178670f9..78fc8682dc 100644 --- a/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/name.js +++ b/js/src/tests/test262/built-ins/RegExpStringIteratorPrototype/next/name.js @@ -24,10 +24,11 @@ features: [Symbol.matchAll] var RegExpStringIteratorProto = Object.getPrototypeOf(/./[Symbol.matchAll]('')); -assert.sameValue(RegExpStringIteratorProto.next.name, 'next'); - -verifyNotEnumerable(RegExpStringIteratorProto.next, 'name'); -verifyNotWritable(RegExpStringIteratorProto.next, 'name'); -verifyConfigurable(RegExpStringIteratorProto.next, 'name'); +verifyProperty(RegExpStringIteratorProto.next, "name", { + value: "next", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/Symbol.species/length.js b/js/src/tests/test262/built-ins/Set/Symbol.species/length.js index a4fc6ac666..1620be6bb3 100644 --- a/js/src/tests/test262/built-ins/Set/Symbol.species/length.js +++ b/js/src/tests/test262/built-ins/Set/Symbol.species/length.js @@ -25,10 +25,11 @@ features: [Symbol.species] var desc = Object.getOwnPropertyDescriptor(Set, 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/Set/length.js b/js/src/tests/test262/built-ins/Set/length.js index 7e42877423..6b1f4090c1 100644 --- a/js/src/tests/test262/built-ins/Set/length.js +++ b/js/src/tests/test262/built-ins/Set/length.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Set.length, 0, "The value of `Set.length` is `0`"); - -verifyNotEnumerable(Set, "length"); -verifyNotWritable(Set, "length"); -verifyConfigurable(Set, "length"); +verifyProperty(Set, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/name.js b/js/src/tests/test262/built-ins/Set/name.js index c4f6ac72ef..aefb516ac5 100644 --- a/js/src/tests/test262/built-ins/Set/name.js +++ b/js/src/tests/test262/built-ins/Set/name.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Set.name, "Set", "The value of `Set.name` is `'Set'`"); - -verifyNotEnumerable(Set, "name"); -verifyNotWritable(Set, "name"); -verifyConfigurable(Set, "name"); +verifyProperty(Set, "name", { + value: "Set", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/Symbol.iterator/not-a-constructor.js b/js/src/tests/test262/built-ins/Set/prototype/Symbol.iterator/not-a-constructor.js index 8db788f9c0..62db65ee42 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/Symbol.iterator/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Set/prototype/Symbol.iterator/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let s = new Set([]); new s[Symbol.iterator](); -}, '`let s = new Set([]); new s[Symbol.iterator]()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/add/length.js b/js/src/tests/test262/built-ins/Set/prototype/add/length.js index 88b79c7dae..8b3ccae745 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/add/length.js +++ b/js/src/tests/test262/built-ins/Set/prototype/add/length.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Set.prototype.add.length, 1, "The value of `Set.prototype.add.length` is `1`"); - -verifyNotEnumerable(Set.prototype.add, "length"); -verifyNotWritable(Set.prototype.add, "length"); -verifyConfigurable(Set.prototype.add, "length"); +verifyProperty(Set.prototype.add, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/add/name.js b/js/src/tests/test262/built-ins/Set/prototype/add/name.js index f8f5441845..ae4e54bbe1 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/add/name.js +++ b/js/src/tests/test262/built-ins/Set/prototype/add/name.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Set.prototype.add.name, "add", "The value of `Set.prototype.add.name` is `'add'`"); - -verifyNotEnumerable(Set.prototype.add, "name"); -verifyNotWritable(Set.prototype.add, "name"); -verifyConfigurable(Set.prototype.add, "name"); +verifyProperty(Set.prototype.add, "name", { + value: "add", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/add/not-a-constructor.js b/js/src/tests/test262/built-ins/Set/prototype/add/not-a-constructor.js index c1ba69377d..1b8d1af562 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/add/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Set/prototype/add/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Set.prototype.add), false, 'isConstructor(Set.pro assert.throws(TypeError, () => { let s = new Set([]); new s.add(); -}, '`let s = new Set([]); new s.add()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/clear/length.js b/js/src/tests/test262/built-ins/Set/prototype/clear/length.js index 84e1dd1146..b275b85aa1 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/clear/length.js +++ b/js/src/tests/test262/built-ins/Set/prototype/clear/length.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Set.prototype.clear.length, 0, "The value of `Set.prototype.clear.length` is `0`"); - -verifyNotEnumerable(Set.prototype.clear, "length"); -verifyNotWritable(Set.prototype.clear, "length"); -verifyConfigurable(Set.prototype.clear, "length"); +verifyProperty(Set.prototype.clear, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/clear/name.js b/js/src/tests/test262/built-ins/Set/prototype/clear/name.js index 722a8af8f1..f6c25d3f21 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/clear/name.js +++ b/js/src/tests/test262/built-ins/Set/prototype/clear/name.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Set.prototype.clear.name, "clear", "The value of `Set.prototype.clear.name` is `'clear'`"); - -verifyNotEnumerable(Set.prototype.clear, "name"); -verifyNotWritable(Set.prototype.clear, "name"); -verifyConfigurable(Set.prototype.clear, "name"); +verifyProperty(Set.prototype.clear, "name", { + value: "clear", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/clear/not-a-constructor.js b/js/src/tests/test262/built-ins/Set/prototype/clear/not-a-constructor.js index 16f0ebd97c..26e25a8d0f 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/clear/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Set/prototype/clear/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Set.prototype.clear), false, 'isConstructor(Set.p assert.throws(TypeError, () => { let s = new Set([]); new s.clear(); -}, '`let s = new Set([]); new s.clear()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/delete/length.js b/js/src/tests/test262/built-ins/Set/prototype/delete/length.js index 5d28a0ad40..491a0a7706 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/delete/length.js +++ b/js/src/tests/test262/built-ins/Set/prototype/delete/length.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Set.prototype.delete.length, 1, "The value of `Set.prototype.delete.length` is `1`"); - -verifyNotEnumerable(Set.prototype.delete, "length"); -verifyNotWritable(Set.prototype.delete, "length"); -verifyConfigurable(Set.prototype.delete, "length"); +verifyProperty(Set.prototype.delete, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/delete/name.js b/js/src/tests/test262/built-ins/Set/prototype/delete/name.js index 538d7b4370..e54dd71baf 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/delete/name.js +++ b/js/src/tests/test262/built-ins/Set/prototype/delete/name.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Set.prototype.delete.name, "delete", "The value of `Set.prototype.delete.name` is `'delete'`"); - -verifyNotEnumerable(Set.prototype.delete, "name"); -verifyNotWritable(Set.prototype.delete, "name"); -verifyConfigurable(Set.prototype.delete, "name"); +verifyProperty(Set.prototype.delete, "name", { + value: "delete", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/delete/not-a-constructor.js b/js/src/tests/test262/built-ins/Set/prototype/delete/not-a-constructor.js index 3c978d44f0..401cff6bf7 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/delete/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Set/prototype/delete/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Set.prototype.delete), false, 'isConstructor(Set. assert.throws(TypeError, () => { let s = new Set([]); new s.delete(); -}, '`let s = new Set([]); new s.delete()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/difference/not-a-constructor.js b/js/src/tests/test262/built-ins/Set/prototype/difference/not-a-constructor.js index eb8765cfb2..cd57acf6ab 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/difference/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Set/prototype/difference/not-a-constructor.js @@ -18,8 +18,6 @@ assert.throws( TypeError, () => { new Set.prototype.difference(); - }, - "`new Set.prototype.difference()` throws TypeError" -); + }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/entries/length.js b/js/src/tests/test262/built-ins/Set/prototype/entries/length.js index 5f7ab9dd4c..9f3c5a39c5 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/entries/length.js +++ b/js/src/tests/test262/built-ins/Set/prototype/entries/length.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Set.prototype.entries.length, 0, "The value of `Set.prototype.entries.length` is `0`"); - -verifyNotEnumerable(Set.prototype.entries, "length"); -verifyNotWritable(Set.prototype.entries, "length"); -verifyConfigurable(Set.prototype.entries, "length"); +verifyProperty(Set.prototype.entries, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/entries/name.js b/js/src/tests/test262/built-ins/Set/prototype/entries/name.js index ffcfec6df1..e29b78e96f 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/entries/name.js +++ b/js/src/tests/test262/built-ins/Set/prototype/entries/name.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Set.prototype.entries.name, "entries", "The value of `Set.prototype.entries.name` is `'entries'`"); - -verifyNotEnumerable(Set.prototype.entries, "name"); -verifyNotWritable(Set.prototype.entries, "name"); -verifyConfigurable(Set.prototype.entries, "name"); +verifyProperty(Set.prototype.entries, "name", { + value: "entries", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/entries/not-a-constructor.js b/js/src/tests/test262/built-ins/Set/prototype/entries/not-a-constructor.js index cd385a7077..d2ac4f4845 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/entries/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Set/prototype/entries/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let s = new Set([]); new s.entries(); -}, '`let s = new Set([]); new s.entries()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/forEach/length.js b/js/src/tests/test262/built-ins/Set/prototype/forEach/length.js index 8304c78447..b831b6c0ee 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/forEach/length.js +++ b/js/src/tests/test262/built-ins/Set/prototype/forEach/length.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Set.prototype.forEach.length, 1, "The value of `Set.prototype.forEach.length` is `1`"); - -verifyNotEnumerable(Set.prototype.forEach, "length"); -verifyNotWritable(Set.prototype.forEach, "length"); -verifyConfigurable(Set.prototype.forEach, "length"); +verifyProperty(Set.prototype.forEach, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/forEach/name.js b/js/src/tests/test262/built-ins/Set/prototype/forEach/name.js index 390b016c64..176ef0d84b 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/forEach/name.js +++ b/js/src/tests/test262/built-ins/Set/prototype/forEach/name.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Set.prototype.forEach.name, "forEach", "The value of `Set.prototype.forEach.name` is `'forEach'`"); - -verifyNotEnumerable(Set.prototype.forEach, "name"); -verifyNotWritable(Set.prototype.forEach, "name"); -verifyConfigurable(Set.prototype.forEach, "name"); +verifyProperty(Set.prototype.forEach, "name", { + value: "forEach", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/forEach/not-a-constructor.js b/js/src/tests/test262/built-ins/Set/prototype/forEach/not-a-constructor.js index 96509bf80a..fd62129107 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/forEach/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Set/prototype/forEach/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let s = new Set([]); new s.forEach(() => {}); -}, '`let s = new Set([]); new s.forEach(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/length.js b/js/src/tests/test262/built-ins/Set/prototype/has/length.js index 93326a3565..e12231b9d4 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/has/length.js +++ b/js/src/tests/test262/built-ins/Set/prototype/has/length.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Set.prototype.has.length, 1, "The value of `Set.prototype.has.length` is `1`"); - -verifyNotEnumerable(Set.prototype.has, "length"); -verifyNotWritable(Set.prototype.has, "length"); -verifyConfigurable(Set.prototype.has, "length"); +verifyProperty(Set.prototype.has, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/name.js b/js/src/tests/test262/built-ins/Set/prototype/has/name.js index c95b4ff0b5..72f4ee68b2 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/has/name.js +++ b/js/src/tests/test262/built-ins/Set/prototype/has/name.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Set.prototype.has.name, "has", "The value of `Set.prototype.has.name` is `'has'`"); - -verifyNotEnumerable(Set.prototype.has, "name"); -verifyNotWritable(Set.prototype.has, "name"); -verifyConfigurable(Set.prototype.has, "name"); +verifyProperty(Set.prototype.has, "name", { + value: "has", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/not-a-constructor.js b/js/src/tests/test262/built-ins/Set/prototype/has/not-a-constructor.js index 8f41ff0c1f..d1e82f6939 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/has/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Set/prototype/has/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Set.prototype.has), false, 'isConstructor(Set.pro assert.throws(TypeError, () => { let s = new Set([]); new s.has(); -}, '`let s = new Set([]); new s.has()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/intersection/not-a-constructor.js b/js/src/tests/test262/built-ins/Set/prototype/intersection/not-a-constructor.js index 0a8b82b058..3b759e2cea 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/intersection/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Set/prototype/intersection/not-a-constructor.js @@ -18,8 +18,6 @@ assert.throws( TypeError, () => { new Set.prototype.intersection(); - }, - "`new Set.prototype.intersection()` throws TypeError" -); + }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/isDisjointFrom/not-a-constructor.js b/js/src/tests/test262/built-ins/Set/prototype/isDisjointFrom/not-a-constructor.js index bcb7d8f159..c5bf872a96 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/isDisjointFrom/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Set/prototype/isDisjointFrom/not-a-constructor.js @@ -18,8 +18,6 @@ assert.throws( TypeError, () => { new Set.prototype.isDisjointFrom(); - }, - "`new Set.prototype.isDisjointFrom()` throws TypeError" -); + }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/isSubsetOf/not-a-constructor.js b/js/src/tests/test262/built-ins/Set/prototype/isSubsetOf/not-a-constructor.js index 9bb00a7a45..6b81688532 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/isSubsetOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Set/prototype/isSubsetOf/not-a-constructor.js @@ -18,8 +18,6 @@ assert.throws( TypeError, () => { new Set.prototype.isSubsetOf(); - }, - "`new Set.prototype.isSubsetOf()` throws TypeError" -); + }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/isSupersetOf/not-a-constructor.js b/js/src/tests/test262/built-ins/Set/prototype/isSupersetOf/not-a-constructor.js index 9ce1d37913..00860eb9ab 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/isSupersetOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Set/prototype/isSupersetOf/not-a-constructor.js @@ -18,8 +18,6 @@ assert.throws( TypeError, () => { new Set.prototype.isSupersetOf(); - }, - "`new Set.prototype.isSupersetOf()` throws TypeError" -); + }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/size/length.js b/js/src/tests/test262/built-ins/Set/prototype/size/length.js index 4b0b0675dd..288787106e 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/size/length.js +++ b/js/src/tests/test262/built-ins/Set/prototype/size/length.js @@ -13,10 +13,11 @@ includes: [propertyHelper.js] var descriptor = Object.getOwnPropertyDescriptor(Set.prototype, "size"); -assert.sameValue(descriptor.get.length, 0, "The value of `Set.prototype.size.length` is `0`"); - -verifyNotEnumerable(descriptor.get, "length"); -verifyNotWritable(descriptor.get, "length"); -verifyConfigurable(descriptor.get, "length"); +verifyProperty(descriptor.get, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/size/name.js b/js/src/tests/test262/built-ins/Set/prototype/size/name.js index 79723d8f0e..baf6fa968a 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/size/name.js +++ b/js/src/tests/test262/built-ins/Set/prototype/size/name.js @@ -16,10 +16,11 @@ includes: [propertyHelper.js] var descriptor = Object.getOwnPropertyDescriptor(Set.prototype, "size"); -assert.sameValue(descriptor.get.name, "get size", "The value of `descriptor.get.name` is `'get size'`"); - -verifyNotEnumerable(descriptor.get, "name"); -verifyNotWritable(descriptor.get, "name"); -verifyConfigurable(descriptor.get, "name"); +verifyProperty(descriptor.get, "name", { + value: "get size", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/symmetricDifference/not-a-constructor.js b/js/src/tests/test262/built-ins/Set/prototype/symmetricDifference/not-a-constructor.js index 495beeac4b..7b3234c5a9 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/symmetricDifference/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Set/prototype/symmetricDifference/not-a-constructor.js @@ -18,8 +18,6 @@ assert.throws( TypeError, () => { new Set.prototype.symmetricDifference(); - }, - "`new Set.prototype.symmetricDifference()` throws TypeError" -); + }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/union/not-a-constructor.js b/js/src/tests/test262/built-ins/Set/prototype/union/not-a-constructor.js index 9c4f4d7baf..f57bcb02f8 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/union/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Set/prototype/union/not-a-constructor.js @@ -18,8 +18,6 @@ assert.throws( TypeError, () => { new Set.prototype.union(); - }, - "`new Set.prototype.union()` throws TypeError" -); + }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/values/length.js b/js/src/tests/test262/built-ins/Set/prototype/values/length.js index 8e49d1bc51..e65ada6a4c 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/values/length.js +++ b/js/src/tests/test262/built-ins/Set/prototype/values/length.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Set.prototype.values.length, 0, "The value of `Set.prototype.values.length` is `0`"); - -verifyNotEnumerable(Set.prototype.values, "length"); -verifyNotWritable(Set.prototype.values, "length"); -verifyConfigurable(Set.prototype.values, "length"); +verifyProperty(Set.prototype.values, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/values/name.js b/js/src/tests/test262/built-ins/Set/prototype/values/name.js index a2458e9505..0f55f2ea0d 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/values/name.js +++ b/js/src/tests/test262/built-ins/Set/prototype/values/name.js @@ -10,10 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(Set.prototype.values.name, "values", "The value of `Set.prototype.values.name` is `'values'`"); - -verifyNotEnumerable(Set.prototype.values, "name"); -verifyNotWritable(Set.prototype.values, "name"); -verifyConfigurable(Set.prototype.values, "name"); +verifyProperty(Set.prototype.values, "name", { + value: "values", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/values/not-a-constructor.js b/js/src/tests/test262/built-ins/Set/prototype/values/not-a-constructor.js index f21399ca9f..10d52e40de 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/values/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Set/prototype/values/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Set.prototype.values), false, 'isConstructor(Set. assert.throws(TypeError, () => { let s = new Set([]); new s.values(); -}, '`let s = new Set([]); new s.values()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/SetIteratorPrototype/next/length.js b/js/src/tests/test262/built-ins/SetIteratorPrototype/next/length.js index 8d1afa8e61..7ecff0d6bd 100644 --- a/js/src/tests/test262/built-ins/SetIteratorPrototype/next/length.js +++ b/js/src/tests/test262/built-ins/SetIteratorPrototype/next/length.js @@ -24,10 +24,11 @@ includes: [propertyHelper.js] var SetIteratorProto = Object.getPrototypeOf(new Set().values()); -assert.sameValue(SetIteratorProto.next.length, 0); - -verifyNotEnumerable(SetIteratorProto.next, "length"); -verifyNotWritable(SetIteratorProto.next, "length"); -verifyConfigurable(SetIteratorProto.next, "length"); +verifyProperty(SetIteratorProto.next, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/SetIteratorPrototype/next/name.js b/js/src/tests/test262/built-ins/SetIteratorPrototype/next/name.js index 1792ccd461..81b5158661 100644 --- a/js/src/tests/test262/built-ins/SetIteratorPrototype/next/name.js +++ b/js/src/tests/test262/built-ins/SetIteratorPrototype/next/name.js @@ -21,10 +21,11 @@ includes: [propertyHelper.js] var SetIteratorProto = Object.getPrototypeOf(new Set().values()); -assert.sameValue(SetIteratorProto.next.name, "next"); - -verifyNotEnumerable(SetIteratorProto.next, "name"); -verifyNotWritable(SetIteratorProto.next, "name"); -verifyConfigurable(SetIteratorProto.next, "name"); +verifyProperty(SetIteratorProto.next, "name", { + value: "next", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/ShadowRealm/prototype/evaluate/not-constructor.js b/js/src/tests/test262/built-ins/ShadowRealm/prototype/evaluate/not-constructor.js index 7530d84d93..897670bfeb 100644 --- a/js/src/tests/test262/built-ins/ShadowRealm/prototype/evaluate/not-constructor.js +++ b/js/src/tests/test262/built-ins/ShadowRealm/prototype/evaluate/not-constructor.js @@ -23,7 +23,7 @@ assert.sameValue( assert.throws(TypeError, () => { new ShadowRealm.prototype.evaluate(""); -}, '`new ShadowRealm.prototype.evaluate("")` throws TypeError'); +}); const r = new ShadowRealm(); r.evaluate('globalThis.x = 0'); diff --git a/js/src/tests/test262/built-ins/SharedArrayBuffer/options-maxbytelength-allocation-limit.js b/js/src/tests/test262/built-ins/SharedArrayBuffer/options-maxbytelength-allocation-limit.js new file mode 100644 index 0000000000..4462981d9e --- /dev/null +++ b/js/src/tests/test262/built-ins/SharedArrayBuffer/options-maxbytelength-allocation-limit.js @@ -0,0 +1,41 @@ +// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!this.hasOwnProperty('SharedArrayBuffer')||!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- SharedArrayBuffer,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-sharedarraybuffer-length +description: > + Throws a RangeError if the requested Data Block is too large. +info: | + SharedArrayBuffer ( length [ , options ] ) + + ... + 4. Return ? AllocateSharedArrayBuffer(NewTarget, byteLength, requestedMaxByteLength). + + AllocateSharedArrayBuffer ( constructor, byteLength [ , maxByteLength ] ) + + ... + 7. Let block be ? CreateSharedByteDataBlock(allocLength). + ... + + CreateSharedByteDataBlock ( size ) + + 1. Let db be a new Shared Data Block value consisting of size bytes. If it is + impossible to create such a Shared Data Block, throw a RangeError exception. + +features: [SharedArrayBuffer, resizable-arraybuffer] +---*/ + +assert.throws(RangeError, function() { + // Allocating 7 PiB should fail with a RangeError. + // Math.pow(1024, 5) = 1125899906842624 + new SharedArrayBuffer(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 SharedArrayBuffer(0, {maxByteLength: 9007199254740992 - 1}); +}, "`maxByteLength` option is Math.pow(2, 53) - 1"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/SharedArrayBuffer/options-maxbytelength-compared-before-object-creation.js b/js/src/tests/test262/built-ins/SharedArrayBuffer/options-maxbytelength-compared-before-object-creation.js new file mode 100644 index 0000000000..89544d6fa3 --- /dev/null +++ b/js/src/tests/test262/built-ins/SharedArrayBuffer/options-maxbytelength-compared-before-object-creation.js @@ -0,0 +1,43 @@ +// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!this.hasOwnProperty('SharedArrayBuffer')||!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- SharedArrayBuffer,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-sharedarraybuffer-length +description: > + The byteLength argument is validated before OrdinaryCreateFromConstructor. +info: | + SharedArrayBuffer ( length [ , options ] ) + + ... + 4. Return ? AllocateSharedArrayBuffer(NewTarget, byteLength, requestedMaxByteLength). + + AllocateSharedArrayBuffer ( constructor, byteLength [ , maxByteLength ] ) + + ... + 3. If allocatingGrowableBuffer is true, then + a. If byteLength > maxByteLength, throw a RangeError exception. + ... + 5. Let obj be ? OrdinaryCreateFromConstructor(constructor, "%SharedArrayBuffer.prototype%", slots). + ... + +features: [SharedArrayBuffer, 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(SharedArrayBuffer, [byteLength, options], newTarget); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/SharedArrayBuffer/options-maxbytelength-data-allocation-after-object-creation.js b/js/src/tests/test262/built-ins/SharedArrayBuffer/options-maxbytelength-data-allocation-after-object-creation.js new file mode 100644 index 0000000000..58e9748609 --- /dev/null +++ b/js/src/tests/test262/built-ins/SharedArrayBuffer/options-maxbytelength-data-allocation-after-object-creation.js @@ -0,0 +1,45 @@ +// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!this.hasOwnProperty('SharedArrayBuffer')||!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- SharedArrayBuffer,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-sharedarraybuffer-length +description: > + The new SharedArrayBuffer instance is created prior to allocating the Data Block. +info: | + SharedArrayBuffer ( length [ , options ] ) + + ... + 4. Return ? AllocateSharedArrayBuffer(NewTarget, byteLength, requestedMaxByteLength). + + AllocateSharedArrayBuffer( constructor, byteLength ) + + ... + 5. Let obj be ? OrdinaryCreateFromConstructor(constructor, "%SharedArrayBuffer.prototype%", slots). + ... + 7. Let block be ? CreateSharedByteDataBlock(allocLength). + ... + +features: [SharedArrayBuffer, 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(SharedArrayBuffer, [], newTarget); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/byteLength/length.js b/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/byteLength/length.js index 22a944cb3c..2133165fa9 100644 --- a/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/byteLength/length.js +++ b/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/byteLength/length.js @@ -12,10 +12,11 @@ features: [SharedArrayBuffer] var desc = Object.getOwnPropertyDescriptor(SharedArrayBuffer.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/SharedArrayBuffer/prototype/byteLength/name.js b/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/byteLength/name.js index 28dff46979..b5312ca087 100644 --- a/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/byteLength/name.js +++ b/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/byteLength/name.js @@ -14,13 +14,11 @@ var descriptor = Object.getOwnPropertyDescriptor( SharedArrayBuffer.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/SharedArrayBuffer/prototype/slice/length.js b/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/slice/length.js index 6760427fb6..d9396865e1 100644 --- a/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/slice/length.js +++ b/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/slice/length.js @@ -24,10 +24,11 @@ includes: [propertyHelper.js] features: [SharedArrayBuffer] ---*/ -assert.sameValue(SharedArrayBuffer.prototype.slice.length, 2); - -verifyNotEnumerable(SharedArrayBuffer.prototype.slice, "length"); -verifyNotWritable(SharedArrayBuffer.prototype.slice, "length"); -verifyConfigurable(SharedArrayBuffer.prototype.slice, "length"); +verifyProperty(SharedArrayBuffer.prototype.slice, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/slice/name.js b/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/slice/name.js index a3407d4b8a..56b2c85c1b 100644 --- a/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/slice/name.js +++ b/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/slice/name.js @@ -21,10 +21,11 @@ includes: [propertyHelper.js] features: [SharedArrayBuffer] ---*/ -assert.sameValue(SharedArrayBuffer.prototype.slice.name, "slice"); - -verifyNotEnumerable(SharedArrayBuffer.prototype.slice, "name"); -verifyNotWritable(SharedArrayBuffer.prototype.slice, "name"); -verifyConfigurable(SharedArrayBuffer.prototype.slice, "name"); +verifyProperty(SharedArrayBuffer.prototype.slice, "name", { + value: "slice", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/slice/not-a-constructor.js b/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/slice/not-a-constructor.js index 49713162b8..c12b163b0b 100644 --- a/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/slice/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/SharedArrayBuffer/prototype/slice/not-a-constructor.js @@ -30,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let sab = new SharedArrayBuffer(1); new sab.slice(); -}, '`let sab = new SharedArrayBuffer(1); new sab.slice()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/fromCharCode/name.js b/js/src/tests/test262/built-ins/String/fromCharCode/name.js index aad7ed2c18..97cce062e6 100644 --- a/js/src/tests/test262/built-ins/String/fromCharCode/name.js +++ b/js/src/tests/test262/built-ins/String/fromCharCode/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.fromCharCode.name, "fromCharCode"); - -verifyNotEnumerable(String.fromCharCode, "name"); -verifyNotWritable(String.fromCharCode, "name"); -verifyConfigurable(String.fromCharCode, "name"); +verifyProperty(String.fromCharCode, "name", { + value: "fromCharCode", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/fromCharCode/not-a-constructor.js b/js/src/tests/test262/built-ins/String/fromCharCode/not-a-constructor.js index 2076c9b6ab..f7db50fa33 100644 --- a/js/src/tests/test262/built-ins/String/fromCharCode/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/fromCharCode/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(String.fromCharCode), false, 'isConstructor(Strin assert.throws(TypeError, () => { new String.fromCharCode(); -}, '`new String.fromCharCode()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/fromCodePoint/length.js b/js/src/tests/test262/built-ins/String/fromCodePoint/length.js index 5708d475e6..a6e1710e1d 100644 --- a/js/src/tests/test262/built-ins/String/fromCodePoint/length.js +++ b/js/src/tests/test262/built-ins/String/fromCodePoint/length.js @@ -8,13 +8,11 @@ includes: [propertyHelper.js] features: [String.fromCodePoint] ---*/ -assert.sameValue( - String.fromCodePoint.length, 1, - 'The value of `String.fromCodePoint.length` is `1`' -); - -verifyNotEnumerable(String.fromCodePoint, 'length'); -verifyNotWritable(String.fromCodePoint, 'length'); -verifyConfigurable(String.fromCodePoint, 'length'); +verifyProperty(String.fromCodePoint, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/fromCodePoint/name.js b/js/src/tests/test262/built-ins/String/fromCodePoint/name.js index 306ca1041d..0253149ffb 100644 --- a/js/src/tests/test262/built-ins/String/fromCodePoint/name.js +++ b/js/src/tests/test262/built-ins/String/fromCodePoint/name.js @@ -12,13 +12,11 @@ includes: [propertyHelper.js] features: [String.fromCodePoint] ---*/ -assert.sameValue( - String.fromCodePoint.name, 'fromCodePoint', - 'The value of `String.fromCodePoint.name` is "fromCodePoint"' -); - -verifyNotEnumerable(String.fromCodePoint, 'name'); -verifyNotWritable(String.fromCodePoint, 'name'); -verifyConfigurable(String.fromCodePoint, 'name'); +verifyProperty(String.fromCodePoint, "name", { + value: "fromCodePoint", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/fromCodePoint/not-a-constructor.js b/js/src/tests/test262/built-ins/String/fromCodePoint/not-a-constructor.js index ad07f88425..9144fe2bfc 100644 --- a/js/src/tests/test262/built-ins/String/fromCodePoint/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/fromCodePoint/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(String.fromCodePoint), false, 'isConstructor(Stri assert.throws(TypeError, () => { new String.fromCodePoint(); -}, '`new String.fromCodePoint()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/Symbol.iterator/length.js b/js/src/tests/test262/built-ins/String/prototype/Symbol.iterator/length.js index c7b43eed8a..20e1065b81 100644 --- a/js/src/tests/test262/built-ins/String/prototype/Symbol.iterator/length.js +++ b/js/src/tests/test262/built-ins/String/prototype/Symbol.iterator/length.js @@ -19,10 +19,11 @@ features: [Symbol.iterator] includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype[Symbol.iterator].length, 0); - -verifyNotEnumerable(String.prototype[Symbol.iterator], 'length'); -verifyNotWritable(String.prototype[Symbol.iterator], 'length'); -verifyConfigurable(String.prototype[Symbol.iterator], 'length'); +verifyProperty(String.prototype[Symbol.iterator], "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/Symbol.iterator/name.js b/js/src/tests/test262/built-ins/String/prototype/Symbol.iterator/name.js index 29f1ffc52e..a4471724c5 100644 --- a/js/src/tests/test262/built-ins/String/prototype/Symbol.iterator/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/Symbol.iterator/name.js @@ -22,10 +22,11 @@ features: [Symbol.iterator] includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype[Symbol.iterator].name, '[Symbol.iterator]'); - -verifyNotEnumerable(String.prototype[Symbol.iterator], 'name'); -verifyNotWritable(String.prototype[Symbol.iterator], 'name'); -verifyConfigurable(String.prototype[Symbol.iterator], 'name'); +verifyProperty(String.prototype[Symbol.iterator], "name", { + value: "[Symbol.iterator]", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/Symbol.iterator/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/Symbol.iterator/not-a-constructor.js index 33fdc254d4..8c7a28d690 100644 --- a/js/src/tests/test262/built-ins/String/prototype/Symbol.iterator/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/Symbol.iterator/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype[Symbol.iterator](); -}, '`new String.prototype[Symbol.iterator]()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/at/index-non-numeric-argument-tointeger-invalid.js b/js/src/tests/test262/built-ins/String/prototype/at/index-non-numeric-argument-tointeger-invalid.js index 64a31c0120..80fc06db0c 100644 --- a/js/src/tests/test262/built-ins/String/prototype/at/index-non-numeric-argument-tointeger-invalid.js +++ b/js/src/tests/test262/built-ins/String/prototype/at/index-non-numeric-argument-tointeger-invalid.js @@ -17,6 +17,6 @@ let s = "01"; assert.throws(TypeError, () => { s.at(Symbol()); -}, '`s.at(Symbol())` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/at/length.js b/js/src/tests/test262/built-ins/String/prototype/at/length.js index d552c459bd..c27076b9d4 100644 --- a/js/src/tests/test262/built-ins/String/prototype/at/length.js +++ b/js/src/tests/test262/built-ins/String/prototype/at/length.js @@ -14,13 +14,11 @@ features: [String.prototype.at] ---*/ assert.sameValue(typeof String.prototype.at, 'function'); -assert.sameValue( - String.prototype.at.length, 1, - 'The value of String.prototype.at.length is 1' -); - -verifyNotEnumerable(String.prototype.at, 'length'); -verifyNotWritable(String.prototype.at, 'length'); -verifyConfigurable(String.prototype.at, 'length'); +verifyProperty(String.prototype.at, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/at/return-abrupt-from-this.js b/js/src/tests/test262/built-ins/String/prototype/at/return-abrupt-from-this.js index 0dc4011fce..f9222d733e 100644 --- a/js/src/tests/test262/built-ins/String/prototype/at/return-abrupt-from-this.js +++ b/js/src/tests/test262/built-ins/String/prototype/at/return-abrupt-from-this.js @@ -15,10 +15,10 @@ assert.sameValue(typeof String.prototype.at, 'function'); assert.throws(TypeError, () => { String.prototype.at.call(undefined); -}, '`String.prototype.at.call(undefined)` throws TypeError'); +}); assert.throws(TypeError, () => { String.prototype.at.call(null); -}, '`String.prototype.at.call(null)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/charAt/name.js b/js/src/tests/test262/built-ins/String/prototype/charAt/name.js index 13a245e2fc..d158385939 100644 --- a/js/src/tests/test262/built-ins/String/prototype/charAt/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/charAt/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.charAt.name, "charAt"); - -verifyNotEnumerable(String.prototype.charAt, "name"); -verifyNotWritable(String.prototype.charAt, "name"); -verifyConfigurable(String.prototype.charAt, "name"); +verifyProperty(String.prototype.charAt, "name", { + value: "charAt", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/charAt/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/charAt/not-a-constructor.js index 6e00163a90..84d27e581b 100644 --- a/js/src/tests/test262/built-ins/String/prototype/charAt/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/charAt/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.charAt(); -}, '`new String.prototype.charAt()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/charCodeAt/name.js b/js/src/tests/test262/built-ins/String/prototype/charCodeAt/name.js index 9916d17abf..4e877b4c7b 100644 --- a/js/src/tests/test262/built-ins/String/prototype/charCodeAt/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/charCodeAt/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.charCodeAt.name, "charCodeAt"); - -verifyNotEnumerable(String.prototype.charCodeAt, "name"); -verifyNotWritable(String.prototype.charCodeAt, "name"); -verifyConfigurable(String.prototype.charCodeAt, "name"); +verifyProperty(String.prototype.charCodeAt, "name", { + value: "charCodeAt", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/charCodeAt/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/charCodeAt/not-a-constructor.js index 282fcb0b55..caee3a678f 100644 --- a/js/src/tests/test262/built-ins/String/prototype/charCodeAt/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/charCodeAt/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.charCodeAt(); -}, '`new String.prototype.charCodeAt()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/codePointAt/length.js b/js/src/tests/test262/built-ins/String/prototype/codePointAt/length.js index 99acb42698..95046c634f 100644 --- a/js/src/tests/test262/built-ins/String/prototype/codePointAt/length.js +++ b/js/src/tests/test262/built-ins/String/prototype/codePointAt/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - String.prototype.codePointAt.length, 1, - 'The value of `String.prototype.codePointAt.length` is `1`' -); - -verifyNotEnumerable(String.prototype.codePointAt, 'length'); -verifyNotWritable(String.prototype.codePointAt, 'length'); -verifyConfigurable(String.prototype.codePointAt, 'length'); +verifyProperty(String.prototype.codePointAt, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/codePointAt/name.js b/js/src/tests/test262/built-ins/String/prototype/codePointAt/name.js index db3ce58ddc..f1ff47b316 100644 --- a/js/src/tests/test262/built-ins/String/prototype/codePointAt/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/codePointAt/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - String.prototype.codePointAt.name, 'codePointAt', - 'The value of `String.prototype.codePointAt.name` is `"codePointAt"`' -); - -verifyNotEnumerable(String.prototype.codePointAt, 'name'); -verifyNotWritable(String.prototype.codePointAt, 'name'); -verifyConfigurable(String.prototype.codePointAt, 'name'); +verifyProperty(String.prototype.codePointAt, "name", { + value: "codePointAt", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/codePointAt/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/codePointAt/not-a-constructor.js index 56d31f5280..e47b22bf17 100644 --- a/js/src/tests/test262/built-ins/String/prototype/codePointAt/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/codePointAt/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.codePointAt(); -}, '`new String.prototype.codePointAt()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/concat/name.js b/js/src/tests/test262/built-ins/String/prototype/concat/name.js index 6a4181b098..0fb7b7da0e 100644 --- a/js/src/tests/test262/built-ins/String/prototype/concat/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/concat/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.concat.name, "concat"); - -verifyNotEnumerable(String.prototype.concat, "name"); -verifyNotWritable(String.prototype.concat, "name"); -verifyConfigurable(String.prototype.concat, "name"); +verifyProperty(String.prototype.concat, "name", { + value: "concat", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/concat/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/concat/not-a-constructor.js index e0287c912b..048d524256 100644 --- a/js/src/tests/test262/built-ins/String/prototype/concat/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/concat/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.concat(); -}, '`new String.prototype.concat()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/endsWith/length.js b/js/src/tests/test262/built-ins/String/prototype/endsWith/length.js index d5040bab96..edfe1585f0 100644 --- a/js/src/tests/test262/built-ins/String/prototype/endsWith/length.js +++ b/js/src/tests/test262/built-ins/String/prototype/endsWith/length.js @@ -13,13 +13,11 @@ includes: [propertyHelper.js] features: [String.prototype.endsWith] ---*/ -assert.sameValue( - String.prototype.endsWith.length, 1, - 'The value of `String.prototype.endsWith.length` is `1`' -); - -verifyNotEnumerable(String.prototype.endsWith, 'length'); -verifyNotWritable(String.prototype.endsWith, 'length'); -verifyConfigurable(String.prototype.endsWith, 'length'); +verifyProperty(String.prototype.endsWith, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/endsWith/name.js b/js/src/tests/test262/built-ins/String/prototype/endsWith/name.js index d4aa6ee5f5..27b35d7bf3 100644 --- a/js/src/tests/test262/built-ins/String/prototype/endsWith/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/endsWith/name.js @@ -13,13 +13,11 @@ includes: [propertyHelper.js] features: [String.prototype.endsWith] ---*/ -assert.sameValue( - String.prototype.endsWith.name, 'endsWith', - 'The value of `String.prototype.endsWith.name` is `"endsWith"`' -); - -verifyNotEnumerable(String.prototype.endsWith, 'name'); -verifyNotWritable(String.prototype.endsWith, 'name'); -verifyConfigurable(String.prototype.endsWith, 'name'); +verifyProperty(String.prototype.endsWith, "name", { + value: "endsWith", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/endsWith/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/endsWith/not-a-constructor.js index 2112ea842d..52076bb384 100644 --- a/js/src/tests/test262/built-ins/String/prototype/endsWith/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/endsWith/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.endsWith(); -}, '`new String.prototype.endsWith()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/includes/length.js b/js/src/tests/test262/built-ins/String/prototype/includes/length.js index c74ad3f706..8ee6ae06e9 100644 --- a/js/src/tests/test262/built-ins/String/prototype/includes/length.js +++ b/js/src/tests/test262/built-ins/String/prototype/includes/length.js @@ -13,13 +13,11 @@ includes: [propertyHelper.js] features: [String.prototype.includes] ---*/ -assert.sameValue( - String.prototype.includes.length, 1, - 'The value of `String.prototype.includes.length` is `1`' -); - -verifyNotEnumerable(String.prototype.includes, 'length'); -verifyNotWritable(String.prototype.includes, 'length'); -verifyConfigurable(String.prototype.includes, 'length'); +verifyProperty(String.prototype.includes, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/includes/name.js b/js/src/tests/test262/built-ins/String/prototype/includes/name.js index 24bf088db4..fe8cdc1d5d 100644 --- a/js/src/tests/test262/built-ins/String/prototype/includes/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/includes/name.js @@ -13,13 +13,11 @@ includes: [propertyHelper.js] features: [String.prototype.includes] ---*/ -assert.sameValue( - String.prototype.includes.name, 'includes', - 'The value of `String.prototype.includes.name` is `"includes"`' -); - -verifyNotEnumerable(String.prototype.includes, 'name'); -verifyNotWritable(String.prototype.includes, 'name'); -verifyConfigurable(String.prototype.includes, 'name'); +verifyProperty(String.prototype.includes, "name", { + value: "includes", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/includes/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/includes/not-a-constructor.js index f276a53f92..ccc6ce782d 100644 --- a/js/src/tests/test262/built-ins/String/prototype/includes/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/includes/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.includes(1); -}, '`new String.prototype.includes(1)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/indexOf/name.js b/js/src/tests/test262/built-ins/String/prototype/indexOf/name.js index ff0064a42f..cce21bf05c 100644 --- a/js/src/tests/test262/built-ins/String/prototype/indexOf/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/indexOf/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.indexOf.name, "indexOf"); - -verifyNotEnumerable(String.prototype.indexOf, "name"); -verifyNotWritable(String.prototype.indexOf, "name"); -verifyConfigurable(String.prototype.indexOf, "name"); +verifyProperty(String.prototype.indexOf, "name", { + value: "indexOf", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/indexOf/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/indexOf/not-a-constructor.js index 6cc8bc2efb..c21805ebdd 100644 --- a/js/src/tests/test262/built-ins/String/prototype/indexOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/indexOf/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.indexOf(); -}, '`new String.prototype.indexOf()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/isWellFormed/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/isWellFormed/not-a-constructor.js index 6943b3c2e8..d3cd1f6325 100644 --- a/js/src/tests/test262/built-ins/String/prototype/isWellFormed/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/isWellFormed/not-a-constructor.js @@ -29,6 +29,6 @@ assert.sameValue( assert.throws(TypeError, function () { new String.prototype.isWellFormed(); -}, '`new String.prototype.isWellFormed()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/isWellFormed/return-abrupt-from-this.js b/js/src/tests/test262/built-ins/String/prototype/isWellFormed/return-abrupt-from-this.js index c883015d19..900b901076 100644 --- a/js/src/tests/test262/built-ins/String/prototype/isWellFormed/return-abrupt-from-this.js +++ b/js/src/tests/test262/built-ins/String/prototype/isWellFormed/return-abrupt-from-this.js @@ -15,10 +15,10 @@ assert.sameValue(typeof String.prototype.isWellFormed, 'function'); assert.throws(TypeError, function () { String.prototype.isWellFormed.call(undefined); -}, '`String.prototype.isWellFormed.call(undefined)` throws TypeError'); +}); assert.throws(TypeError, function () { String.prototype.isWellFormed.call(null); -}, '`String.prototype.isWellFormed.call(null)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/lastIndexOf/name.js b/js/src/tests/test262/built-ins/String/prototype/lastIndexOf/name.js index 62353147a8..003da3f8f0 100644 --- a/js/src/tests/test262/built-ins/String/prototype/lastIndexOf/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/lastIndexOf/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.lastIndexOf.name, "lastIndexOf"); - -verifyNotEnumerable(String.prototype.lastIndexOf, "name"); -verifyNotWritable(String.prototype.lastIndexOf, "name"); -verifyConfigurable(String.prototype.lastIndexOf, "name"); +verifyProperty(String.prototype.lastIndexOf, "name", { + value: "lastIndexOf", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/lastIndexOf/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/lastIndexOf/not-a-constructor.js index 14485de716..34a943e4f3 100644 --- a/js/src/tests/test262/built-ins/String/prototype/lastIndexOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/lastIndexOf/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.lastIndexOf(); -}, '`new String.prototype.lastIndexOf()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/localeCompare/name.js b/js/src/tests/test262/built-ins/String/prototype/localeCompare/name.js index 81a2062386..e6e3b4f8cf 100644 --- a/js/src/tests/test262/built-ins/String/prototype/localeCompare/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/localeCompare/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.localeCompare.name, "localeCompare"); - -verifyNotEnumerable(String.prototype.localeCompare, "name"); -verifyNotWritable(String.prototype.localeCompare, "name"); -verifyConfigurable(String.prototype.localeCompare, "name"); +verifyProperty(String.prototype.localeCompare, "name", { + value: "localeCompare", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/localeCompare/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/localeCompare/not-a-constructor.js index c335172ddc..8b6f0b874c 100644 --- a/js/src/tests/test262/built-ins/String/prototype/localeCompare/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/localeCompare/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.localeCompare(); -}, '`new String.prototype.localeCompare()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/match/name.js b/js/src/tests/test262/built-ins/String/prototype/match/name.js index 09c3133348..87ba9960ed 100644 --- a/js/src/tests/test262/built-ins/String/prototype/match/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/match/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.match.name, "match"); - -verifyNotEnumerable(String.prototype.match, "name"); -verifyNotWritable(String.prototype.match, "name"); -verifyConfigurable(String.prototype.match, "name"); +verifyProperty(String.prototype.match, "name", { + value: "match", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/match/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/match/not-a-constructor.js index 91f5ec5a8e..5199da96e9 100644 --- a/js/src/tests/test262/built-ins/String/prototype/match/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/match/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.match(); -}, '`new String.prototype.match()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/length.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/length.js index 49fc24912e..40121111fb 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/length.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/length.js @@ -23,10 +23,11 @@ includes: [propertyHelper.js] features: [String.prototype.matchAll] ---*/ -assert.sameValue(String.prototype.matchAll.length, 1); - -verifyNotEnumerable(String.prototype.matchAll, 'length'); -verifyNotWritable(String.prototype.matchAll, 'length'); -verifyConfigurable(String.prototype.matchAll, 'length'); +verifyProperty(String.prototype.matchAll, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/name.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/name.js index efab01207f..8044946076 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/name.js @@ -21,10 +21,11 @@ includes: [propertyHelper.js] features: [String.prototype.matchAll] ---*/ -assert.sameValue(String.prototype.matchAll.name, 'matchAll'); - -verifyNotEnumerable(String.prototype.matchAll, 'name'); -verifyNotWritable(String.prototype.matchAll, 'name'); -verifyConfigurable(String.prototype.matchAll, 'name'); +verifyProperty(String.prototype.matchAll, "name", { + value: "matchAll", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/not-a-constructor.js index e4a6ba973c..a895cd6797 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.matchAll(); -}, '`new String.prototype.matchAll()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/normalize/length.js b/js/src/tests/test262/built-ins/String/prototype/normalize/length.js index f95c97046e..7ce057a565 100644 --- a/js/src/tests/test262/built-ins/String/prototype/normalize/length.js +++ b/js/src/tests/test262/built-ins/String/prototype/normalize/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - String.prototype.normalize.length, 0, - 'The value of `String.prototype.normalize.length` is `0`' -); - -verifyNotEnumerable(String.prototype.normalize, 'length'); -verifyNotWritable(String.prototype.normalize, 'length'); -verifyConfigurable(String.prototype.normalize, 'length'); +verifyProperty(String.prototype.normalize, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/normalize/name.js b/js/src/tests/test262/built-ins/String/prototype/normalize/name.js index e3d3ef3acc..9ed6fc9119 100644 --- a/js/src/tests/test262/built-ins/String/prototype/normalize/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/normalize/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - String.prototype.normalize.name, 'normalize', - 'The value of `String.prototype.normalize.name` is `"normalize"`' -); - -verifyNotEnumerable(String.prototype.normalize, 'name'); -verifyNotWritable(String.prototype.normalize, 'name'); -verifyConfigurable(String.prototype.normalize, 'name'); +verifyProperty(String.prototype.normalize, "name", { + value: "normalize", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/normalize/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/normalize/not-a-constructor.js index e1c16b4e10..3e7e6c65cd 100644 --- a/js/src/tests/test262/built-ins/String/prototype/normalize/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/normalize/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.normalize(); -}, '`new String.prototype.normalize()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/padEnd/function-length.js b/js/src/tests/test262/built-ins/String/prototype/padEnd/function-length.js index 4b38c5a4a4..267e983c0c 100644 --- a/js/src/tests/test262/built-ins/String/prototype/padEnd/function-length.js +++ b/js/src/tests/test262/built-ins/String/prototype/padEnd/function-length.js @@ -8,10 +8,11 @@ author: Jordan Harband includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.padEnd.length, 1, 'Expected String#padEnd.length to be 1'); - -verifyNotEnumerable(String.prototype.padEnd, 'length'); -verifyNotWritable(String.prototype.padEnd, 'length'); -verifyConfigurable(String.prototype.padEnd, 'length'); +verifyProperty(String.prototype.padEnd, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/padEnd/function-name.js b/js/src/tests/test262/built-ins/String/prototype/padEnd/function-name.js index cf0c201497..1ffb11b8fe 100644 --- a/js/src/tests/test262/built-ins/String/prototype/padEnd/function-name.js +++ b/js/src/tests/test262/built-ins/String/prototype/padEnd/function-name.js @@ -8,14 +8,11 @@ author: Jordan Harband includes: [propertyHelper.js] ---*/ -assert.sameValue( - String.prototype.padEnd.name, - 'padEnd', - 'Expected String#padEnd.name to be "padEnd"' -); - -verifyNotEnumerable(String.prototype.padEnd, 'name'); -verifyNotWritable(String.prototype.padEnd, 'name'); -verifyConfigurable(String.prototype.padEnd, 'name'); +verifyProperty(String.prototype.padEnd, "name", { + value: "padEnd", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/padEnd/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/padEnd/not-a-constructor.js index ed5f84458c..4041e6386f 100644 --- a/js/src/tests/test262/built-ins/String/prototype/padEnd/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/padEnd/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.padEnd(); -}, '`new String.prototype.padEnd()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/padStart/function-length.js b/js/src/tests/test262/built-ins/String/prototype/padStart/function-length.js index 056e797a01..63f28d092b 100644 --- a/js/src/tests/test262/built-ins/String/prototype/padStart/function-length.js +++ b/js/src/tests/test262/built-ins/String/prototype/padStart/function-length.js @@ -8,10 +8,11 @@ author: Jordan Harband includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.padStart.length, 1, 'Expected String#padStart.length to be 1'); - -verifyNotEnumerable(String.prototype.padStart, 'length'); -verifyNotWritable(String.prototype.padStart, 'length'); -verifyConfigurable(String.prototype.padStart, 'length'); +verifyProperty(String.prototype.padStart, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/padStart/function-name.js b/js/src/tests/test262/built-ins/String/prototype/padStart/function-name.js index f7fb59889b..07de295a58 100644 --- a/js/src/tests/test262/built-ins/String/prototype/padStart/function-name.js +++ b/js/src/tests/test262/built-ins/String/prototype/padStart/function-name.js @@ -8,14 +8,11 @@ author: Jordan Harband includes: [propertyHelper.js] ---*/ -assert.sameValue( - String.prototype.padStart.name, - 'padStart', - 'Expected String#padStart.name to be "padStart"' -); - -verifyNotEnumerable(String.prototype.padStart, 'name'); -verifyNotWritable(String.prototype.padStart, 'name'); -verifyConfigurable(String.prototype.padStart, 'name'); +verifyProperty(String.prototype.padStart, "name", { + value: "padStart", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/padStart/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/padStart/not-a-constructor.js index 22ae62b3b1..21e77ab9da 100644 --- a/js/src/tests/test262/built-ins/String/prototype/padStart/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/padStart/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.padStart(); -}, '`new String.prototype.padStart()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/repeat/length.js b/js/src/tests/test262/built-ins/String/prototype/repeat/length.js index 2151718be9..3a2663feb6 100644 --- a/js/src/tests/test262/built-ins/String/prototype/repeat/length.js +++ b/js/src/tests/test262/built-ins/String/prototype/repeat/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - String.prototype.repeat.length, 1, - 'The value of `String.prototype.repeat.length` is `1`' -); - -verifyNotEnumerable(String.prototype.repeat, 'length'); -verifyNotWritable(String.prototype.repeat, 'length'); -verifyConfigurable(String.prototype.repeat, 'length'); +verifyProperty(String.prototype.repeat, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/repeat/name.js b/js/src/tests/test262/built-ins/String/prototype/repeat/name.js index 3c640857de..5be524f0c7 100644 --- a/js/src/tests/test262/built-ins/String/prototype/repeat/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/repeat/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - String.prototype.repeat.name, 'repeat', - 'The value of `String.prototype.repeat.name` is `"repeat"`' -); - -verifyNotEnumerable(String.prototype.repeat, 'name'); -verifyNotWritable(String.prototype.repeat, 'name'); -verifyConfigurable(String.prototype.repeat, 'name'); +verifyProperty(String.prototype.repeat, "name", { + value: "repeat", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/repeat/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/repeat/not-a-constructor.js index b8acfb0e7f..ca9c878ce7 100644 --- a/js/src/tests/test262/built-ins/String/prototype/repeat/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/repeat/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.repeat(); -}, '`new String.prototype.repeat()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/replace/name.js b/js/src/tests/test262/built-ins/String/prototype/replace/name.js index 7e783a3585..c81cbe79d6 100644 --- a/js/src/tests/test262/built-ins/String/prototype/replace/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/replace/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.replace.name, "replace"); - -verifyNotEnumerable(String.prototype.replace, "name"); -verifyNotWritable(String.prototype.replace, "name"); -verifyConfigurable(String.prototype.replace, "name"); +verifyProperty(String.prototype.replace, "name", { + value: "replace", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/replace/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/replace/not-a-constructor.js index c28df5ae80..b8be7a68c2 100644 --- a/js/src/tests/test262/built-ins/String/prototype/replace/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/replace/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.replace(); -}, '`new String.prototype.replace()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/replaceAll/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/replaceAll/not-a-constructor.js index b3b9ca6503..6aa72e106a 100644 --- a/js/src/tests/test262/built-ins/String/prototype/replaceAll/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/replaceAll/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.replaceAll(); -}, '`new String.prototype.replaceAll()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/search/name.js b/js/src/tests/test262/built-ins/String/prototype/search/name.js index ad555b4841..b8dd108625 100644 --- a/js/src/tests/test262/built-ins/String/prototype/search/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/search/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.search.name, "search"); - -verifyNotEnumerable(String.prototype.search, "name"); -verifyNotWritable(String.prototype.search, "name"); -verifyConfigurable(String.prototype.search, "name"); +verifyProperty(String.prototype.search, "name", { + value: "search", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/search/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/search/not-a-constructor.js index c61e4f3b16..ef329bad51 100644 --- a/js/src/tests/test262/built-ins/String/prototype/search/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/search/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.search(); -}, '`new String.prototype.search()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/slice/name.js b/js/src/tests/test262/built-ins/String/prototype/slice/name.js index 24ea647443..f0c60ab056 100644 --- a/js/src/tests/test262/built-ins/String/prototype/slice/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/slice/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.slice.name, "slice"); - -verifyNotEnumerable(String.prototype.slice, "name"); -verifyNotWritable(String.prototype.slice, "name"); -verifyConfigurable(String.prototype.slice, "name"); +verifyProperty(String.prototype.slice, "name", { + value: "slice", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/slice/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/slice/not-a-constructor.js index e4220ef5b3..8a9bb9e794 100644 --- a/js/src/tests/test262/built-ins/String/prototype/slice/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/slice/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.slice(); -}, '`new String.prototype.slice()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/split/name.js b/js/src/tests/test262/built-ins/String/prototype/split/name.js index e5ab74fed8..c9d3bf7809 100644 --- a/js/src/tests/test262/built-ins/String/prototype/split/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/split/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.split.name, "split"); - -verifyNotEnumerable(String.prototype.split, "name"); -verifyNotWritable(String.prototype.split, "name"); -verifyConfigurable(String.prototype.split, "name"); +verifyProperty(String.prototype.split, "name", { + value: "split", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/split/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/split/not-a-constructor.js index 09e41d6233..b69a0796ee 100644 --- a/js/src/tests/test262/built-ins/String/prototype/split/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/split/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.split(); -}, '`new String.prototype.split()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/startsWith/length.js b/js/src/tests/test262/built-ins/String/prototype/startsWith/length.js index 3e19e74994..5f27578aba 100644 --- a/js/src/tests/test262/built-ins/String/prototype/startsWith/length.js +++ b/js/src/tests/test262/built-ins/String/prototype/startsWith/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - String.prototype.startsWith.length, 1, - 'The value of `String.prototype.startsWith.length` is `1`' -); - -verifyNotEnumerable(String.prototype.startsWith, 'length'); -verifyNotWritable(String.prototype.startsWith, 'length'); -verifyConfigurable(String.prototype.startsWith, 'length'); +verifyProperty(String.prototype.startsWith, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/startsWith/name.js b/js/src/tests/test262/built-ins/String/prototype/startsWith/name.js index 4baa4a3076..ba8907b725 100644 --- a/js/src/tests/test262/built-ins/String/prototype/startsWith/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/startsWith/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - String.prototype.startsWith.name, 'startsWith', - 'The value of `String.prototype.startsWith.name` is `"startsWith"`' -); - -verifyNotEnumerable(String.prototype.startsWith, 'name'); -verifyNotWritable(String.prototype.startsWith, 'name'); -verifyConfigurable(String.prototype.startsWith, 'name'); +verifyProperty(String.prototype.startsWith, "name", { + value: "startsWith", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/startsWith/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/startsWith/not-a-constructor.js index a286537efc..33f51122fe 100644 --- a/js/src/tests/test262/built-ins/String/prototype/startsWith/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/startsWith/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.startsWith(); -}, '`new String.prototype.startsWith()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/substring/name.js b/js/src/tests/test262/built-ins/String/prototype/substring/name.js index bbfb54a254..144a1a72ac 100644 --- a/js/src/tests/test262/built-ins/String/prototype/substring/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/substring/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.substring.name, "substring"); - -verifyNotEnumerable(String.prototype.substring, "name"); -verifyNotWritable(String.prototype.substring, "name"); -verifyConfigurable(String.prototype.substring, "name"); +verifyProperty(String.prototype.substring, "name", { + value: "substring", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/substring/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/substring/not-a-constructor.js index 981b8cd665..2f2f2b2058 100644 --- a/js/src/tests/test262/built-ins/String/prototype/substring/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/substring/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.substring(); -}, '`new String.prototype.substring()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/name.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/name.js index 0293ba687b..be7e29d94b 100644 --- a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.toLocaleLowerCase.name, "toLocaleLowerCase"); - -verifyNotEnumerable(String.prototype.toLocaleLowerCase, "name"); -verifyNotWritable(String.prototype.toLocaleLowerCase, "name"); -verifyConfigurable(String.prototype.toLocaleLowerCase, "name"); +verifyProperty(String.prototype.toLocaleLowerCase, "name", { + value: "toLocaleLowerCase", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/not-a-constructor.js index c6b26ea910..9842bef5ba 100644 --- a/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleLowerCase/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.toLocaleLowerCase(); -}, '`new String.prototype.toLocaleLowerCase()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleUpperCase/name.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleUpperCase/name.js index e20dd69220..b9d7ac4611 100644 --- a/js/src/tests/test262/built-ins/String/prototype/toLocaleUpperCase/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleUpperCase/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.toLocaleUpperCase.name, "toLocaleUpperCase"); - -verifyNotEnumerable(String.prototype.toLocaleUpperCase, "name"); -verifyNotWritable(String.prototype.toLocaleUpperCase, "name"); -verifyConfigurable(String.prototype.toLocaleUpperCase, "name"); +verifyProperty(String.prototype.toLocaleUpperCase, "name", { + value: "toLocaleUpperCase", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLocaleUpperCase/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/toLocaleUpperCase/not-a-constructor.js index 2dbfcb12e1..382177d2be 100644 --- a/js/src/tests/test262/built-ins/String/prototype/toLocaleUpperCase/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/toLocaleUpperCase/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.toLocaleUpperCase(); -}, '`new String.prototype.toLocaleUpperCase()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLowerCase/name.js b/js/src/tests/test262/built-ins/String/prototype/toLowerCase/name.js index 48f9222ed5..cdd2ba2acd 100644 --- a/js/src/tests/test262/built-ins/String/prototype/toLowerCase/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/toLowerCase/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.toLowerCase.name, "toLowerCase"); - -verifyNotEnumerable(String.prototype.toLowerCase, "name"); -verifyNotWritable(String.prototype.toLowerCase, "name"); -verifyConfigurable(String.prototype.toLowerCase, "name"); +verifyProperty(String.prototype.toLowerCase, "name", { + value: "toLowerCase", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toLowerCase/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/toLowerCase/not-a-constructor.js index e9d92daf54..3e13c9136d 100644 --- a/js/src/tests/test262/built-ins/String/prototype/toLowerCase/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/toLowerCase/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.toLowerCase(); -}, '`new String.prototype.toLowerCase()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toString/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/toString/not-a-constructor.js index 59cdfc18e5..01da771f46 100644 --- a/js/src/tests/test262/built-ins/String/prototype/toString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/toString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.toString(); -}, '`new String.prototype.toString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toUpperCase/name.js b/js/src/tests/test262/built-ins/String/prototype/toUpperCase/name.js index 9e2922beb0..f44b3b259f 100644 --- a/js/src/tests/test262/built-ins/String/prototype/toUpperCase/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/toUpperCase/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.toUpperCase.name, "toUpperCase"); - -verifyNotEnumerable(String.prototype.toUpperCase, "name"); -verifyNotWritable(String.prototype.toUpperCase, "name"); -verifyConfigurable(String.prototype.toUpperCase, "name"); +verifyProperty(String.prototype.toUpperCase, "name", { + value: "toUpperCase", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toUpperCase/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/toUpperCase/not-a-constructor.js index 4820c87b12..38fa7fe5e4 100644 --- a/js/src/tests/test262/built-ins/String/prototype/toUpperCase/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/toUpperCase/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.toUpperCase(); -}, '`new String.prototype.toUpperCase()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toWellFormed/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/toWellFormed/not-a-constructor.js index ccd3bc63a7..b83a6022e7 100644 --- a/js/src/tests/test262/built-ins/String/prototype/toWellFormed/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/toWellFormed/not-a-constructor.js @@ -29,6 +29,6 @@ assert.sameValue( assert.throws(TypeError, function () { new String.prototype.toWellFormed(); -}, '`new String.prototype.toWellFormed()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/toWellFormed/return-abrupt-from-this.js b/js/src/tests/test262/built-ins/String/prototype/toWellFormed/return-abrupt-from-this.js index f39c858f6f..0ebf8a227f 100644 --- a/js/src/tests/test262/built-ins/String/prototype/toWellFormed/return-abrupt-from-this.js +++ b/js/src/tests/test262/built-ins/String/prototype/toWellFormed/return-abrupt-from-this.js @@ -15,10 +15,10 @@ assert.sameValue(typeof String.prototype.toWellFormed, 'function'); assert.throws(TypeError, function () { String.prototype.toWellFormed.call(undefined); -}, '`String.prototype.toWellFormed.call(undefined)` throws TypeError'); +}); assert.throws(TypeError, function () { String.prototype.toWellFormed.call(null); -}, '`String.prototype.toWellFormed.call(null)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/name.js b/js/src/tests/test262/built-ins/String/prototype/trim/name.js index 3f983c303c..995e4e5265 100644 --- a/js/src/tests/test262/built-ins/String/prototype/trim/name.js +++ b/js/src/tests/test262/built-ins/String/prototype/trim/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(String.prototype.trim.name, "trim"); - -verifyNotEnumerable(String.prototype.trim, "name"); -verifyNotWritable(String.prototype.trim, "name"); -verifyConfigurable(String.prototype.trim, "name"); +verifyProperty(String.prototype.trim, "name", { + value: "trim", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trim/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/trim/not-a-constructor.js index 20118ff8fc..38fe47625f 100644 --- a/js/src/tests/test262/built-ins/String/prototype/trim/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/trim/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.trim(); -}, '`new String.prototype.trim()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trimEnd/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/trimEnd/not-a-constructor.js index 0d8bea1970..151f5baad5 100644 --- a/js/src/tests/test262/built-ins/String/prototype/trimEnd/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/trimEnd/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.trimEnd(); -}, '`new String.prototype.trimEnd()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trimStart/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/trimStart/not-a-constructor.js index fe6ba1ca22..f1c36d37c0 100644 --- a/js/src/tests/test262/built-ins/String/prototype/trimStart/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/trimStart/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.trimStart(); -}, '`new String.prototype.trimStart()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/valueOf/not-a-constructor.js b/js/src/tests/test262/built-ins/String/prototype/valueOf/not-a-constructor.js index 81afa416d4..fe9e189d3b 100644 --- a/js/src/tests/test262/built-ins/String/prototype/valueOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/prototype/valueOf/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { new String.prototype.valueOf(); -}, '`new String.prototype.valueOf()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/raw/length.js b/js/src/tests/test262/built-ins/String/raw/length.js index deb433fde5..7af20ab224 100644 --- a/js/src/tests/test262/built-ins/String/raw/length.js +++ b/js/src/tests/test262/built-ins/String/raw/length.js @@ -11,13 +11,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - String.raw.length, 1, - 'The value of `String.raw.length` is `1`' -); - -verifyNotEnumerable(String.raw, 'length'); -verifyNotWritable(String.raw, 'length'); -verifyConfigurable(String.raw, 'length'); +verifyProperty(String.raw, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/raw/name.js b/js/src/tests/test262/built-ins/String/raw/name.js index c7533e923b..c9c7f8a518 100644 --- a/js/src/tests/test262/built-ins/String/raw/name.js +++ b/js/src/tests/test262/built-ins/String/raw/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - String.raw.name, 'raw', - 'The value of `String.raw.name` is `"raw"`' -); - -verifyNotEnumerable(String.raw, 'name'); -verifyNotWritable(String.raw, 'name'); -verifyConfigurable(String.raw, 'name'); +verifyProperty(String.raw, "name", { + value: "raw", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/raw/not-a-constructor.js b/js/src/tests/test262/built-ins/String/raw/not-a-constructor.js index 6beda7f32f..d0c324b883 100644 --- a/js/src/tests/test262/built-ins/String/raw/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/String/raw/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(String.raw), false, 'isConstructor(String.raw) mu assert.throws(TypeError, () => { new String.raw({raw: []}, []); -}, '`new String.raw({raw: []}, [])` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/StringIteratorPrototype/next/length.js b/js/src/tests/test262/built-ins/StringIteratorPrototype/next/length.js index 6facc1101b..74deed54d3 100644 --- a/js/src/tests/test262/built-ins/StringIteratorPrototype/next/length.js +++ b/js/src/tests/test262/built-ins/StringIteratorPrototype/next/length.js @@ -25,10 +25,11 @@ features: [Symbol.iterator] var StringIteratorProto = Object.getPrototypeOf(new String()[Symbol.iterator]()); -assert.sameValue(StringIteratorProto.next.length, 0); - -verifyNotEnumerable(StringIteratorProto.next, "length"); -verifyNotWritable(StringIteratorProto.next, "length"); -verifyConfigurable(StringIteratorProto.next, "length"); +verifyProperty(StringIteratorProto.next, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/StringIteratorPrototype/next/name.js b/js/src/tests/test262/built-ins/StringIteratorPrototype/next/name.js index f990a85d2f..3947cf00da 100644 --- a/js/src/tests/test262/built-ins/StringIteratorPrototype/next/name.js +++ b/js/src/tests/test262/built-ins/StringIteratorPrototype/next/name.js @@ -22,10 +22,11 @@ features: [Symbol.iterator] var StringIteratorProto = Object.getPrototypeOf(new String()[Symbol.iterator]()); -assert.sameValue(StringIteratorProto.next.name, "next"); - -verifyNotEnumerable(StringIteratorProto.next, "name"); -verifyNotWritable(StringIteratorProto.next, "name"); -verifyConfigurable(StringIteratorProto.next, "name"); +verifyProperty(StringIteratorProto.next, "name", { + value: "next", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Symbol/for/length.js b/js/src/tests/test262/built-ins/Symbol/for/length.js index 5875d22702..17c82f8979 100644 --- a/js/src/tests/test262/built-ins/Symbol/for/length.js +++ b/js/src/tests/test262/built-ins/Symbol/for/length.js @@ -23,10 +23,11 @@ includes: [propertyHelper.js] features: [Symbol] ---*/ -assert.sameValue(Symbol.for.length, 1); - -verifyNotEnumerable(Symbol.for, "length"); -verifyNotWritable(Symbol.for, "length"); -verifyConfigurable(Symbol.for, "length"); +verifyProperty(Symbol.for, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Symbol/for/name.js b/js/src/tests/test262/built-ins/Symbol/for/name.js index fce43732c0..d7674139e5 100644 --- a/js/src/tests/test262/built-ins/Symbol/for/name.js +++ b/js/src/tests/test262/built-ins/Symbol/for/name.js @@ -20,10 +20,11 @@ includes: [propertyHelper.js] features: [Symbol] ---*/ -assert.sameValue(Symbol.for.name, "for"); - -verifyNotEnumerable(Symbol.for, "name"); -verifyNotWritable(Symbol.for, "name"); -verifyConfigurable(Symbol.for, "name"); +verifyProperty(Symbol.for, "name", { + value: "for", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Symbol/for/not-a-constructor.js b/js/src/tests/test262/built-ins/Symbol/for/not-a-constructor.js index a90a09e9a3..3e88dd3a7b 100644 --- a/js/src/tests/test262/built-ins/Symbol/for/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Symbol/for/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Symbol.for), false, 'isConstructor(Symbol.for) mu assert.throws(TypeError, () => { new Symbol.for(); -}, '`new Symbol.for()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Symbol/keyFor/length.js b/js/src/tests/test262/built-ins/Symbol/keyFor/length.js index 8f1296daf6..b01ae0f8bf 100644 --- a/js/src/tests/test262/built-ins/Symbol/keyFor/length.js +++ b/js/src/tests/test262/built-ins/Symbol/keyFor/length.js @@ -23,10 +23,11 @@ includes: [propertyHelper.js] features: [Symbol] ---*/ -assert.sameValue(Symbol.keyFor.length, 1); - -verifyNotEnumerable(Symbol.keyFor, "length"); -verifyNotWritable(Symbol.keyFor, "length"); -verifyConfigurable(Symbol.keyFor, "length"); +verifyProperty(Symbol.keyFor, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Symbol/keyFor/name.js b/js/src/tests/test262/built-ins/Symbol/keyFor/name.js index 10adeeb674..9bbd98a48d 100644 --- a/js/src/tests/test262/built-ins/Symbol/keyFor/name.js +++ b/js/src/tests/test262/built-ins/Symbol/keyFor/name.js @@ -20,10 +20,11 @@ includes: [propertyHelper.js] features: [Symbol] ---*/ -assert.sameValue(Symbol.keyFor.name, "keyFor"); - -verifyNotEnumerable(Symbol.keyFor, "name"); -verifyNotWritable(Symbol.keyFor, "name"); -verifyConfigurable(Symbol.keyFor, "name"); +verifyProperty(Symbol.keyFor, "name", { + value: "keyFor", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Symbol/keyFor/not-a-constructor.js b/js/src/tests/test262/built-ins/Symbol/keyFor/not-a-constructor.js index 61d6b676d6..ac45a99ffe 100644 --- a/js/src/tests/test262/built-ins/Symbol/keyFor/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Symbol/keyFor/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(Symbol.keyFor), false, 'isConstructor(Symbol.keyF assert.throws(TypeError, () => { new Symbol.keyFor(Symbol()); -}, '`new Symbol.keyFor(Symbol())` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Symbol/length.js b/js/src/tests/test262/built-ins/Symbol/length.js index f50c96667d..d9caf91980 100644 --- a/js/src/tests/test262/built-ins/Symbol/length.js +++ b/js/src/tests/test262/built-ins/Symbol/length.js @@ -12,10 +12,11 @@ includes: [propertyHelper.js] features: [Symbol] ---*/ -assert.sameValue(Symbol.length, 0, "The value of `Symbol.length` is `0`"); - -verifyNotEnumerable(Symbol, "length"); -verifyNotWritable(Symbol, "length"); -verifyConfigurable(Symbol, "length"); +verifyProperty(Symbol, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Symbol/name.js b/js/src/tests/test262/built-ins/Symbol/name.js index c639fc142d..834756a954 100644 --- a/js/src/tests/test262/built-ins/Symbol/name.js +++ b/js/src/tests/test262/built-ins/Symbol/name.js @@ -10,10 +10,11 @@ includes: [propertyHelper.js] features: [Symbol] ---*/ -assert.sameValue(Symbol.name, "Symbol", "The value of `Symbol.name` is `'Symbol'`"); - -verifyNotEnumerable(Symbol, "name"); -verifyNotWritable(Symbol, "name"); -verifyConfigurable(Symbol, "name"); +verifyProperty(Symbol, "name", { + value: "Symbol", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Symbol/prototype/Symbol.toPrimitive/length.js b/js/src/tests/test262/built-ins/Symbol/prototype/Symbol.toPrimitive/length.js index b2cf331005..55b25f33c4 100644 --- a/js/src/tests/test262/built-ins/Symbol/prototype/Symbol.toPrimitive/length.js +++ b/js/src/tests/test262/built-ins/Symbol/prototype/Symbol.toPrimitive/length.js @@ -20,10 +20,11 @@ features: [Symbol.toPrimitive] includes: [propertyHelper.js] ---*/ -assert.sameValue(Symbol.prototype[Symbol.toPrimitive].length, 1); - -verifyNotEnumerable(Symbol.prototype[Symbol.toPrimitive], 'length'); -verifyNotWritable(Symbol.prototype[Symbol.toPrimitive], 'length'); -verifyConfigurable(Symbol.prototype[Symbol.toPrimitive], 'length'); +verifyProperty(Symbol.prototype[Symbol.toPrimitive], "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Symbol/prototype/Symbol.toPrimitive/name.js b/js/src/tests/test262/built-ins/Symbol/prototype/Symbol.toPrimitive/name.js index 58579822e7..c31147ac68 100644 --- a/js/src/tests/test262/built-ins/Symbol/prototype/Symbol.toPrimitive/name.js +++ b/js/src/tests/test262/built-ins/Symbol/prototype/Symbol.toPrimitive/name.js @@ -17,12 +17,11 @@ features: [Symbol.toPrimitive] includes: [propertyHelper.js] ---*/ -assert.sameValue( - Symbol.prototype[Symbol.toPrimitive].name, '[Symbol.toPrimitive]' -); - -verifyNotEnumerable(Symbol.prototype[Symbol.toPrimitive], 'name'); -verifyNotWritable(Symbol.prototype[Symbol.toPrimitive], 'name'); -verifyConfigurable(Symbol.prototype[Symbol.toPrimitive], 'name'); +verifyProperty(Symbol.prototype[Symbol.toPrimitive], "name", { + value: "[Symbol.toPrimitive]", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Symbol/prototype/toString/length.js b/js/src/tests/test262/built-ins/Symbol/prototype/toString/length.js index 84e95cf747..22cc78485f 100644 --- a/js/src/tests/test262/built-ins/Symbol/prototype/toString/length.js +++ b/js/src/tests/test262/built-ins/Symbol/prototype/toString/length.js @@ -23,10 +23,11 @@ includes: [propertyHelper.js] features: [Symbol] ---*/ -assert.sameValue(Symbol.prototype.toString.length, 0); - -verifyNotEnumerable(Symbol.prototype.toString, "length"); -verifyNotWritable(Symbol.prototype.toString, "length"); -verifyConfigurable(Symbol.prototype.toString, "length"); +verifyProperty(Symbol.prototype.toString, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Symbol/prototype/toString/name.js b/js/src/tests/test262/built-ins/Symbol/prototype/toString/name.js index 705eb779f6..d6aa21719e 100644 --- a/js/src/tests/test262/built-ins/Symbol/prototype/toString/name.js +++ b/js/src/tests/test262/built-ins/Symbol/prototype/toString/name.js @@ -20,10 +20,11 @@ includes: [propertyHelper.js] features: [Symbol] ---*/ -assert.sameValue(Symbol.prototype.toString.name, "toString"); - -verifyNotEnumerable(Symbol.prototype.toString, "name"); -verifyNotWritable(Symbol.prototype.toString, "name"); -verifyConfigurable(Symbol.prototype.toString, "name"); +verifyProperty(Symbol.prototype.toString, "name", { + value: "toString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Symbol/prototype/toString/not-a-constructor.js b/js/src/tests/test262/built-ins/Symbol/prototype/toString/not-a-constructor.js index 58914a60d2..c590ca39e0 100644 --- a/js/src/tests/test262/built-ins/Symbol/prototype/toString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Symbol/prototype/toString/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let symbol = Symbol(); new symbol.toString(); -}, '`let symbol = Symbol(); new symbol.toString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Symbol/prototype/valueOf/length.js b/js/src/tests/test262/built-ins/Symbol/prototype/valueOf/length.js index 0134f86d03..3fe32533ba 100644 --- a/js/src/tests/test262/built-ins/Symbol/prototype/valueOf/length.js +++ b/js/src/tests/test262/built-ins/Symbol/prototype/valueOf/length.js @@ -23,10 +23,11 @@ includes: [propertyHelper.js] features: [Symbol] ---*/ -assert.sameValue(Symbol.prototype.valueOf.length, 0); - -verifyNotEnumerable(Symbol.prototype.valueOf, "length"); -verifyNotWritable(Symbol.prototype.valueOf, "length"); -verifyConfigurable(Symbol.prototype.valueOf, "length"); +verifyProperty(Symbol.prototype.valueOf, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Symbol/prototype/valueOf/name.js b/js/src/tests/test262/built-ins/Symbol/prototype/valueOf/name.js index a9104cd8a8..4ff3ef9dfa 100644 --- a/js/src/tests/test262/built-ins/Symbol/prototype/valueOf/name.js +++ b/js/src/tests/test262/built-ins/Symbol/prototype/valueOf/name.js @@ -20,10 +20,11 @@ includes: [propertyHelper.js] features: [Symbol] ---*/ -assert.sameValue(Symbol.prototype.valueOf.name, "valueOf"); - -verifyNotEnumerable(Symbol.prototype.valueOf, "name"); -verifyNotWritable(Symbol.prototype.valueOf, "name"); -verifyConfigurable(Symbol.prototype.valueOf, "name"); +verifyProperty(Symbol.prototype.valueOf, "name", { + value: "valueOf", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Symbol/prototype/valueOf/not-a-constructor.js b/js/src/tests/test262/built-ins/Symbol/prototype/valueOf/not-a-constructor.js index e9edf778b8..7d0dbb5390 100644 --- a/js/src/tests/test262/built-ins/Symbol/prototype/valueOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/Symbol/prototype/valueOf/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let symbol = Symbol(); new symbol.valueOf(); -}, '`let symbol = Symbol(); new symbol.valueOf()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/from/calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Calendar/from/calendar-iso-string.js new file mode 100644 index 0000000000..1b8ebe9921 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/from/calendar-iso-string.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.from +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +for (const arg of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const result = Temporal.Calendar.from(arg); + assert.sameValue(result.id, "iso8601", `Calendar created from string "${arg}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..70e4e25b5f --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.dateadd +description: An ISO 8601 string can be converted to a calendar ID in Calendar +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.dateAdd(arg, new Temporal.Duration()); + TemporalHelpers.assertPlainDate(result, 1976, 11, "M11", 18, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-number.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-number.js index 80b3fcd76f..736c6dd4a9 100644 --- a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-number.js +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-number.js @@ -8,7 +8,7 @@ description: A number as calendar in a property bag is not accepted features: [Temporal] ---*/ -const instance = new Temporal.PlainDate(1976, 11, 18); +const instance = new Temporal.Calendar("iso8601"); const numbers = [ 1, @@ -16,6 +16,7 @@ const numbers = [ -19970327, 1234567890, ]; + for (const calendar of numbers) { const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; assert.throws( diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-year-zero.js index 2a93ec4ea9..2724dbf8cc 100644 --- a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.Calendar("iso8601"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.dateAdd(arg, new Temporal.Duration()), diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateAdd/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateAdd/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..c67b09ebcc --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateAdd/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.dateadd +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Calendar("iso8601"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.dateAdd(arg, new Temporal.Duration()), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateUntil/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateUntil/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..1afad6f499 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateUntil/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,31 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.dateuntil +description: An ISO 8601 string can be converted to a calendar ID in Calendar +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result1 = instance.dateUntil(arg, new Temporal.PlainDate(1976, 11, 19)); + TemporalHelpers.assertDuration(result1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}" (first argument)`); + const result2 = instance.dateUntil(new Temporal.PlainDate(1976, 11, 19), arg); + TemporalHelpers.assertDuration(result2, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}" (second argument)`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateUntil/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateUntil/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..23b19e9bfc --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dateUntil/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,30 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.dateuntil +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Calendar("iso8601"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.dateUntil(arg, new Temporal.PlainDate(1977, 11, 19)), + `annotation keys must be lowercase: ${arg} - ${descr} (first argument)` + ); + assert.throws( + RangeError, + () => instance.dateUntil(new Temporal.PlainDate(1977, 11, 19), arg), + `annotation keys must be lowercase: ${arg} - ${descr} (second argument)` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/day/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/day/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..47be8c3a73 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/day/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.day +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.day(arg); + assert.sameValue(result, 18, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/day/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/day/argument-propertybag-calendar-year-zero.js index 454c6a68de..6338e62891 100644 --- a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/day/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/day/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.Calendar("iso8601"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.day(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/day/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/day/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..d377a25e9d --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/day/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.day +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Calendar("iso8601"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.day(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..c9f21ef479 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.dayofweek +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.dayOfWeek(arg); + assert.sameValue(result, 4, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-propertybag-calendar-year-zero.js index 767b87d15d..0f344803c2 100644 --- a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.Calendar("iso8601"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.dayOfWeek(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..34093a68f3 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.dayofweek +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Calendar("iso8601"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.dayOfWeek(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..5195cd886d --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.dayofyear +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.dayOfYear(arg); + assert.sameValue(result, 323, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-propertybag-calendar-year-zero.js index 7f06c31917..88fa0c5943 100644 --- a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.Calendar("iso8601"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.dayOfYear(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..f2d9dad0fa --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.dayofyear +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Calendar("iso8601"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.dayOfYear(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..43fc09859c --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.daysinmonth +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.daysInMonth(arg); + assert.sameValue(result, 30, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-propertybag-calendar-year-zero.js index 8a6f651473..b6cd325c2e 100644 --- a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.Calendar("iso8601"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.daysInMonth(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..c3db32b57b --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.daysinmonth +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Calendar("iso8601"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.daysInMonth(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..48ca5287e4 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.daysinweek +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.daysInWeek(arg); + assert.sameValue(result, 7, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-propertybag-calendar-year-zero.js index 7d8395c074..6330524f58 100644 --- a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.Calendar("iso8601"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.daysInWeek(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..6dec3595a1 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.daysinweek +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Calendar("iso8601"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.daysInWeek(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInYear/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInYear/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..436cb1d1ea --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInYear/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.daysinyear +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.daysInYear(arg); + assert.sameValue(result, 366, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInYear/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInYear/argument-propertybag-calendar-year-zero.js index 18d81a4c17..ce5d9ad77d 100644 --- a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInYear/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInYear/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.Calendar("iso8601"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.daysInYear(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInYear/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInYear/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..0464d68688 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/daysInYear/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.daysinyear +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Calendar("iso8601"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.daysInYear(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..9cb59aa80a --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.inleapyear +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.inLeapYear(arg); + assert.sameValue(result, true, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-propertybag-calendar-year-zero.js index 0835539959..a82d22bbfe 100644 --- a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.Calendar("iso8601"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.inLeapYear(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..075c05f59a --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.inleapyear +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Calendar("iso8601"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.inLeapYear(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..a9c95173bc --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.month +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.month(arg); + assert.sameValue(result, 11, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/argument-propertybag-calendar-year-zero.js index 81bd484995..86b60ce29c 100644 --- a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.Calendar("iso8601"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.month(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..9a166ae68b --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/month/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.month +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Calendar("iso8601"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.month(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthCode/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthCode/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..b4106f48e5 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthCode/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.monthcode +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.monthCode(arg); + assert.sameValue(result, "M11", `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthCode/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthCode/argument-propertybag-calendar-year-zero.js index 24178dfdb9..c07ef5ec26 100644 --- a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthCode/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthCode/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.Calendar("iso8601"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.monthCode(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthCode/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthCode/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..69e854b1cd --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthCode/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.monthcode +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Calendar("iso8601"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.monthCode(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..bf5ce2c86a --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.monthsinyear +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.monthsInYear(arg); + assert.sameValue(result, 12, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-propertybag-calendar-year-zero.js index c05540c245..517784b934 100644 --- a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.Calendar("iso8601"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.monthsInYear(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..75cd954103 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.monthsinyear +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Calendar("iso8601"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.monthsInYear(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..97fa05fdca --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.weekofyear +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.weekOfYear(arg); + assert.sameValue(result, 47, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-propertybag-calendar-year-zero.js index 023b2ca730..3465289d38 100644 --- a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.Calendar("iso8601"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.weekOfYear(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..f32b39605e --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.weekofyear +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Calendar("iso8601"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.weekOfYear(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/weekOfYear/custom-calendar-weekofyear.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/weekOfYear/custom-calendar-weekofyear.js new file mode 100644 index 0000000000..c7f69b11d8 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/weekOfYear/custom-calendar-weekofyear.js @@ -0,0 +1,26 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.weekofyear +description: > + Temporal.Calendar.prototype.weekOfYear returns undefined for all + custom calendars where weekOfYear() returns undefined. +features: [Temporal] +---*/ + +class CustomCalendar extends Temporal.Calendar { + constructor() { + super("iso8601"); + } + weekOfYear() { + return undefined; + } +} + +const calendar = new CustomCalendar(); +const customCalendarDate = { month: 1, day: 1, year: 2024, calendar}; +assert.sameValue(calendar.weekOfYear({...customCalendarDate}), undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/year/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/year/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..d56ec21d0b --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/year/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.year +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.year(arg); + assert.sameValue(result, 1976, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/year/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/year/argument-propertybag-calendar-year-zero.js index 742326e600..81e2cc5f75 100644 --- a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/year/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/year/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.Calendar("iso8601"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.year(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/year/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/year/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..ab698cfd86 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/year/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.year +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Calendar("iso8601"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.year(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..cf2ffb511d --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.yearofweek +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.yearOfWeek(arg); + assert.sameValue(result, 1976, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-propertybag-calendar-year-zero.js index ad33245788..d3a054c682 100644 --- a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.Calendar("iso8601"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.yearOfWeek(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..2293852bdc --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/yearOfWeek/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.yearofweek +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Calendar("iso8601"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.yearOfWeek(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/yearOfWeek/custom-calendar-weekofyear.js b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/yearOfWeek/custom-calendar-weekofyear.js new file mode 100644 index 0000000000..6d618ae608 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Calendar/prototype/yearOfWeek/custom-calendar-weekofyear.js @@ -0,0 +1,26 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.yearofweek +description: > + Temporal.Calendar.prototype.yearOfWeek returns undefined for all + custom calendars where yearOfWeek() returns undefined. +features: [Temporal] +---*/ + +class CustomCalendar extends Temporal.Calendar { + constructor() { + super("iso8601"); + } + yearOfWeek() { + return undefined; + } +} + +const calendar = new CustomCalendar(); +const customCalendarDate = { month: 1, day: 1, year: 2024, calendar}; +assert.sameValue(calendar.yearOfWeek({...customCalendarDate}), undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/compare/duration-out-of-range-added-to-relativeto.js b/js/src/tests/test262/built-ins/Temporal/Duration/compare/duration-out-of-range-added-to-relativeto.js new file mode 100644 index 0000000000..cb8c1157d7 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Duration/compare/duration-out-of-range-added-to-relativeto.js @@ -0,0 +1,30 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.compare +description: RangeError thrown when calendar part of duration added to relativeTo is out of range +features: [Temporal] +info: | + UnbalanceDateDurationRelative: + 11. Let _yearsMonthsWeeksDuration_ be ! CreateTemporalDuration(_years_, _months_, _weeks_, 0, 0, 0, 0, 0, 0, 0). + 12. Let _later_ be ? CalendarDateAdd(_calendaRec_, _plainRelativeTo_, _yearsMonthsWeeksDuration_). + 13. Let _yearsMonthsWeeksInDays_ be DaysUntil(_plainRelativeTo_, _later_). + 14. Return ? CreateDateDurationRecord(0, 0, 0, _days_ + _yearsMonthsWeeksInDays_). +---*/ + +// Based on a test case by André Bargull + +const relativeTo = new Temporal.PlainDate(2000, 1, 1); +const zero = new Temporal.Duration(); + +const instance = new Temporal.Duration(0, 0, /* weeks = */ 1, /* days = */ Math.trunc((2 ** 53) / 86_400)); +assert.throws(RangeError, () => Temporal.Duration.compare(instance, zero, {relativeTo}), "weeks + days out of range, positive, first argument"); +assert.throws(RangeError, () => Temporal.Duration.compare(zero, instance, {relativeTo}), "weeks + days out of range, positive, second argument"); + +const negInstance = new Temporal.Duration(0, 0, /* weeks = */ -1, /* days = */ -Math.trunc((2 ** 53) / 86_400)); +assert.throws(RangeError, () => Temporal.Duration.compare(negInstance, zero, {relativeTo}), "weeks + days out of range, negative, first argument"); +assert.throws(RangeError, () => Temporal.Duration.compare(zero, negInstance, {relativeTo}), "weeks + days out of range, negative, second argument"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/compare/relativeto-propertybag-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/Duration/compare/relativeto-propertybag-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..98fb6b5ef9 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Duration/compare/relativeto-propertybag-out-of-range-backward-offset-shift.js @@ -0,0 +1,51 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.compare +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const relativeTo = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; +const duration1 = new Temporal.Duration(1); +const duration2 = new Temporal.Duration(2); + +assert.throws(RangeError, () => Temporal.Duration.compare(duration1, duration2, {relativeTo: relativeTo}), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/compare/relativeto-propertybag-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/Duration/compare/relativeto-propertybag-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..cbfca704c2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Duration/compare/relativeto-propertybag-out-of-range-forward-offset-shift.js @@ -0,0 +1,46 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.compare +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const relativeTo = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; +const duration1 = new Temporal.Duration(1); +const duration2 = new Temporal.Duration(2); + +assert.throws(RangeError, () => Temporal.Duration.compare(duration1, duration2, {relativeTo: relativeTo}), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/from/argument-duration-max.js b/js/src/tests/test262/built-ins/Temporal/Duration/from/argument-duration-max.js index 0a4043d391..af9f721949 100644 --- a/js/src/tests/test262/built-ins/Temporal/Duration/from/argument-duration-max.js +++ b/js/src/tests/test262/built-ins/Temporal/Duration/from/argument-duration-max.js @@ -11,7 +11,7 @@ features: [Temporal] const maxCases = [ ["P4294967295Y104249991374DT7H36M31.999999999S", "string with max years"], [{ years: 4294967295, days: 104249991374, nanoseconds: 27391999999999 }, "property bag with max years"], - ["P4294967295M104249991374DT7H36M31.999999999S", "string with max weeks"], + ["P4294967295M104249991374DT7H36M31.999999999S", "string with max months"], [{ months: 4294967295, days: 104249991374, nanoseconds: 27391999999999 }, "property bag with max months"], ["P4294967295W104249991374DT7H36M31.999999999S", "string with max weeks"], [{ weeks: 4294967295, days: 104249991374, nanoseconds: 27391999999999 }, "property bag with max weeks"], diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/calendar-dateadd-called-with-options-undefined.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/calendar-dateadd-called-with-options-undefined.js index 4955abacdd..84079298ce 100644 --- a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/calendar-dateadd-called-with-options-undefined.js +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/calendar-dateadd-called-with-options-undefined.js @@ -15,6 +15,6 @@ const calendar = TemporalHelpers.calendarDateAddUndefinedOptions(); const timeZone = TemporalHelpers.oneShiftTimeZone(new Temporal.Instant(0n), 3600e9); const instance = new Temporal.Duration(1, 1, 1, 1); instance.add(instance, { relativeTo: new Temporal.ZonedDateTime(0n, timeZone, calendar) }); -assert.sameValue(calendar.dateAddCallCount, 3); +assert.sameValue(calendar.dateAddCallCount, 2); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/differencezoneddatetime-inconsistent-custom-calendar.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/differencezoneddatetime-inconsistent-custom-calendar.js new file mode 100644 index 0000000000..01bf6c756e --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/differencezoneddatetime-inconsistent-custom-calendar.js @@ -0,0 +1,55 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-temporal.duration.prototype.add +description: > + Throws a RangeError when custom calendar method returns inconsistent result +info: | + DifferenceZonedDateTime ( ... ) + 8. Repeat 3 times: + ... + g. If _sign_ = 0, or _timeSign_ = 0, or _sign_ = _timeSign_, then + ... + viii. Return ? CreateNormalizedDurationRecord(_dateDifference_.[[Years]], + _dateDifference_.[[Months]], _dateDifference_.[[Weeks]], + _dateDifference_.[[Days]], _norm_). + h. Set _dayCorrection_ to _dayCorrection_ + 1. + 9. NOTE: This step is only reached when custom calendar or time zone methods + return inconsistent values. + 10. Throw a *RangeError* exception. +features: [Temporal] +---*/ + +// Based partly on a test case by André Bargull + +const duration1 = new Temporal.Duration(0, 0, /* weeks = */ 7, 0, /* hours = */ 12); +const duration2 = new Temporal.Duration(0, 0, 0, /* days = */ 1); + +{ + const tz = new (class extends Temporal.TimeZone { + getPossibleInstantsFor(dateTime) { + return super.getPossibleInstantsFor(dateTime.add({ days: 3 })); + } + })("UTC"); + + const relativeTo = new Temporal.ZonedDateTime(0n, tz); + + assert.throws(RangeError, () => duration1.add(duration2, { relativeTo }), + "Calendar calculation where more than 2 days correction is needed should cause RangeError"); +} + +{ + const cal = new (class extends Temporal.Calendar { + dateUntil(one, two, options) { + return super.dateUntil(one, two, options).negated(); + } + })("iso8601"); + + const relativeTo = new Temporal.ZonedDateTime(0n, "UTC", cal); + + assert.throws(RangeError, () => duration1.add(duration2, { relativeTo }), + "Calendar calculation causing mixed-sign values should cause RangeError"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/normalized-time-duration-to-days-loop-arbitrarily.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/normalized-time-duration-to-days-loop-arbitrarily.js deleted file mode 100644 index 62833e87c6..0000000000 --- a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/normalized-time-duration-to-days-loop-arbitrarily.js +++ /dev/null @@ -1,78 +0,0 @@ -// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally -// Copyright (C) 2022 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.duration.prototype.add -description: > - NormalizedTimeDurationToDays can loop arbitrarily up to max safe integer -info: | - NormalizedTimeDurationToDays ( norm, zonedRelativeTo, timeZoneRec [ , precalculatedPlainDatetime ] ) - ... - 21. Repeat, while done is false, - a. Let oneDayFarther be ? AddDaysToZonedDateTime(relativeResult.[[Instant]], - relativeResult.[[DateTime]], timeZoneRec, zonedRelativeTo.[[Calendar]], sign). - b. Set dayLengthNs to NormalizedTimeDurationFromEpochNanosecondsDifference(oneDayFarther.[[EpochNanoseconds]], - relativeResult.[[EpochNanoseconds]]). - c. Let oneDayLess be ? SubtractNormalizedTimeDuration(norm, dayLengthNs). - c. If NormalizedTimeDurationSign(oneDayLess) × sign ≥ 0, then - i. Set norm to oneDayLess. - ii. Set relativeResult to oneDayFarther. - iii. Set days to days + sign. - d. Else, - i. Set done to true. -includes: [temporalHelpers.js] -features: [Temporal] ----*/ - -const calls = []; -const duration = Temporal.Duration.from({ days: 1 }); - -function createRelativeTo(count) { - const dayLengthNs = 86400000000000n; - const dayInstant = new Temporal.Instant(dayLengthNs); - const substitutions = []; - const timeZone = new Temporal.TimeZone("UTC"); - // Return constant value for first _count_ calls - TemporalHelpers.substituteMethod( - timeZone, - "getPossibleInstantsFor", - substitutions - ); - substitutions.length = count; - let i = 0; - for (i = 0; i < substitutions.length; i++) { - // (this value) - substitutions[i] = [dayInstant]; - } - // Record calls in calls[] - TemporalHelpers.observeMethod(calls, timeZone, "getPossibleInstantsFor"); - return new Temporal.ZonedDateTime(0n, timeZone); -} - -let zdt = createRelativeTo(50); -calls.splice(0); // Reset calls list after ZonedDateTime construction -duration.add(duration, { - relativeTo: zdt, -}); -assert.sameValue( - calls.length, - 50 + 1, - "Expected duration.add to call getPossibleInstantsFor correct number of times" -); - -zdt = createRelativeTo(100); -calls.splice(0); // Reset calls list after previous loop + ZonedDateTime construction -duration.add(duration, { - relativeTo: zdt, -}); -assert.sameValue( - calls.length, - 100 + 1, - "Expected duration.add to call getPossibleInstantsFor correct number of times" -); - -zdt = createRelativeTo(107); -assert.throws(RangeError, () => duration.add(duration, { relativeTo: zdt }), "107-2 days > 2⁵³ ns"); - -reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/order-of-operations.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/order-of-operations.js index a530ba55e9..c3a2f2c4a9 100644 --- a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/order-of-operations.js +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/order-of-operations.js @@ -339,18 +339,8 @@ const expectedOpsForZonedRelativeTo = expected.concat([ "call options.relativeTo.timeZone.getPossibleInstantsFor", // AddDuration → DifferenceZonedDateTime "call options.relativeTo.timeZone.getOffsetNanosecondsFor", - // AddDuration → DifferenceZonedDateTime → DifferenceISODateTime - "call options.relativeTo.calendar.dateUntil", - // AddDuration → DifferenceZonedDateTime → AddZonedDateTime - "call options.relativeTo.calendar.dateAdd", - "call options.relativeTo.timeZone.getPossibleInstantsFor", - // AddDuration → DifferenceZonedDateTime → NanosecondsToDays - "call options.relativeTo.timeZone.getOffsetNanosecondsFor", - "call options.relativeTo.timeZone.getOffsetNanosecondsFor", - // AddDuration → DifferenceZonedDateTime → NanosecondsToDays → AddZonedDateTime 1 - "call options.relativeTo.timeZone.getPossibleInstantsFor", - // AddDuration → DifferenceZonedDateTime → NanosecondsToDays → AddZonedDateTime 2 "call options.relativeTo.timeZone.getPossibleInstantsFor", + "call options.relativeTo.calendar.dateUntil", ]); const zonedRelativeTo = TemporalHelpers.propertyBagObserver(actual, { diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..a8506addba --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-out-of-range-backward-offset-shift.js @@ -0,0 +1,50 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.add +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const relativeTo = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; + +const instance = new Temporal.Duration(1, 0, 0, 1); +assert.throws(RangeError, () => instance.add(new Temporal.Duration(0, 0, 0, 0, -24), { relativeTo }), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..705327b70e --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-out-of-range-forward-offset-shift.js @@ -0,0 +1,45 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.add +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const relativeTo = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; + +const instance = new Temporal.Duration(1, 0, 0, 1); +assert.throws(RangeError, () => instance.add(new Temporal.Duration(0, 0, 0, 0, -24), { relativeTo }), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/relativeto-zoneddatetime-normalized-time-duration-to-days-range-errors.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/relativeto-zoneddatetime-normalized-time-duration-to-days-range-errors.js deleted file mode 100644 index 7acd5929b6..0000000000 --- a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/add/relativeto-zoneddatetime-normalized-time-duration-to-days-range-errors.js +++ /dev/null @@ -1,146 +0,0 @@ -// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally -// Copyright (C) 2022 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-temporal.duration.prototype.add -description: > - Abstract operation NormalizedTimeDurationToDays can throw four different - RangeErrors. -info: | - NormalizedTimeDurationToDays ( norm, zonedRelativeTo, timeZoneRec [ , precalculatedPlainDateTime ] ) - 22. If days < 0 and sign = 1, throw a RangeError exception. - 23. If days > 0 and sign = -1, throw a RangeError exception. - ... - 25. If NormalizedTimeDurationSign(_norm_) = 1 and sign = -1, throw a RangeError exception. - ... - 28. If dayLength ≥ 2⁵³, throw a RangeError exception. -features: [Temporal, BigInt] -includes: [temporalHelpers.js] ----*/ - -const dayNs = 86_400_000_000_000; -const dayDuration = Temporal.Duration.from({ days: 1 }); -const epochInstant = new Temporal.Instant(0n); - -function timeZoneSubstituteValues( - getPossibleInstantsFor, - getOffsetNanosecondsFor -) { - const tz = new Temporal.TimeZone("UTC"); - TemporalHelpers.substituteMethod( - tz, - "getPossibleInstantsFor", - getPossibleInstantsFor - ); - TemporalHelpers.substituteMethod( - tz, - "getOffsetNanosecondsFor", - getOffsetNanosecondsFor - ); - return tz; -} - -// Step 22: days < 0 and sign = 1 -let zdt = new Temporal.ZonedDateTime( - -1n, // Set DifferenceZonedDateTime _ns1_ - timeZoneSubstituteValues( - [ - TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally for first call, AddDuration step 15 - [epochInstant], // Returned in AddDuration step 16, setting _endNs_ -> DifferenceZonedDateTime _ns2_ - [epochInstant], // Returned in step 16, setting _relativeResult_ - ], - [ - // Behave normally in 3 calls made prior to NormalizedTimeDurationToDays - TemporalHelpers.SUBSTITUTE_SKIP, - TemporalHelpers.SUBSTITUTE_SKIP, - TemporalHelpers.SUBSTITUTE_SKIP, - dayNs - 1, // Returned in step 8, setting _startDateTime_ - -dayNs + 1, // Returned in step 9, setting _endDateTime_ - ] - ) -); -assert.throws(RangeError, () => - // Adding day to day sets largestUnit to 'day', avoids having any week/month/year components in differences - dayDuration.add(dayDuration, { - relativeTo: zdt, - }), - "days < 0 and sign = 1" -); - -// Step 23: days > 0 and sign = -1 -zdt = new Temporal.ZonedDateTime( - 1n, // Set DifferenceZonedDateTime _ns1_ - timeZoneSubstituteValues( - [ - TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally for first call, AddDuration step 15 - [epochInstant], // Returned in AddDuration step 16, setting _endNs_ -> DifferenceZonedDateTime _ns2_ - [epochInstant], // Returned in step 16, setting _relativeResult_ - ], - [ - // Behave normally in 3 calls made prior to NanosecondsToDays - TemporalHelpers.SUBSTITUTE_SKIP, - TemporalHelpers.SUBSTITUTE_SKIP, - TemporalHelpers.SUBSTITUTE_SKIP, - -dayNs + 1, // Returned in step 8, setting _startDateTime_ - dayNs - 1, // Returned in step 9, setting _endDateTime_ - ] - ) -); -assert.throws(RangeError, () => - // Adding day to day sets largestUnit to 'day', avoids having any week/month/year components in differences - dayDuration.add(dayDuration, { - relativeTo: zdt, - }), - "days > 0 and sign = -1" -); - -// Step 25: nanoseconds > 0 and sign = -1 -zdt = new Temporal.ZonedDateTime( - 0n, // Set DifferenceZonedDateTime _ns1_ - timeZoneSubstituteValues( - [ - TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally for first call, AddDuration step 15 - [new Temporal.Instant(-1n)], // Returned in AddDuration step 16, setting _endNs_ -> DifferenceZonedDateTime _ns2_ - [new Temporal.Instant(-2n)], // Returned in step 16, setting _relativeResult_ - [new Temporal.Instant(-4n)], // Returned in step 21.a, setting _oneDayFarther_ - ], - [ - // Behave normally in 3 calls made prior to NanosecondsToDays - TemporalHelpers.SUBSTITUTE_SKIP, - TemporalHelpers.SUBSTITUTE_SKIP, - TemporalHelpers.SUBSTITUTE_SKIP, - dayNs - 1, // Returned in step 8, setting _startDateTime_ - -dayNs + 1, // Returned in step 9, setting _endDateTime_ - ] - ) -); -assert.throws(RangeError, () => - // Adding day to day sets largestUnit to 'day', avoids having any week/month/year components in differences - dayDuration.add(dayDuration, { - relativeTo: zdt, - }), - "nanoseconds > 0 and sign = -1" -); - -// Step 28: day length is an unsafe integer -zdt = new Temporal.ZonedDateTime( - 0n, - timeZoneSubstituteValues( - [ - TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally for AddDuration step 15 - TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally for AddDuration step 16 - TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally for step 16, setting _relativeResult_ - // Returned in step 21.a, making _oneDayFarther_ 2^53 ns later than _relativeResult_ - [new Temporal.Instant(2n ** 53n + 2n * BigInt(dayNs))], - ], - [] - ) -); -assert.throws(RangeError, () => - dayDuration.add(dayDuration, { - relativeTo: zdt, - }), - "Should throw RangeError when time zone calculates an outrageous day length" -); - -reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/dst-rounding-result.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/dst-rounding-result.js new file mode 100644 index 0000000000..daff4e93f6 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/dst-rounding-result.js @@ -0,0 +1,48 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-temporal.duration.prototype.round +description: > + Rounding the resulting duration takes the time zone's UTC offset shifts + into account +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const timeZone = TemporalHelpers.springForwardFallBackTimeZone(); + +// Based on a test case by Adam Shaw + +{ + // Date part of duration lands on skipped DST hour, causing disambiguation + const duration = new Temporal.Duration(0, 1, 0, 15, 12); + const relativeTo = new Temporal.ZonedDateTime( + 950868000_000_000_000n /* = 2000-02-18T10Z */, + timeZone); /* = 2000-02-18T02-08 in local time */ + + TemporalHelpers.assertDuration(duration.round({ smallestUnit: "months", relativeTo }), + 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, + "1 month 15 days 12 hours should be exactly 1.5 months, which rounds up to 2 months"); + TemporalHelpers.assertDuration(duration.round({ smallestUnit: "months", roundingMode: 'halfTrunc', relativeTo }), + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + "1 month 15 days 12 hours should be exactly 1.5 months, which rounds down to 1 month"); +} + +{ + // Month-only part of duration lands on skipped DST hour, should not cause + // disambiguation + const duration = new Temporal.Duration(0, 1, 0, 15); + const relativeTo = new Temporal.ZonedDateTime( + 951991200_000_000_000n /* = 2000-03-02T10Z */, + timeZone); /* = 2000-03-02T02-08 in local time */ + + TemporalHelpers.assertDuration(duration.round({ smallestUnit: "months", relativeTo }), + 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, + "1 month 15 days should be exactly 1.5 months, which rounds up to 2 months"); + TemporalHelpers.assertDuration(duration.round({ smallestUnit: "months", roundingMode: 'halfTrunc', relativeTo }), + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + "1 month 15 days should be exactly 1.5 months, which rounds down to 1 month"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/duration-out-of-range-added-to-relativeto.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/duration-out-of-range-added-to-relativeto.js index b564b27eb4..f63eb3b789 100644 --- a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/duration-out-of-range-added-to-relativeto.js +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/duration-out-of-range-added-to-relativeto.js @@ -8,21 +8,44 @@ description: RangeError thrown when calendar part of duration added to relativeT features: [Temporal] info: | RoundDuration: - 8.k. Let _isoResult_ be ! AddISODate(_plainRelativeTo_.[[ISOYear]]. _plainRelativeTo_.[[ISOMonth]], _plainRelativeTo_.[[ISODay]], 0, 0, 0, truncate(_fractionalDays_), *"constrain"*). - l. Let _wholeDaysLater_ be ? CreateTemporalDate(_isoResult_.[[Year]], _isoResult_.[[Month]], _isoResult_.[[Day]], _calendar_). + 10.h. Let _isoResult_ be ! AddISODate(_plainRelativeTo_.[[ISOYear]]. _plainRelativeTo_.[[ISOMonth]], _plainRelativeTo_.[[ISODay]], 0, 0, 0, truncate(_fractionalDays_), *"constrain"*). + i. Let _wholeDaysLater_ be ? CreateTemporalDate(_isoResult_.[[Year]], _isoResult_.[[Month]], _isoResult_.[[Day]], _calendar_). + ... + 11.h. Let _isoResult_ be ! AddISODate(_plainRelativeTo_.[[ISOYear]]. _plainRelativeTo_.[[ISOMonth]], _plainRelativeTo_.[[ISODay]], 0, 0, 0, truncate(_fractionalDays_), *"constrain"*). + i. Let _wholeDaysLater_ be ? CreateTemporalDate(_isoResult_.[[Year]], _isoResult_.[[Month]], _isoResult_.[[Day]], _calendar_). + ... + 12.a. Let _isoResult_ be ! AddISODate(_plainRelativeTo_.[[ISOYear]]. _plainRelativeTo_.[[ISOMonth]], _plainRelativeTo_.[[ISODay]], 0, 0, 0, truncate(_fractionalDays_), *"constrain"*). + b. Let _wholeDaysLater_ be ? CreateTemporalDate(_isoResult_.[[Year]], _isoResult_.[[Month]], _isoResult_.[[Day]], _calendar_). + + UnbalanceDateDurationRelative: + 11. Let _yearsMonthsWeeksDuration_ be ! CreateTemporalDuration(_years_, _months_, _weeks_, 0, 0, 0, 0, 0, 0, 0). + 12. Let _later_ be ? CalendarDateAdd(_calendaRec_, _plainRelativeTo_, _yearsMonthsWeeksDuration_). + 13. Let _yearsMonthsWeeksInDays_ be DaysUntil(_plainRelativeTo_, _later_). + 14. Return ? CreateDateDurationRecord(0, 0, 0, _days_ + _yearsMonthsWeeksInDays_). ---*/ // Based on a test case by André Bargull -const instance = new Temporal.Duration(0, 0, 0, /* days = */ 500_000_000); const relativeTo = new Temporal.PlainDate(2000, 1, 1); -assert.throws(RangeError, () => instance.round({relativeTo, smallestUnit: "years"})); -assert.throws(RangeError, () => instance.round({relativeTo, smallestUnit: "months"})); -assert.throws(RangeError, () => instance.round({relativeTo, smallestUnit: "weeks"})); - -const negInstance = new Temporal.Duration(0, 0, 0, /* days = */ -500_000_000); -assert.throws(RangeError, () => negInstance.round({relativeTo, smallestUnit: "years"})); -assert.throws(RangeError, () => negInstance.round({relativeTo, smallestUnit: "months"})); -assert.throws(RangeError, () => negInstance.round({relativeTo, smallestUnit: "weeks"})); + +{ + const instance = new Temporal.Duration(0, 0, 0, /* days = */ 500_000_000); + assert.throws(RangeError, () => instance.round({relativeTo, smallestUnit: "years"}), "days out of range, positive, smallestUnit years"); + assert.throws(RangeError, () => instance.round({relativeTo, smallestUnit: "months"}), "days out of range, positive, smallestUnit months"); + assert.throws(RangeError, () => instance.round({relativeTo, smallestUnit: "weeks"}), "days out of range, positive, smallestUnit weeks"); + + const negInstance = new Temporal.Duration(0, 0, 0, /* days = */ -500_000_000); + assert.throws(RangeError, () => negInstance.round({relativeTo, smallestUnit: "years"}), "days out of range, negative, smallestUnit years"); + assert.throws(RangeError, () => negInstance.round({relativeTo, smallestUnit: "months"}), "days out of range, negative, smallestUnit months"); + assert.throws(RangeError, () => negInstance.round({relativeTo, smallestUnit: "weeks"}), "days out of range, negative, smallestUnit weeks"); +} + +{ + const instance = new Temporal.Duration(0, 0, /* weeks = */ 1, /* days = */ Math.trunc((2 ** 53) / 86_400)); + assert.throws(RangeError, () => instance.round({relativeTo, largestUnit: "days"}), "weeks + days out of range, positive"); + + const negInstance = new Temporal.Duration(0, 0, /* weeks = */ -1, /* days = */ -Math.trunc((2 ** 53) / 86_400)); + assert.throws(RangeError, () => instance.round({relativeTo, largestUnit: "days"}), "weeks + days out of range, negative"); +} reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/normalized-time-duration-to-days-loop-arbitrarily.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/normalized-time-duration-to-days-loop-arbitrarily.js index 923d788246..ed63026c0a 100644 --- a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/normalized-time-duration-to-days-loop-arbitrarily.js +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/normalized-time-duration-to-days-loop-arbitrarily.js @@ -4,76 +4,44 @@ /*--- esid: sec-temporal.duration.prototype.round description: > - NormalizedTimeDurationToDays can loop arbitrarily up to max safe integer + NormalizedTimeDurationToDays should not be able to loop arbitrarily. info: | NormalizedTimeDurationToDays ( norm, zonedRelativeTo, timeZoneRec [ , precalculatedPlainDatetime ] ) ... - 21. Repeat, while done is false, - a. Let oneDayFarther be ? AddDaysToZonedDateTime(relativeResult.[[Instant]], - relativeResult.[[DateTime]], timeZoneRec, zonedRelativeTo.[[Calendar]], sign). - b. Set dayLengthNs to NormalizedTimeDurationFromEpochNanosecondsDifference(oneDayFarther.[[EpochNanoseconds]], - relativeResult.[[EpochNanoseconds]]). - c. Let oneDayLess be ? SubtractNormalizedTimeDuration(norm, dayLengthNs). - c. If NormalizedTimeDurationSign(oneDayLess) × sign ≥ 0, then - i. Set norm to oneDayLess. - ii. Set relativeResult to oneDayFarther. - iii. Set days to days + sign. - d. Else, - i. Set done to true. -includes: [temporalHelpers.js] + 22. If NormalizedTimeDurationSign(_oneDayLess_) × _sign_ ≥ 0, then + a. Set _norm_ to _oneDayLess_. + b. Set _relativeResult_ to _oneDayFarther_. + c. Set _days_ to _days_ + _sign_. + d. Set _oneDayFarther_ to ? AddDaysToZonedDateTime(_relativeResult_.[[Instant]], _relativeResult_.[[DateTime]], _timeZoneRec_, _zonedRelativeTo_.[[Calendar]], _sign_). + e. Set dayLengthNs to NormalizedTimeDurationFromEpochNanosecondsDifference(_oneDayFarther.[[EpochNanoseconds]], relativeResult.[[EpochNanoseconds]]). + f. If NormalizedTimeDurationSign(? SubtractNormalizedTimeDuration(_norm_, _dayLengthNs_)) × _sign_ ≥ 0, then + i. Throw a *RangeError* exception. features: [Temporal] ---*/ -const calls = []; const duration = Temporal.Duration.from({ days: 1 }); -function createRelativeTo(count) { - const dayLengthNs = 86400000000000n; - const dayInstant = new Temporal.Instant(dayLengthNs); - const substitutions = []; - const timeZone = new Temporal.TimeZone("UTC"); - // Return constant value for first _count_ calls - TemporalHelpers.substituteMethod( - timeZone, - "getPossibleInstantsFor", - substitutions - ); - substitutions.length = count; - let i = 0; - for (i = 0; i < substitutions.length; i++) { - // (this value) - substitutions[i] = [dayInstant]; +const dayLengthNs = 86400000000000n; +const dayInstant = new Temporal.Instant(dayLengthNs); +let calls = 0; +const timeZone = new class extends Temporal.TimeZone { + getPossibleInstantsFor() { + calls++; + return [dayInstant]; } - // Record calls in calls[] - TemporalHelpers.observeMethod(calls, timeZone, "getPossibleInstantsFor"); - return new Temporal.ZonedDateTime(0n, timeZone); -} +}("UTC"); -let zdt = createRelativeTo(50); -calls.splice(0); // Reset calls list after ZonedDateTime construction -duration.round({ - smallestUnit: "days", - relativeTo: zdt, -}); -assert.sameValue( - calls.length, - 50 + 1, - "Expected duration.round to call getPossibleInstantsFor correct number of times" -); +const relativeTo = new Temporal.ZonedDateTime(0n, timeZone); -zdt = createRelativeTo(100); -calls.splice(0); // Reset calls list after previous loop + ZonedDateTime construction -duration.round({ - smallestUnit: "days", - relativeTo: zdt, -}); -assert.sameValue( - calls.length, - 100 + 1, - "Expected duration.round to call getPossibleInstantsFor correct number of times" -); - -zdt = createRelativeTo(107); -assert.throws(RangeError, () => duration.round({ smallestUnit: "days", relativeTo: zdt }), "107-2 days > 2⁵³ ns"); +assert.throws(RangeError, () => duration.round({ smallestUnit: "days", relativeTo }), "indefinite loop is prevented"); +assert.sameValue(calls, 5, "getPossibleInstantsFor is not called indefinitely"); + // Expected calls: + // RoundDuration -> MoveRelativeZonedDateTime -> AddZonedDateTime (1) + // BalanceTimeDurationRelative -> + // AddZonedDateTime (2) + // NormalizedTimeDurationToDays -> + // AddDaysToZonedDateTime (3, step 12) + // AddDaysToZonedDateTime (4, step 15) + // AddDaysToZonedDateTime (5, step 18.d) reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/out-of-range-when-adjusting-rounded-days.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/out-of-range-when-adjusting-rounded-days.js new file mode 100644 index 0000000000..cd6c307e5b --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/out-of-range-when-adjusting-rounded-days.js @@ -0,0 +1,32 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.round +description: > + When adjusting the rounded days after rounding relative to a ZonedDateTime, + the duration may go out of range +features: [Temporal] +includes: [temporalHelpers.js] +---*/ + +// Based on a test case by André Bargull + +const d = new Temporal.Duration(0, 0, 0, /* days = */ 1, 0, 0, /* s = */ Number.MAX_SAFE_INTEGER - 86400, 0, 0, /* ns = */ 999_999_999); + +const timeZone = new Temporal.TimeZone("UTC"); +TemporalHelpers.substituteMethod(timeZone, 'getPossibleInstantsFor', [ + TemporalHelpers.SUBSTITUTE_SKIP, + [new Temporal.Instant(1n)], +]); + +const relativeTo = new Temporal.ZonedDateTime(0n, timeZone); + +assert.throws(RangeError, () => d.round({ + largestUnit: 'nanoseconds', + roundingIncrement: 2, + relativeTo +})); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/out-of-range-when-converting-from-normalized-duration.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/out-of-range-when-converting-from-normalized-duration.js index 4fde761351..d4f973d639 100644 --- a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/out-of-range-when-converting-from-normalized-duration.js +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/out-of-range-when-converting-from-normalized-duration.js @@ -14,6 +14,6 @@ const d = new Temporal.Duration(0, 0, 0, 0, 0, 0, /* s = */ Number.MAX_SAFE_INTE assert.throws(RangeError, () => d.round({ largestUnit: "nanoseconds", roundingIncrement: 1, -}), "nanoseconds component is an unsafe integer after balancing"); +}), "nanoseconds component after balancing as a float64-representable integer is out of range"); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..e147558077 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-out-of-range-backward-offset-shift.js @@ -0,0 +1,50 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.round +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const relativeTo = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; + +const instance = new Temporal.Duration(1, 0, 0, 0, 24); +assert.throws(RangeError, () => instance.round({ largestUnit: "years", relativeTo }), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..f3b8d604ee --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-out-of-range-forward-offset-shift.js @@ -0,0 +1,45 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.round +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const relativeTo = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; + +const instance = new Temporal.Duration(1, 0, 0, 0, 24); +assert.throws(RangeError, () => instance.round({ largestUnit: "years", relativeTo }), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/relativeto-zoneddatetime-normalized-time-duration-to-days-range-errors.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/relativeto-zoneddatetime-normalized-time-duration-to-days-range-errors.js index 150f9f419e..9c04b2991e 100644 --- a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/relativeto-zoneddatetime-normalized-time-duration-to-days-range-errors.js +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/round/relativeto-zoneddatetime-normalized-time-duration-to-days-range-errors.js @@ -8,12 +8,12 @@ description: > RangeErrors. info: | NormalizedTimeDurationToDays ( norm, zonedRelativeTo, timeZoneRec [ , precalculatedPlainDateTime ] ) - 22. If days < 0 and sign = 1, throw a RangeError exception. - 23. If days > 0 and sign = -1, throw a RangeError exception. + 23. If days < 0 and sign = 1, throw a RangeError exception. + 24. If days > 0 and sign = -1, throw a RangeError exception. ... - 25. If NormalizedTimeDurationSign(_norm_) = 1 and sign = -1, throw a RangeError exception. + 26. If NormalizedTimeDurationSign(_norm_) = 1 and sign = -1, throw a RangeError exception. ... - 28. If dayLength ≥ 2⁵³, throw a RangeError exception. + 29. If dayLength ≥ 2⁵³, throw a RangeError exception. features: [Temporal, BigInt] includes: [temporalHelpers.js] ---*/ @@ -41,7 +41,7 @@ function timeZoneSubstituteValues( return tz; } -// Step 22: days < 0 and sign = 1 +// Step 23: days < 0 and sign = 1 let zdt = new Temporal.ZonedDateTime( 0n, // Sets _startNs_ to 0 timeZoneSubstituteValues( @@ -62,7 +62,7 @@ assert.throws(RangeError, () => "RangeError when days < 0 and sign = 1" ); -// Step 23: days > 0 and sign = -1 +// Step 24: days > 0 and sign = -1 zdt = new Temporal.ZonedDateTime( 0n, // Sets _startNs_ to 0 timeZoneSubstituteValues( @@ -83,13 +83,13 @@ assert.throws(RangeError, () => "RangeError when days > 0 and sign = -1" ); -// Step 25: nanoseconds > 0 and sign = -1 +// Step 26: nanoseconds > 0 and sign = -1 zdt = new Temporal.ZonedDateTime( 0n, // Sets _startNs_ to 0 timeZoneSubstituteValues( [ [new Temporal.Instant(-2n)], // Returned in step 16, setting _relativeResult_ - [new Temporal.Instant(-4n)], // Returned in step 21.a, setting _oneDayFarther_ + [new Temporal.Instant(-4n)], // Returned in step 19, setting _oneDayFarther_ ], [ TemporalHelpers.SUBSTITUTE_SKIP, // Pre-conversion in Duration.p.round @@ -107,12 +107,12 @@ assert.throws(RangeError, () => "RangeError when nanoseconds > 0 and sign = -1" ); -// Step 28: day length is an unsafe integer +// Step 29: day length is an unsafe integer zdt = new Temporal.ZonedDateTime( 0n, timeZoneSubstituteValues( // Not called in step 16 because _days_ = 0 - // Returned in step 21.a, making _oneDayFarther_ 2^53 ns later than _relativeResult_ + // Returned in step 19, making _oneDayFarther_ 2^53 ns later than _relativeResult_ [[new Temporal.Instant(2n ** 53n)]], [] ) diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/calendar-dateadd-called-with-options-undefined.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/calendar-dateadd-called-with-options-undefined.js index 5f5155e292..e0c22a689e 100644 --- a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/calendar-dateadd-called-with-options-undefined.js +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/calendar-dateadd-called-with-options-undefined.js @@ -15,6 +15,6 @@ const calendar = TemporalHelpers.calendarDateAddUndefinedOptions(); const timeZone = TemporalHelpers.oneShiftTimeZone(new Temporal.Instant(0n), 3600e9); const instance = new Temporal.Duration(1, 1, 1, 1); instance.subtract(new Temporal.Duration(-1, -1, -1, -1), { relativeTo: new Temporal.ZonedDateTime(0n, timeZone, calendar) }); -assert.sameValue(calendar.dateAddCallCount, 3); +assert.sameValue(calendar.dateAddCallCount, 2); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/differencezoneddatetime-inconsistent-custom-calendar.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/differencezoneddatetime-inconsistent-custom-calendar.js new file mode 100644 index 0000000000..e2c543c7d2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/differencezoneddatetime-inconsistent-custom-calendar.js @@ -0,0 +1,55 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-temporal.duration.prototype.subtract +description: > + Throws a RangeError when custom calendar method returns inconsistent result +info: | + DifferenceZonedDateTime ( ... ) + 8. Repeat 3 times: + ... + g. If _sign_ = 0, or _timeSign_ = 0, or _sign_ = _timeSign_, then + ... + viii. Return ? CreateNormalizedDurationRecord(_dateDifference_.[[Years]], + _dateDifference_.[[Months]], _dateDifference_.[[Weeks]], + _dateDifference_.[[Days]], _norm_). + h. Set _dayCorrection_ to _dayCorrection_ + 1. + 9. NOTE: This step is only reached when custom calendar or time zone methods + return inconsistent values. + 10. Throw a *RangeError* exception. +features: [Temporal] +---*/ + +// Based partly on a test case by André Bargull + +const duration1 = new Temporal.Duration(0, 0, /* weeks = */ 7, 0, /* hours = */ 12); +const duration2 = new Temporal.Duration(0, 0, 0, /* days = */ -1); + +{ + const tz = new (class extends Temporal.TimeZone { + getPossibleInstantsFor(dateTime) { + return super.getPossibleInstantsFor(dateTime.add({ days: 3 })); + } + })("UTC"); + + const relativeTo = new Temporal.ZonedDateTime(0n, tz); + + assert.throws(RangeError, () => duration1.subtract(duration2, { relativeTo }), + "Calendar calculation where more than 2 days correction is needed should cause RangeError"); +} + +{ + const cal = new (class extends Temporal.Calendar { + dateUntil(one, two, options) { + return super.dateUntil(one, two, options).negated(); + } + })("iso8601"); + + const relativeTo = new Temporal.ZonedDateTime(0n, "UTC", cal); + + assert.throws(RangeError, () => duration1.subtract(duration2, { relativeTo }), + "Calendar calculation causing mixed-sign values should cause RangeError"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/normalized-time-duration-to-days-loop-arbitrarily.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/normalized-time-duration-to-days-loop-arbitrarily.js deleted file mode 100644 index 8873380037..0000000000 --- a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/normalized-time-duration-to-days-loop-arbitrarily.js +++ /dev/null @@ -1,78 +0,0 @@ -// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally -// Copyright (C) 2022 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.duration.prototype.subtract -description: > - NormalizedTimeDurationToDays can loop arbitrarily up to max safe integer -info: | - NormalizedTimeDurationToDays ( norm, zonedRelativeTo, timeZoneRec [ , precalculatedPlainDatetime ] ) - ... - 21. Repeat, while done is false, - a. Let oneDayFarther be ? AddDaysToZonedDateTime(relativeResult.[[Instant]], - relativeResult.[[DateTime]], timeZoneRec, zonedRelativeTo.[[Calendar]], sign). - b. Set dayLengthNs to NormalizedTimeDurationFromEpochNanosecondsDifference(oneDayFarther.[[EpochNanoseconds]], - relativeResult.[[EpochNanoseconds]]). - c. Let oneDayLess be ? SubtractNormalizedTimeDuration(norm, dayLengthNs). - c. If NormalizedTimeDurationSign(oneDayLess) × sign ≥ 0, then - i. Set norm to oneDayLess. - ii. Set relativeResult to oneDayFarther. - iii. Set days to days + sign. - d. Else, - i. Set done to true. -includes: [temporalHelpers.js] -features: [Temporal] ----*/ - -const calls = []; -const duration = Temporal.Duration.from({ days: 1 }); - -function createRelativeTo(count) { - const dayLengthNs = 86400000000000n; - const dayInstant = new Temporal.Instant(dayLengthNs); - const substitutions = []; - const timeZone = new Temporal.TimeZone("UTC"); - // Return constant value for first _count_ calls - TemporalHelpers.substituteMethod( - timeZone, - "getPossibleInstantsFor", - substitutions - ); - substitutions.length = count; - let i = 0; - for (i = 0; i < substitutions.length; i++) { - // (this value) - substitutions[i] = [dayInstant]; - } - // Record calls in calls[] - TemporalHelpers.observeMethod(calls, timeZone, "getPossibleInstantsFor"); - return new Temporal.ZonedDateTime(0n, timeZone); -} - -let zdt = createRelativeTo(50); -calls.splice(0); // Reset calls list after ZonedDateTime construction -duration.subtract(duration, { - relativeTo: zdt, -}); -assert.sameValue( - calls.length, - 50 + 1, - "Expected duration.subtract to call getPossibleInstantsFor correct number of times" -); - -zdt = createRelativeTo(100); -calls.splice(0); // Reset calls list after previous loop + ZonedDateTime construction -duration.subtract(duration, { - relativeTo: zdt, -}); -assert.sameValue( - calls.length, - 100 + 1, - "Expected duration.subtract to call getPossibleInstantsFor correct number of times" -); - -zdt = createRelativeTo(107); -assert.throws(RangeError, () => duration.subtract(duration, { relativeTo: zdt }), "107-2 days > 2⁵³ ns"); - -reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/order-of-operations.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/order-of-operations.js index 988835838f..55438a2b97 100644 --- a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/order-of-operations.js +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/order-of-operations.js @@ -339,18 +339,8 @@ const expectedOpsForZonedRelativeTo = expected.concat([ "call options.relativeTo.timeZone.getPossibleInstantsFor", // AddDuration → DifferenceZonedDateTime "call options.relativeTo.timeZone.getOffsetNanosecondsFor", - // AddDuration → DifferenceZonedDateTime → DifferenceISODateTime - "call options.relativeTo.calendar.dateUntil", - // AddDuration → DifferenceZonedDateTime → AddZonedDateTime - "call options.relativeTo.calendar.dateAdd", - "call options.relativeTo.timeZone.getPossibleInstantsFor", - // AddDuration → DifferenceZonedDateTime → NanosecondsToDays - "call options.relativeTo.timeZone.getOffsetNanosecondsFor", - "call options.relativeTo.timeZone.getOffsetNanosecondsFor", - // AddDuration → DifferenceZonedDateTime → NanosecondsToDays → AddZonedDateTime 1 - "call options.relativeTo.timeZone.getPossibleInstantsFor", - // AddDuration → DifferenceZonedDateTime → NanosecondsToDays → AddZonedDateTime 2 "call options.relativeTo.timeZone.getPossibleInstantsFor", + "call options.relativeTo.calendar.dateUntil", ]); const zonedRelativeTo = TemporalHelpers.propertyBagObserver(actual, { diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..193c09e806 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-out-of-range-backward-offset-shift.js @@ -0,0 +1,50 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.subtract +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const relativeTo = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; + +const instance = new Temporal.Duration(1, 0, 0, 1); +assert.throws(RangeError, () => instance.subtract(new Temporal.Duration(0, 0, 0, 0, 24), { relativeTo }), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..3d1d6262f0 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-out-of-range-forward-offset-shift.js @@ -0,0 +1,45 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.subtract +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const relativeTo = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; + +const instance = new Temporal.Duration(1, 0, 0, 1); +assert.throws(RangeError, () => instance.subtract(new Temporal.Duration(0, 0, 0, 0, 24), { relativeTo }), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/relativeto-zoneddatetime-normalized-time-duration-to-days-range-errors.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/relativeto-zoneddatetime-normalized-time-duration-to-days-range-errors.js deleted file mode 100644 index 46307bcaf9..0000000000 --- a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/subtract/relativeto-zoneddatetime-normalized-time-duration-to-days-range-errors.js +++ /dev/null @@ -1,144 +0,0 @@ -// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally -// Copyright (C) 2022 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-temporal.duration.prototype.subtract -description: > - Abstract operation NormalizedTimeDurationToDays can throw four different - RangeErrors. -info: | - NormalizedTimeDurationToDays ( norm, zonedRelativeTo, timeZoneRec [ , precalculatedPlainDateTime ] ) - 22. If days < 0 and sign = 1, throw a RangeError exception. - 23. If days > 0 and sign = -1, throw a RangeError exception. - ... - 25. If NormalizedTimeDurationSign(_norm_) = 1 and sign = -1, throw a RangeError exception. - ... - 28. If dayLength ≥ 2⁵³, throw a RangeError exception. -features: [Temporal, BigInt] -includes: [temporalHelpers.js] ----*/ - -const dayNs = 86_400_000_000_000; -const dayDuration = Temporal.Duration.from({ days: 1 }); -const epochInstant = new Temporal.Instant(0n); - -function timeZoneSubstituteValues( - getPossibleInstantsFor, - getOffsetNanosecondsFor -) { - const tz = new Temporal.TimeZone("UTC"); - TemporalHelpers.substituteMethod( - tz, - "getPossibleInstantsFor", - getPossibleInstantsFor - ); - TemporalHelpers.substituteMethod( - tz, - "getOffsetNanosecondsFor", - getOffsetNanosecondsFor - ); - return tz; -} - -// Step 22: days < 0 and sign = 1 -let zdt = new Temporal.ZonedDateTime( - -1n, // Set DifferenceZonedDateTime _ns1_ - timeZoneSubstituteValues( - [ - TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally for first call, AddDuration step 15 - [epochInstant], // Returned in AddDuration step 16, setting _endNs_ -> DifferenceZonedDateTime _ns2_ - [epochInstant], // Returned in step 16, setting _relativeResult_ - ], - [ - // Behave normally in 3 calls made prior to NormalizedTimeDurationToDays - TemporalHelpers.SUBSTITUTE_SKIP, - TemporalHelpers.SUBSTITUTE_SKIP, - TemporalHelpers.SUBSTITUTE_SKIP, - dayNs - 1, // Returned in step 8, setting _startDateTime_ - -dayNs + 1, // Returned in step 9, setting _endDateTime_ - ] - ) -); -assert.throws(RangeError, () => - // Subtracting day from day sets largestUnit to 'day', avoids having any week/month/year components in difference - dayDuration.subtract(dayDuration, { - relativeTo: zdt, - }) -); - -// Step 23: days > 0 and sign = -1 -zdt = new Temporal.ZonedDateTime( - 1n, // Set DifferenceZonedDateTime _ns1_ - timeZoneSubstituteValues( - [ - TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally for first call, AddDuration step 15 - [epochInstant], // Returned in AddDuration step 16, setting _endNs_ -> DifferenceZonedDateTime _ns2_ - [epochInstant], // Returned in step 16, setting _relativeResult_ - ], - [ - // Behave normally in 3 calls made prior to NanosecondsToDays - TemporalHelpers.SUBSTITUTE_SKIP, - TemporalHelpers.SUBSTITUTE_SKIP, - TemporalHelpers.SUBSTITUTE_SKIP, - -dayNs + 1, // Returned in step 8, setting _startDateTime_ - dayNs - 1, // Returned in step 9, setting _endDateTime_ - ] - ) -); -assert.throws(RangeError, () => - // Subtracting day from day sets largestUnit to 'day', avoids having any week/month/year components in difference - dayDuration.subtract(dayDuration, { - relativeTo: zdt, - }) -); - -// Step 25: nanoseconds > 0 and sign = -1 -zdt = new Temporal.ZonedDateTime( - 0n, // Set DifferenceZonedDateTime _ns1_ - timeZoneSubstituteValues( - [ - TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally for first call, AddDuration step 15 - [new Temporal.Instant(-1n)], // Returned in AddDuration step 16, setting _endNs_ -> DifferenceZonedDateTime _ns2_ - [new Temporal.Instant(-2n)], // Returned in step 16, setting _relativeResult_ - [new Temporal.Instant(-4n)], // Returned in step 21.a, setting _oneDayFarther_ - ], - [ - // Behave normally in 3 calls made prior to NanosecondsToDays - TemporalHelpers.SUBSTITUTE_SKIP, - TemporalHelpers.SUBSTITUTE_SKIP, - TemporalHelpers.SUBSTITUTE_SKIP, - dayNs - 1, // Returned in step 8, setting _startDateTime_ - -dayNs + 1, // Returned in step 9, setting _endDateTime_ - ] - ) -); -assert.throws(RangeError, () => - // Subtracting day from day sets largestUnit to 'day', avoids having any week/month/year components in difference - dayDuration.subtract(dayDuration, { - relativeTo: zdt, - }) -); - -// Step 28: day length is an unsafe integer -zdt = new Temporal.ZonedDateTime( - 0n, - timeZoneSubstituteValues( - [ - TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally for AddDuration step 15 - TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally for AddDuration step 16 - TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally for step 16, setting _relativeResult_ - // Returned in step 21.a, making _oneDayFarther_ 2^53 ns later than _relativeResult_ - [new Temporal.Instant(2n ** 53n - 3n * BigInt(dayNs))], - ], - [] - ) -); -const twoDaysDuration = new Temporal.Duration(0, 0, 0, 2); -assert.throws(RangeError, () => - dayDuration.subtract(twoDaysDuration, { - relativeTo: zdt, - }), - "Should throw RangeError when time zone calculates an outrageous day length" -); - -reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/dst-rounding-result.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/dst-rounding-result.js new file mode 100644 index 0000000000..b2b4daf2de --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/dst-rounding-result.js @@ -0,0 +1,40 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-temporal.duration.prototype.total +description: > + Rounding the resulting duration takes the time zone's UTC offset shifts + into account +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const timeZone = TemporalHelpers.springForwardFallBackTimeZone(); + +// Based on a test case by Adam Shaw + +{ + // Date part of duration lands on skipped DST hour, causing disambiguation + const duration = new Temporal.Duration(0, 1, 0, 15, 12); + const relativeTo = new Temporal.ZonedDateTime( + 950868000_000_000_000n /* = 2000-02-18T10Z */, + timeZone); /* = 2000-02-18T02-08 in local time */ + + assert.sameValue(duration.total({ unit: "months", relativeTo }), 1.5, + "1 month 15 days 12 hours should be exactly 1.5 months"); +} + +{ + // Month-only part of duration lands on skipped DST hour, should not cause + // disambiguation + const duration = new Temporal.Duration(0, 1, 0, 15); + const relativeTo = new Temporal.ZonedDateTime( + 951991200_000_000_000n /* = 2000-03-02T10Z */, + timeZone); /* = 2000-03-02T02-08 in local time */ + + assert.sameValue(duration.total({ unit: "months", relativeTo }), 1.5, + "1 month 15 days should be exactly 1.5 months"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/duration-out-of-range-added-to-relativeto.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/duration-out-of-range-added-to-relativeto.js index 2abd469541..cf33d39b0e 100644 --- a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/duration-out-of-range-added-to-relativeto.js +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/duration-out-of-range-added-to-relativeto.js @@ -8,21 +8,44 @@ description: RangeError thrown when calendar part of duration added to relativeT features: [Temporal] info: | RoundDuration: - 8.k. Let _isoResult_ be ! AddISODate(_plainRelativeTo_.[[ISOYear]]. _plainRelativeTo_.[[ISOMonth]], _plainRelativeTo_.[[ISODay]], 0, 0, 0, truncate(_fractionalDays_), *"constrain"*). - l. Let _wholeDaysLater_ be ? CreateTemporalDate(_isoResult_.[[Year]], _isoResult_.[[Month]], _isoResult_.[[Day]], _calendar_). + 10.h. Let _isoResult_ be ! AddISODate(_plainRelativeTo_.[[ISOYear]]. _plainRelativeTo_.[[ISOMonth]], _plainRelativeTo_.[[ISODay]], 0, 0, 0, truncate(_fractionalDays_), *"constrain"*). + i. Let _wholeDaysLater_ be ? CreateTemporalDate(_isoResult_.[[Year]], _isoResult_.[[Month]], _isoResult_.[[Day]], _calendar_). + ... + 11.h. Let _isoResult_ be ! AddISODate(_plainRelativeTo_.[[ISOYear]]. _plainRelativeTo_.[[ISOMonth]], _plainRelativeTo_.[[ISODay]], 0, 0, 0, truncate(_fractionalDays_), *"constrain"*). + i. Let _wholeDaysLater_ be ? CreateTemporalDate(_isoResult_.[[Year]], _isoResult_.[[Month]], _isoResult_.[[Day]], _calendar_). + ... + 12.a. Let _isoResult_ be ! AddISODate(_plainRelativeTo_.[[ISOYear]]. _plainRelativeTo_.[[ISOMonth]], _plainRelativeTo_.[[ISODay]], 0, 0, 0, truncate(_fractionalDays_), *"constrain"*). + b. Let _wholeDaysLater_ be ? CreateTemporalDate(_isoResult_.[[Year]], _isoResult_.[[Month]], _isoResult_.[[Day]], _calendar_). + + UnbalanceDateDurationRelative: + 11. Let _yearsMonthsWeeksDuration_ be ! CreateTemporalDuration(_years_, _months_, _weeks_, 0, 0, 0, 0, 0, 0, 0). + 12. Let _later_ be ? CalendarDateAdd(_calendaRec_, _plainRelativeTo_, _yearsMonthsWeeksDuration_). + 13. Let _yearsMonthsWeeksInDays_ be DaysUntil(_plainRelativeTo_, _later_). + 14. Return ? CreateDateDurationRecord(0, 0, 0, _days_ + _yearsMonthsWeeksInDays_). ---*/ // Based on a test case by André Bargull -const instance = new Temporal.Duration(0, 0, 0, /* days = */ 500_000_000); const relativeTo = new Temporal.PlainDate(2000, 1, 1); -assert.throws(RangeError, () => instance.total({relativeTo, unit: "years"})); -assert.throws(RangeError, () => instance.total({relativeTo, unit: "months"})); -assert.throws(RangeError, () => instance.total({relativeTo, unit: "weeks"})); - -const negInstance = new Temporal.Duration(0, 0, 0, /* days = */ -500_000_000); -assert.throws(RangeError, () => negInstance.total({relativeTo, unit: "years"})); -assert.throws(RangeError, () => negInstance.total({relativeTo, unit: "months"})); -assert.throws(RangeError, () => negInstance.total({relativeTo, unit: "weeks"})); + +{ + const instance = new Temporal.Duration(0, 0, 0, /* days = */ 500_000_000); + assert.throws(RangeError, () => instance.total({relativeTo, unit: "years"}), "days out of range, positive, unit years"); + assert.throws(RangeError, () => instance.total({relativeTo, unit: "months"}), "days out of range, positive, unit months"); + assert.throws(RangeError, () => instance.total({relativeTo, unit: "weeks"}), "days out of range, positive, unit weeks"); + + const negInstance = new Temporal.Duration(0, 0, 0, /* days = */ -500_000_000); + assert.throws(RangeError, () => negInstance.total({relativeTo, unit: "years"}), "days out of range, negative, unit years"); + assert.throws(RangeError, () => negInstance.total({relativeTo, unit: "months"}), "days out of range, negative, unit months"); + assert.throws(RangeError, () => negInstance.total({relativeTo, unit: "weeks"}), "days out of range, negative, unit weeks"); +} + +{ + const instance = new Temporal.Duration(0, 0, /* weeks = */ 1, /* days = */ Math.trunc((2 ** 53) / 86_400)); + assert.throws(RangeError, () => instance.total({relativeTo, unit: "days"}), "weeks + days out of range, positive"); + + const negInstance = new Temporal.Duration(0, 0, /* weeks = */ -1, /* days = */ -Math.trunc((2 ** 53) / 86_400)); + assert.throws(RangeError, () => instance.total({relativeTo, unit: "days"}), "weeks + days out of range, negative"); +} reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/normalized-time-duration-to-days-loop-arbitrarily.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/normalized-time-duration-to-days-loop-arbitrarily.js index 72260abd68..c4d685113d 100644 --- a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/normalized-time-duration-to-days-loop-arbitrarily.js +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/normalized-time-duration-to-days-loop-arbitrarily.js @@ -5,76 +5,42 @@ /*--- esid: sec-temporal.duration.prototype.total description: > - NormalizedTimeDurationToDays can loop arbitrarily up to max safe integer + NormalizedTimeDurationToDays should not be able to loop arbitrarily. info: | NormalizedTimeDurationToDays ( norm, zonedRelativeTo, timeZoneRec [ , precalculatedPlainDatetime ] ) ... - 21. Repeat, while done is false, - a. Let oneDayFarther be ? AddDaysToZonedDateTime(relativeResult.[[Instant]], - relativeResult.[[DateTime]], timeZoneRec, zonedRelativeTo.[[Calendar]], sign). - b. Set dayLengthNs to NormalizedTimeDurationFromEpochNanosecondsDifference(oneDayFarther.[[EpochNanoseconds]], - relativeResult.[[EpochNanoseconds]]). - c. Let oneDayLess be ? SubtractNormalizedTimeDuration(norm, dayLengthNs). - c. If NormalizedTimeDurationSign(oneDayLess) × sign ≥ 0, then - i. Set norm to oneDayLess. - ii. Set relativeResult to oneDayFarther. - iii. Set days to days + sign. - d. Else, - i. Set done to true. -includes: [temporalHelpers.js] + 22. If NormalizedTimeDurationSign(_oneDayLess_) × _sign_ ≥ 0, then + a. Set _norm_ to _oneDayLess_. + b. Set _relativeResult_ to _oneDayFarther_. + c. Set _days_ to _days_ + _sign_. + d. Set _oneDayFarther_ to ? AddDaysToZonedDateTime(_relativeResult_.[[Instant]], _relativeResult_.[[DateTime]], _timeZoneRec_, _zonedRelativeTo_.[[Calendar]], _sign_). + e. Set dayLengthNs to NormalizedTimeDurationFromEpochNanosecondsDifference(_oneDayFarther.[[EpochNanoseconds]], relativeResult.[[EpochNanoseconds]]). + f. If NormalizedTimeDurationSign(? SubtractNormalizedTimeDuration(_norm_, _dayLengthNs_)) × _sign_ ≥ 0, then + i. Throw a *RangeError* exception. features: [Temporal] ---*/ -const calls = []; const duration = Temporal.Duration.from({ days: 1 }); -function createRelativeTo(count) { - const dayLengthNs = 86400000000000n; - const dayInstant = new Temporal.Instant(dayLengthNs); - const substitutions = []; - const timeZone = new Temporal.TimeZone("UTC"); - // Return constant value for first _count_ calls - TemporalHelpers.substituteMethod( - timeZone, - "getPossibleInstantsFor", - substitutions - ); - substitutions.length = count; - let i = 0; - for (i = 0; i < substitutions.length; i++) { - // (this value) - substitutions[i] = [dayInstant]; +const dayLengthNs = 86400000000000n; +const dayInstant = new Temporal.Instant(dayLengthNs); +let calls = 0; +const timeZone = new class extends Temporal.TimeZone { + getPossibleInstantsFor() { + calls++; + return [dayInstant]; } - // Record calls in calls[] - TemporalHelpers.observeMethod(calls, timeZone, "getPossibleInstantsFor"); - return new Temporal.ZonedDateTime(0n, timeZone); -} +}("UTC"); -let zdt = createRelativeTo(50); -calls.splice(0); // Reset calls list after ZonedDateTime construction -duration.total({ - unit: "day", - relativeTo: zdt, -}); -assert.sameValue( - calls.length, - 50 + 2, - "Expected duration.total to call getPossibleInstantsFor correct number of times" -); +const relativeTo = new Temporal.ZonedDateTime(0n, timeZone); -zdt = createRelativeTo(100); -calls.splice(0); // Reset calls list after previous loop + ZonedDateTime construction -duration.total({ - unit: "day", - relativeTo: zdt, -}); -assert.sameValue( - calls.length, - 100 + 2, - "Expected duration.total to call getPossibleInstantsFor correct number of times" -); - -zdt = createRelativeTo(106); -assert.throws(RangeError, () => duration.total({ unit: "day", relativeTo: zdt }), "106-1 days > 2⁵³ ns"); +assert.throws(RangeError, () => duration.total({ unit: "days", relativeTo }), "indefinite loop is prevented"); +assert.sameValue(calls, 4, "getPossibleInstantsFor is not called indefinitely"); + // Expected calls: + // AddZonedDateTime (1) + // NormalizedTimeDurationToDays -> + // AddDaysToZonedDateTime (2, step 12) + // AddDaysToZonedDateTime (3, step 15) + // AddDaysToZonedDateTime (4, step 18.d) reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/precision-exact-mathematical-values-3.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/precision-exact-mathematical-values-3.js index ab3fd772cc..9f00233078 100644 --- a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/precision-exact-mathematical-values-3.js +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/precision-exact-mathematical-values-3.js @@ -71,7 +71,7 @@ function f64Repr(f) { const tz = new (class extends Temporal.TimeZone { getPossibleInstantsFor() { - // Called in NormalizedTimeDurationToDays 21.a from RoundDuration 7.b. + // Called in NormalizedTimeDurationToDays 19 from RoundDuration 7.b. // Sets _result_.[[DayLength]] to 2⁵³ - 1 ns, its largest possible value return [new Temporal.Instant(-86400_0000_0000_000_000_000n + 2n ** 53n - 1n)]; } diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..83878fb1b2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-out-of-range-backward-offset-shift.js @@ -0,0 +1,50 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.total +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const relativeTo = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; + +const instance = new Temporal.Duration(1, 0, 0, 0, 24); +assert.throws(RangeError, () => instance.total({ unit: "days", relativeTo }), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..0012871d85 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-out-of-range-forward-offset-shift.js @@ -0,0 +1,45 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.total +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const relativeTo = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; + +const instance = new Temporal.Duration(1, 0, 0, 0, 24); +assert.throws(RangeError, () => instance.total({ unit: "days", relativeTo }), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/relativeto-zoneddatetime-normalized-time-duration-to-days-range-errors.js b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/relativeto-zoneddatetime-normalized-time-duration-to-days-range-errors.js index d415117f89..3150c81852 100644 --- a/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/relativeto-zoneddatetime-normalized-time-duration-to-days-range-errors.js +++ b/js/src/tests/test262/built-ins/Temporal/Duration/prototype/total/relativeto-zoneddatetime-normalized-time-duration-to-days-range-errors.js @@ -8,12 +8,12 @@ description: > RangeErrors. info: | NormalizedTimeDurationToDays ( norm, zonedRelativeTo, timeZoneRec [ , precalculatedPlainDateTime ] ) - 22. If days < 0 and sign = 1, throw a RangeError exception. - 23. If days > 0 and sign = -1, throw a RangeError exception. + 23. If days < 0 and sign = 1, throw a RangeError exception. + 24. If days > 0 and sign = -1, throw a RangeError exception. ... - 25. If NormalizedTimeDurationSign(_norm_) = 1 and sign = -1, throw a RangeError exception. + 26. If NormalizedTimeDurationSign(_norm_) = 1 and sign = -1, throw a RangeError exception. ... - 28. If dayLength ≥ 2⁵³, throw a RangeError exception. + 29. If dayLength ≥ 2⁵³, throw a RangeError exception. features: [Temporal, BigInt] includes: [temporalHelpers.js] ---*/ @@ -41,7 +41,7 @@ function timeZoneSubstituteValues( return tz; } -// Step 22: days < 0 and sign = 1 +// Step 23: days < 0 and sign = 1 let zdt = new Temporal.ZonedDateTime( 0n, // Sets _startNs_ to 0 timeZoneSubstituteValues( @@ -62,7 +62,7 @@ assert.throws(RangeError, () => "RangeError when days < 0 and sign = 1" ); -// Step 23: days > 0 and sign = -1 +// Step 24: days > 0 and sign = -1 zdt = new Temporal.ZonedDateTime( 0n, // Sets _startNs_ to 0 timeZoneSubstituteValues( @@ -83,13 +83,13 @@ assert.throws(RangeError, () => "RangeError when days > 0 and sign = -1" ); -// Step 25: nanoseconds > 0 and sign = -1 +// Step 26: nanoseconds > 0 and sign = -1 zdt = new Temporal.ZonedDateTime( 0n, // Sets _startNs_ to 0 timeZoneSubstituteValues( [ [new Temporal.Instant(-2n)], // Returned in step 16, setting _relativeResult_ - [new Temporal.Instant(-4n)], // Returned in step 21.a, setting _oneDayFarther_ + [new Temporal.Instant(-4n)], // Returned in step 19, setting _oneDayFarther_ ], [ TemporalHelpers.SUBSTITUTE_SKIP, // pre-conversion in Duration.p.total @@ -107,12 +107,12 @@ assert.throws(RangeError, () => "RangeError when nanoseconds > 0 and sign = -1" ); -// Step 28: day length is an unsafe integer +// Step 29: day length is an unsafe integer zdt = new Temporal.ZonedDateTime( 0n, timeZoneSubstituteValues( // Not called in step 16 because _days_ = 0 - // Returned in step 21.a, making _oneDayFarther_ 2^53 ns later than _relativeResult_ + // Returned in step 19, making _oneDayFarther_ 2^53 ns later than _relativeResult_ [[new Temporal.Instant(2n ** 53n)]], [] ) diff --git a/js/src/tests/test262/built-ins/Temporal/Instant/compare/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Instant/compare/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..a0863e12f6 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Instant/compare/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,32 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.instant.compare +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const epoch = new Temporal.Instant(0n); + +const invalidStrings = [ + ["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"], +]; + +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => Temporal.Instant.compare(arg, epoch), + `annotation keys must be lowercase: ${arg} - ${descr} (first argument)` + ); + assert.throws( + RangeError, + () => Temporal.Instant.compare(epoch, arg), + `annotation keys must be lowercase: ${arg} - ${descr} (second argument)` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Instant/from/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Instant/from/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..635ffb4ed9 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Instant/from/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.instant.from +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"], +]; + +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => Temporal.Instant.from(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Instant/prototype/equals/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Instant/prototype/equals/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..7ee8e3fc30 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Instant/prototype/equals/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.instant.prototype.equals +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Instant(0n); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.equals(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Instant/prototype/since/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Instant/prototype/since/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..946f44ffa9 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Instant/prototype/since/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.instant.prototype.since +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Instant(0n); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.since(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Instant/prototype/toZonedDateTime/calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Instant/prototype/toZonedDateTime/calendar-iso-string.js new file mode 100644 index 0000000000..b067a5b62c --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Instant/prototype/toZonedDateTime/calendar-iso-string.js @@ -0,0 +1,27 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.instant.prototype.tozoneddatetime +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.Instant(1_000_000_000_000_000_000n); + +for (const arg of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const result = instance.toZonedDateTime({ calendar: arg, timeZone: "UTC" }); + assert.sameValue(result.getISOFields().calendar, "iso8601", `Calendar created from string "${arg}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Instant/prototype/until/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/Instant/prototype/until/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..4e9df646e2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Instant/prototype/until/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.instant.prototype.until +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Instant(0n); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.until(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Now/plainDate/calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Now/plainDate/calendar-iso-string.js new file mode 100644 index 0000000000..1414eb207b --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Now/plainDate/calendar-iso-string.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.now.plaindate +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +for (const arg of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const result = Temporal.Now.plainDate(arg); + assert.sameValue(result.getISOFields().calendar, "iso8601", `Calendar created from string "${arg}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Now/plainDateTime/calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Now/plainDateTime/calendar-iso-string.js new file mode 100644 index 0000000000..d093635a30 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Now/plainDateTime/calendar-iso-string.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.now.plaindatetime +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +for (const arg of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const result = Temporal.Now.plainDateTime(arg); + assert.sameValue(result.getISOFields().calendar, "iso8601", `Calendar created from string "${arg}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/Now/zonedDateTime/calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/Now/zonedDateTime/calendar-iso-string.js new file mode 100644 index 0000000000..09da5820f7 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/Now/zonedDateTime/calendar-iso-string.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.now.zoneddatetime +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +for (const arg of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const result = Temporal.Now.zonedDateTime(arg); + assert.sameValue(result.getISOFields().calendar, "iso8601", `Calendar created from string "${arg}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/compare/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/compare/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..81bf074b6b --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/compare/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.compare +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result1 = Temporal.PlainDate.compare(arg, new Temporal.PlainDate(1976, 11, 18)); + assert.sameValue(result1, 0, `Calendar created from string "${calendar}" (first argument)`); + const result2 = Temporal.PlainDate.compare(new Temporal.PlainDate(1976, 11, 18), arg); + assert.sameValue(result2, 0, `Calendar created from string "${calendar}" (second argument)`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/compare/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/compare/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..909b9e4348 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/compare/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,30 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.compare +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; + +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => Temporal.PlainDate.compare(arg, new Temporal.PlainDate(1976, 11, 18)), + `annotation keys must be lowercase: ${arg} - ${descr} (first argument)` + ); + assert.throws( + RangeError, + () => Temporal.PlainDate.compare(new Temporal.PlainDate(1976, 11, 18), arg), + `annotation keys must be lowercase: ${arg} - ${descr} (second argument)` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..b635736960 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.from +description: An ISO 8601 string can be converted to a calendar ID in Calendar +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = Temporal.PlainDate.from(arg); + TemporalHelpers.assertPlainDate(result, 1976, 11, "M11", 18, `Calendar created from string "${calendar}"`); + assert.sameValue(result.getISOFields().calendar, "iso8601", "calendar slot stores a string"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar-year-zero.js index fc65d8fd12..8f7002c4e6 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => Temporal.PlainDate.from(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/from/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/from/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..9cbfff7fb8 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/from/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.from +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; + +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => Temporal.PlainDate.from(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..6c6f568ceb --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.equals +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.PlainDate(1976, 11, 18); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.equals(arg); + assert.sameValue(result, true, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-year-zero.js index dc0a12c58a..a9e5c6d9d7 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.PlainDate(2000, 5, 2); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.equals(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/equals/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/equals/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..50b0ad9b55 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/equals/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.equals +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainDate(2000, 5, 2); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.equals(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..720267d753 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.since +description: An ISO 8601 string can be converted to a calendar ID in Calendar +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const instance = new Temporal.PlainDate(1976, 11, 18); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.since(arg); + TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-year-zero.js index 13b4a25387..d5eda02a0e 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.PlainDate(2000, 5, 2); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.since(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/since/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/since/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..d804238767 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/since/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.since +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainDate(2000, 5, 2); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.since(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/since/wrapping-at-end-of-month.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/since/wrapping-at-end-of-month.js new file mode 100644 index 0000000000..11d3bef1b7 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/since/wrapping-at-end-of-month.js @@ -0,0 +1,120 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.since +description: Tests balancing of days to months at end of month +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +// Difference between end of longer month to end of following shorter month +{ + const end = new Temporal.PlainDate(1970, 2, 28); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 1, 28).since(end, { largestUnit }), + 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, + "Jan 28th to Feb 28th is one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 1, 29).since(end, { largestUnit }), + 0, 0, 0, -30, 0, 0, 0, 0, 0, 0, + "Jan 29th to Feb 28th is 30 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 1, 30).since(end, { largestUnit }), + 0, 0, 0, -29, 0, 0, 0, 0, 0, 0, + "Jan 30th to Feb 28th is 29 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 1, 31).since(end, { largestUnit }), + 0, 0, 0, -28, 0, 0, 0, 0, 0, 0, + "Jan 31st to Feb 28th is 28 days, not one month" + ); + } +} + +// Difference between end of leap-year January to end of leap-year February +{ + const end = new Temporal.PlainDate(1972, 2, 29); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1972, 1, 29).since(end, { largestUnit }), + 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, + "Jan 29th to Feb 29th is one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1972, 1, 30).since(end, { largestUnit }), + 0, 0, 0, -30, 0, 0, 0, 0, 0, 0, + "Jan 30th to Feb 29th is 30 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1972, 1, 31).since(end, { largestUnit }), + 0, 0, 0, -29, 0, 0, 0, 0, 0, 0, + "Jan 31st to Feb 29th is 29 days, not one month" + ); + } +} + +// Difference between end of longer month to end of not-immediately-following +// shorter month +{ + const end = new Temporal.PlainDate(1970, 11, 30); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 8, 30).since(end, { largestUnit }), + 0, -3, 0, 0, 0, 0, 0, 0, 0, 0, + "Aug 30th to Nov 30th is 3 months" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 8, 31).since(end, { largestUnit }), + 0, -2, 0, -30, 0, 0, 0, 0, 0, 0, + "Aug 31st to Nov 30th is 2 months 30 days, not 3 months" + ); + } +} + +// Difference between end of longer month in one year to shorter month in +// later year +{ + const end = new Temporal.PlainDate(1973, 4, 30); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 12, 30).since(end, { largestUnit: "months" }), + 0, -28, 0, 0, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 28 months" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 12, 30).since(end, { largestUnit: "years" }), + -2, -4, 0, 0, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 2 years, 4 months" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 12, 31).since(end, { largestUnit: "months" }), + 0, -27, 0, -30, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 27 months, 30 days, not 28 months" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 12, 31).since(end, { largestUnit: "years" }), + -2, -3, 0, -30, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 2 years, 3 months, 30 days, not 2 years 4 months" + ); +} + +// Difference where months passes through a month that's the same length or +// shorter than either the start or end month +{ + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 1, 29).since(new Temporal.PlainDate(1970, 3, 28), { largestUnit: "months" }), + 0, -1, 0, -28, 0, 0, 0, 0, 0, 0, + "Jan 29th to Mar 28th is 1 month 28 days, not 58 days" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 1, 31).since(new Temporal.PlainDate(1971, 5, 30), { largestUnit: "years" }), + -1, -3, 0, -30, 0, 0, 0, 0, 0, 0, + "Jan 31st 1970 to May 30th 1971 is 1 year, 3 months, 30 days, not 1 year, 2 months, 60 days" + ); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toPlainDateTime/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toPlainDateTime/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..81f05806f1 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toPlainDateTime/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,31 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.toplaindatetime +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"], + ["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"], + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"], + ["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"], + ["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainDate(2000, 5, 2); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.toPlainDateTime(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..20fcdb44c0 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,31 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.tozoneddatetime +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"], + ["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"], + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"], + ["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"], + ["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainDate(2000, 5, 2); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.toZonedDateTime({ plainTime: arg, timeZone: "UTC" }), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/getoffsetnanosecondsfor-maximum-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/getoffsetnanosecondsfor-maximum-forward-offset-shift.js new file mode 100644 index 0000000000..31ca94435d --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/getoffsetnanosecondsfor-maximum-forward-offset-shift.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.tozoneddatetime +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants can be at most 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + calls++; + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12 })]; + } +} + +const timeZone = new Shift24Hour(); + +const instance = new Temporal.PlainDate(1970, 1, 1); +instance.toZonedDateTime({ timeZone, plainTime: new Temporal.PlainTime(12) }); + +assert(calls >= 2, "getOffsetNanosecondsFor should be called at least twice"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..1ab2bc7239 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js @@ -0,0 +1,44 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.tozoneddatetime +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +const instance = new Temporal.PlainDate(1970, 1, 1); +assert.throws(RangeError, () => instance.toZonedDateTime({ timeZone, plainTime: new Temporal.PlainTime(12) }), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/getpossibleinstantsfor-maximum-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/getpossibleinstantsfor-maximum-backward-offset-shift.js new file mode 100644 index 0000000000..015a36daf9 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/getpossibleinstantsfor-maximum-backward-offset-shift.js @@ -0,0 +1,53 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.tozoneddatetime +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + calls++; + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12 }), + utcInstant.add({ hours: 12 }) + ]; + } +} + +const timeZone = new Shift24Hour(); + +const instance = new Temporal.PlainDate(1970, 1, 1); +instance.toZonedDateTime({ timeZone, plainTime: new Temporal.PlainTime(12) }); + +assert(calls >= 1, "getPossibleInstantsFor should be called at least once"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/getpossibleinstantsfor-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/getpossibleinstantsfor-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..9d6efeab88 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/getpossibleinstantsfor-out-of-range-backward-offset-shift.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.tozoneddatetime +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +const instance = new Temporal.PlainDate(1970, 1, 1); +assert.throws(RangeError, () => instance.toZonedDateTime({ timeZone, plainTime: new Temporal.PlainTime(12) }), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..2ec1c255b3 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.until +description: An ISO 8601 string can be converted to a calendar ID in Calendar +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const instance = new Temporal.PlainDate(1976, 11, 18); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.until(arg); + TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-year-zero.js index abe100487e..5111e057ee 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.PlainDate(2000, 5, 2); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.until(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..38bba39b1d --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.until +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainDate(2000, 5, 2); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.until(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/largestunit-higher-units.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/largestunit-higher-units.js index a8f8812d9d..5962cf31bc 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/largestunit-higher-units.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/largestunit-higher-units.js @@ -20,10 +20,10 @@ TemporalHelpers.assertDuration(feb20.until(feb21, { largestUnit: "years" }), /* TemporalHelpers.assertDuration(feb20.until(feb21, { largestUnit: "months" }), 0, /* months = */ 12, 0, 0, 0, 0, 0, 0, 0, 0, "start of February, months"); TemporalHelpers.assertDuration(feb20.until(feb21, { largestUnit: "weeks" }), 0, 0, /* weeks = */ 52, /* days = */ 2, 0, 0, 0, 0, 0, 0, "start of February, weeks"); -const lastFeb20 = Temporal.PlainDate.from("2020-02-29"); -const lastFeb21 = Temporal.PlainDate.from("2021-02-28"); -TemporalHelpers.assertDuration(lastFeb20.until(lastFeb21, { largestUnit: "years" }), /* years = */ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "end of February, years"); -TemporalHelpers.assertDuration(lastFeb20.until(lastFeb21, { largestUnit: "months" }), 0, /* months = */ 12, 0, 0, 0, 0, 0, 0, 0, 0, "end of February, months"); -TemporalHelpers.assertDuration(lastFeb20.until(lastFeb21, { largestUnit: "weeks" }), 0, 0, /* weeks = */ 52, /* days = */ 1, 0, 0, 0, 0, 0, 0, "end of February, weeks"); +const lastFeb21 = new Temporal.PlainDate(2021, 2, 28); +const lastFeb22 = new Temporal.PlainDate(2022, 2, 28); +TemporalHelpers.assertDuration(lastFeb21.until(lastFeb22, { largestUnit: "years" }), /* years = */ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "end of February, years"); +TemporalHelpers.assertDuration(lastFeb21.until(lastFeb22, { largestUnit: "months" }), 0, /* months = */ 12, 0, 0, 0, 0, 0, 0, 0, 0, "end of February, months"); +TemporalHelpers.assertDuration(lastFeb21.until(lastFeb22, { largestUnit: "weeks" }), 0, 0, /* weeks = */ 52, /* days = */ 1, 0, 0, 0, 0, 0, 0, "end of February, weeks"); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/wrapping-at-end-of-month.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/wrapping-at-end-of-month.js new file mode 100644 index 0000000000..082ba05283 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/until/wrapping-at-end-of-month.js @@ -0,0 +1,120 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.until +description: Tests balancing of days to months at end of month +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +// Difference between end of longer month to end of following shorter month +{ + const end = new Temporal.PlainDate(1970, 2, 28); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 1, 28).until(end, { largestUnit }), + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + "Jan 28th to Feb 28th is one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 1, 29).until(end, { largestUnit }), + 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, + "Jan 29th to Feb 28th is 30 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 1, 30).until(end, { largestUnit }), + 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, + "Jan 30th to Feb 28th is 29 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 1, 31).until(end, { largestUnit }), + 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, + "Jan 31st to Feb 28th is 28 days, not one month" + ); + } +} + +// Difference between end of leap-year January to end of leap-year February +{ + const end = new Temporal.PlainDate(1972, 2, 29); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1972, 1, 29).until(end, { largestUnit }), + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + "Jan 29th to Feb 29th is one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1972, 1, 30).until(end, { largestUnit }), + 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, + "Jan 30th to Feb 29th is 30 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1972, 1, 31).until(end, { largestUnit }), + 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, + "Jan 31st to Feb 29th is 29 days, not one month" + ); + } +} + +// Difference between end of longer month to end of not-immediately-following +// shorter month +{ + const end = new Temporal.PlainDate(1970, 11, 30); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 8, 30).until(end, { largestUnit }), + 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, + "Aug 30th to Nov 30th is 3 months" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 8, 31).until(end, { largestUnit }), + 0, 2, 0, 30, 0, 0, 0, 0, 0, 0, + "Aug 31st to Nov 30th is 2 months 30 days, not 3 months" + ); + } +} + +// Difference between end of longer month in one year to shorter month in +// later year +{ + const end = new Temporal.PlainDate(1973, 4, 30); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 12, 30).until(end, { largestUnit: "months" }), + 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 28 months" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 12, 30).until(end, { largestUnit: "years" }), + 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 2 years, 4 months" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 12, 31).until(end, { largestUnit: "months" }), + 0, 27, 0, 30, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 27 months, 30 days, not 28 months" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 12, 31).until(end, { largestUnit: "years" }), + 2, 3, 0, 30, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 2 years, 3 months, 30 days, not 2 years 4 months" + ); +} + +// Difference where months passes through a month that's the same length or +// shorter than either the start or end month +{ + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 1, 29).until(new Temporal.PlainDate(1970, 3, 28), { largestUnit: "months" }), + 0, 1, 0, 28, 0, 0, 0, 0, 0, 0, + "Jan 29th to Mar 28th is 1 month 28 days, not 58 days" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDate(1970, 1, 31).until(new Temporal.PlainDate(1971, 5, 30), { largestUnit: "years" }), + 1, 3, 0, 30, 0, 0, 0, 0, 0, 0, + "Jan 31st 1970 to May 30th 1971 is 1 year, 3 months, 30 days, not 1 year, 2 months, 60 days" + ); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/weekOfYear/custom-calendar-weekofyear.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/weekOfYear/custom-calendar-weekofyear.js new file mode 100644 index 0000000000..724eaa4ccf --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/weekOfYear/custom-calendar-weekofyear.js @@ -0,0 +1,26 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.weekofyear +description: > + Temporal.PlainDate.prototype.weekOfYear returns undefined for all + custom calendars where weekOfYear() returns undefined. +features: [Temporal] +---*/ + +class CustomCalendar extends Temporal.Calendar { + constructor() { + super("iso8601"); + } + weekOfYear() { + return undefined; + } +} + +const calendar = new CustomCalendar(); +const customCalendarDate = new Temporal.PlainDate(2024, 1, 1, calendar); +assert.sameValue(customCalendarDate.weekOfYear, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/weekOfYear/validate-calendar-value.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/weekOfYear/validate-calendar-value.js index 7836bbff10..62faff1a15 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/weekOfYear/validate-calendar-value.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/weekOfYear/validate-calendar-value.js @@ -9,7 +9,6 @@ features: [Temporal] ---*/ const badResults = [ - [undefined, TypeError], [null, TypeError], [false, TypeError], [Infinity, RangeError], diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/withCalendar/calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/withCalendar/calendar-iso-string.js new file mode 100644 index 0000000000..e17e975f46 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/withCalendar/calendar-iso-string.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.withcalendar +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.PlainDate(1976, 11, 18, { + dateAdd() {}, + dateFromFields() {}, + dateUntil() {}, + day() {}, + dayOfWeek() {}, + dayOfYear() {}, + daysInMonth() {}, + daysInWeek() {}, + daysInYear() {}, + fields() {}, + id: "replace-me", + inLeapYear() {}, + mergeFields() {}, + month() {}, + monthCode() {}, + monthDayFromFields() {}, + monthsInYear() {}, + weekOfYear() {}, + year() {}, + yearMonthFromFields() {}, + yearOfWeek() {}, +}); + +for (const arg of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const result = instance.withCalendar(arg); + assert.sameValue(result.getISOFields().calendar, "iso8601", `Calendar created from string "${arg}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/yearOfWeek/custom-calendar-weekofyear.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/yearOfWeek/custom-calendar-weekofyear.js new file mode 100644 index 0000000000..9e37a85bd7 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/yearOfWeek/custom-calendar-weekofyear.js @@ -0,0 +1,26 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.yearofweek +description: > + Temporal.PlainDate.prototype.yearOfWeek returns undefined for all + custom calendars where yearOfWeek() returns undefined. +features: [Temporal] +---*/ + +class CustomCalendar extends Temporal.Calendar { + constructor() { + super("iso8601"); + } + yearOfWeek() { + return undefined; + } +} + +const calendar = new CustomCalendar(); +const customCalendarDate = new Temporal.PlainDate(2024, 1, 1, calendar); +assert.sameValue(customCalendarDate.yearOfWeek, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/yearOfWeek/validate-calendar-value.js b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/yearOfWeek/validate-calendar-value.js index ec291bd0ff..e00a2cda10 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/yearOfWeek/validate-calendar-value.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDate/prototype/yearOfWeek/validate-calendar-value.js @@ -9,7 +9,6 @@ features: [Temporal] ---*/ const badResults = [ - [undefined, TypeError], [Infinity, RangeError], [-Infinity, RangeError], [Symbol("foo"), TypeError], diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/compare/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/compare/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..182ef7beac --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/compare/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.compare +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result1 = Temporal.PlainDateTime.compare(arg, new Temporal.PlainDateTime(1976, 11, 18)); + assert.sameValue(result1, 0, `Calendar created from string "${calendar}" (first argument)`); + const result2 = Temporal.PlainDateTime.compare(new Temporal.PlainDateTime(1976, 11, 18), arg); + assert.sameValue(result2, 0, `Calendar created from string "${calendar}" (second argument)`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/compare/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/compare/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..fa4f9e080c --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/compare/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,30 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.compare +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; + +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => Temporal.PlainDateTime.compare(arg, new Temporal.PlainDateTime(1976, 11, 18)), + `annotation keys must be lowercase: ${arg} - ${descr} (first argument)` + ); + assert.throws( + RangeError, + () => Temporal.PlainDateTime.compare(new Temporal.PlainDateTime(1976, 11, 18), arg), + `annotation keys must be lowercase: ${arg} - ${descr} (second argument)` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..f1e298bf4b --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.from +description: An ISO 8601 string can be converted to a calendar ID in Calendar +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = Temporal.PlainDateTime.from(arg); + TemporalHelpers.assertPlainDateTime(result, 1976, 11, "M11", 18, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); + assert.sameValue(result.getISOFields().calendar, "iso8601", "calendar slot stores a string"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-year-zero.js index 8e5bc48a68..bfde3b1c4e 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => Temporal.PlainDateTime.from(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/from/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/from/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..1b69a116d3 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/from/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.from +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; + +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => Temporal.PlainDateTime.from(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..eaa94f9313 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.equals +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.PlainDateTime(1976, 11, 18); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.equals(arg); + assert.sameValue(result, true, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-year-zero.js index 967839b97e..3abda8c843 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.equals(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/equals/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/equals/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..7c1070bcf7 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/equals/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.equals +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.equals(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..f23d5b2eb0 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.since +description: An ISO 8601 string can be converted to a calendar ID in Calendar +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const instance = new Temporal.PlainDateTime(1976, 11, 18); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.since(arg); + TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-number.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-number.js index 9c7f65ec05..93932c89d5 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-number.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-number.js @@ -8,7 +8,7 @@ description: A number as calendar in a property bag is not accepted features: [Temporal] ---*/ -const instance = new Temporal.PlainDate(1976, 11, 18); +const instance = new Temporal.PlainDateTime(1976, 11, 18); const numbers = [ 1, @@ -16,6 +16,7 @@ const numbers = [ -19970327, 1234567890, ]; + for (const calendar of numbers) { const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; assert.throws( diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-year-zero.js index 6cd66acaf2..e869362840 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.since(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..b5b7f9ce2c --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.since +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.since(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/result-mixed-sign.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/result-mixed-sign.js new file mode 100644 index 0000000000..838de26784 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/result-mixed-sign.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.since +description: > + RangeError when inconsistent custom calendar method causes mixed signs of + Duration components +features: [Temporal] +---*/ + +// Test case provided by André Bargull + +const cal = new (class extends Temporal.Calendar { + dateAdd(date, duration, options) { + return super.dateAdd(date, duration.negated(), options); + } +})("iso8601"); + +const one = new Temporal.PlainDateTime(2000, 1, 1, 0, 0, 0, 0, 0, 0, cal); +const two = new Temporal.PlainDateTime(2020, 5, 10, 12, 12, 0, 0, 0, 0, cal); + +assert.throws(RangeError, () => two.since(one, { + largestUnit: "years", + smallestUnit: "hours" +})); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/wrapping-at-end-of-month.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/wrapping-at-end-of-month.js new file mode 100644 index 0000000000..23cecf8d1a --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/since/wrapping-at-end-of-month.js @@ -0,0 +1,120 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.since +description: Tests balancing of days to months at end of month +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +// Difference between end of longer month to end of following shorter month +{ + const end = new Temporal.PlainDateTime(1970, 2, 28); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 1, 28).since(end, { largestUnit }), + 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, + "Jan 28th to Feb 28th is one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 1, 29).since(end, { largestUnit }), + 0, 0, 0, -30, 0, 0, 0, 0, 0, 0, + "Jan 29th to Feb 28th is 30 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 1, 30).since(end, { largestUnit }), + 0, 0, 0, -29, 0, 0, 0, 0, 0, 0, + "Jan 30th to Feb 28th is 29 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 1, 31).since(end, { largestUnit }), + 0, 0, 0, -28, 0, 0, 0, 0, 0, 0, + "Jan 31st to Feb 28th is 28 days, not one month" + ); + } +} + +// Difference between end of leap-year January to end of leap-year February +{ + const end = new Temporal.PlainDateTime(1972, 2, 29); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1972, 1, 29).since(end, { largestUnit }), + 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, + "Jan 29th to Feb 29th is one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1972, 1, 30).since(end, { largestUnit }), + 0, 0, 0, -30, 0, 0, 0, 0, 0, 0, + "Jan 30th to Feb 29th is 30 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1972, 1, 31).since(end, { largestUnit }), + 0, 0, 0, -29, 0, 0, 0, 0, 0, 0, + "Jan 31st to Feb 29th is 29 days, not one month" + ); + } +} + +// Difference between end of longer month to end of not-immediately-following +// shorter month +{ + const end = new Temporal.PlainDateTime(1970, 11, 30); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 8, 30).since(end, { largestUnit }), + 0, -3, 0, 0, 0, 0, 0, 0, 0, 0, + "Aug 30th to Nov 30th is 3 months" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 8, 31).since(end, { largestUnit }), + 0, -2, 0, -30, 0, 0, 0, 0, 0, 0, + "Aug 31st to Nov 30th is 2 months 30 days, not 3 months" + ); + } +} + +// Difference between end of longer month in one year to shorter month in +// later year +{ + const end = new Temporal.PlainDateTime(1973, 4, 30); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 12, 30).since(end, { largestUnit: "months" }), + 0, -28, 0, 0, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 28 months" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 12, 30).since(end, { largestUnit: "years" }), + -2, -4, 0, 0, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 2 years, 4 months" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 12, 31).since(end, { largestUnit: "months" }), + 0, -27, 0, -30, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 27 months, 30 days, not 28 months" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 12, 31).since(end, { largestUnit: "years" }), + -2, -3, 0, -30, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 2 years, 3 months, 30 days, not 2 years 4 months" + ); +} + +// Difference where months passes through a month that's the same length or +// shorter than either the start or end month +{ + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 1, 29).since(new Temporal.PlainDateTime(1970, 3, 28), { largestUnit: "months" }), + 0, -1, 0, -28, 0, 0, 0, 0, 0, 0, + "Jan 29th to Mar 28th is 1 month 28 days, not 58 days" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 1, 31).since(new Temporal.PlainDateTime(1971, 5, 30), { largestUnit: "years" }), + -1, -3, 0, -30, 0, 0, 0, 0, 0, 0, + "Jan 31st 1970 to May 30th 1971 is 1 year, 3 months, 30 days, not 1 year, 2 months, 60 days" + ); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/getoffsetnanosecondsfor-maximum-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/getoffsetnanosecondsfor-maximum-forward-offset-shift.js new file mode 100644 index 0000000000..af7f128a9c --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/getoffsetnanosecondsfor-maximum-forward-offset-shift.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.tozoneddatetime +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants can be at most 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + calls++; + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12 })]; + } +} + +const timeZone = new Shift24Hour(); + +const instance = new Temporal.PlainDateTime(1970, 1, 1, 12); +instance.toZonedDateTime(timeZone); + +assert(calls >= 2, "getOffsetNanosecondsFor should be called at least twice"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..3fe9f52dbf --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js @@ -0,0 +1,44 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.tozoneddatetime +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +const instance = new Temporal.PlainDateTime(1970, 1, 1, 12); +assert.throws(RangeError, () => instance.toZonedDateTime(timeZone), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/getpossibleinstantsfor-maximum-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/getpossibleinstantsfor-maximum-backward-offset-shift.js new file mode 100644 index 0000000000..a1a8898838 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/getpossibleinstantsfor-maximum-backward-offset-shift.js @@ -0,0 +1,53 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.tozoneddatetime +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + calls++; + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12 }), + utcInstant.add({ hours: 12 }) + ]; + } +} + +const timeZone = new Shift24Hour(); + +const instance = new Temporal.PlainDateTime(1970, 1, 1, 12); +instance.toZonedDateTime(timeZone); + +assert(calls >= 1, "getPossibleInstantsFor should be called at least once"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/getpossibleinstantsfor-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/getpossibleinstantsfor-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..29703ed59f --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/getpossibleinstantsfor-out-of-range-backward-offset-shift.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.tozoneddatetime +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +const instance = new Temporal.PlainDateTime(1970, 1, 1, 12); +assert.throws(RangeError, () => instance.toZonedDateTime(timeZone), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..0f06b77fa8 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.until +description: An ISO 8601 string can be converted to a calendar ID in Calendar +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const instance = new Temporal.PlainDateTime(1976, 11, 18); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.until(arg); + TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-number.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-number.js index cf43c5a168..ab3cea6b6c 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-number.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-number.js @@ -8,7 +8,7 @@ description: A number as calendar in a property bag is not accepted features: [Temporal] ---*/ -const instance = new Temporal.PlainDate(1976, 11, 18); +const instance = new Temporal.PlainDateTime(1976, 11, 18); const numbers = [ 1, @@ -16,6 +16,7 @@ const numbers = [ -19970327, 1234567890, ]; + for (const calendar of numbers) { const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; assert.throws( diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-year-zero.js index 099de48b51..b1d165cc6e 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.until(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..94dcaf9e99 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.until +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.until(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/no-unnecessary-units.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/no-unnecessary-units.js index 7e311f8dca..8966496ca9 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/no-unnecessary-units.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/no-unnecessary-units.js @@ -9,17 +9,17 @@ features: [Temporal] includes: [temporalHelpers.js] ---*/ -const feb29 = new Temporal.PlainDateTime(2020, 2, 29, 0, 0); -const feb28 = new Temporal.PlainDateTime(2021, 2, 28, 0, 0); +const lastFeb21 = new Temporal.PlainDateTime(2021, 2, 28); +const lastFeb22 = new Temporal.PlainDateTime(2022, 2, 28); TemporalHelpers.assertDuration( - feb29.until(feb28, { largestUnit: "months" }), + lastFeb21.until(lastFeb22, { largestUnit: "months" }), 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, "does not include higher units than necessary (largest unit = months)" ); TemporalHelpers.assertDuration( - feb29.until(feb28, { largestUnit: "years" }), + lastFeb21.until(lastFeb22, { largestUnit: "years" }), 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "does not include higher units than necessary (largest unit = years)" ); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/result-mixed-sign.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/result-mixed-sign.js new file mode 100644 index 0000000000..7287c706b9 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/result-mixed-sign.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.until +description: > + RangeError when inconsistent custom calendar method causes mixed signs of + Duration components +features: [Temporal] +---*/ + +// Test case provided by André Bargull + +const cal = new (class extends Temporal.Calendar { + dateAdd(date, duration, options) { + return super.dateAdd(date, duration.negated(), options); + } +})("iso8601"); + +const one = new Temporal.PlainDateTime(2000, 1, 1, 0, 0, 0, 0, 0, 0, cal); +const two = new Temporal.PlainDateTime(2020, 5, 10, 12, 12, 0, 0, 0, 0, cal); + +assert.throws(RangeError, () => one.until(two, { + largestUnit: "years", + smallestUnit: "hours" +})); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/wrapping-at-end-of-month.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/wrapping-at-end-of-month.js new file mode 100644 index 0000000000..3a83eb2138 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/until/wrapping-at-end-of-month.js @@ -0,0 +1,120 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.until +description: Tests balancing of days to months at end of month +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +// Difference between end of longer month to end of following shorter month +{ + const end = new Temporal.PlainDateTime(1970, 2, 28); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 1, 28).until(end, { largestUnit }), + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + "Jan 28th to Feb 28th is one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 1, 29).until(end, { largestUnit }), + 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, + "Jan 29th to Feb 28th is 30 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 1, 30).until(end, { largestUnit }), + 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, + "Jan 30th to Feb 28th is 29 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 1, 31).until(end, { largestUnit }), + 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, + "Jan 31st to Feb 28th is 28 days, not one month" + ); + } +} + +// Difference between end of leap-year January to end of leap-year February +{ + const end = new Temporal.PlainDateTime(1972, 2, 29); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1972, 1, 29).until(end, { largestUnit }), + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + "Jan 29th to Feb 29th is one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1972, 1, 30).until(end, { largestUnit }), + 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, + "Jan 30th to Feb 29th is 30 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1972, 1, 31).until(end, { largestUnit }), + 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, + "Jan 31st to Feb 29th is 29 days, not one month" + ); + } +} + +// Difference between end of longer month to end of not-immediately-following +// shorter month +{ + const end = new Temporal.PlainDateTime(1970, 11, 30); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 8, 30).until(end, { largestUnit }), + 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, + "Aug 30th to Nov 30th is 3 months" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 8, 31).until(end, { largestUnit }), + 0, 2, 0, 30, 0, 0, 0, 0, 0, 0, + "Aug 31st to Nov 30th is 2 months 30 days, not 3 months" + ); + } +} + +// Difference between end of longer month in one year to shorter month in +// later year +{ + const end = new Temporal.PlainDateTime(1973, 4, 30); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 12, 30).until(end, { largestUnit: "months" }), + 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 28 months" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 12, 30).until(end, { largestUnit: "years" }), + 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 2 years, 4 months" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 12, 31).until(end, { largestUnit: "months" }), + 0, 27, 0, 30, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 27 months, 30 days, not 28 months" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 12, 31).until(end, { largestUnit: "years" }), + 2, 3, 0, 30, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 2 years, 3 months, 30 days, not 2 years 4 months" + ); +} + +// Difference where months passes through a month that's the same length or +// shorter than either the start or end month +{ + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 1, 29).until(new Temporal.PlainDateTime(1970, 3, 28), { largestUnit: "months" }), + 0, 1, 0, 28, 0, 0, 0, 0, 0, 0, + "Jan 29th to Mar 28th is 1 month 28 days, not 58 days" + ); + TemporalHelpers.assertDuration( + new Temporal.PlainDateTime(1970, 1, 31).until(new Temporal.PlainDateTime(1971, 5, 30), { largestUnit: "years" }), + 1, 3, 0, 30, 0, 0, 0, 0, 0, 0, + "Jan 31st 1970 to May 30th 1971 is 1 year, 3 months, 30 days, not 1 year, 2 months, 60 days" + ); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/weekOfYear/custom-calendar-weekofyear.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/weekOfYear/custom-calendar-weekofyear.js new file mode 100644 index 0000000000..97242a19c4 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/weekOfYear/custom-calendar-weekofyear.js @@ -0,0 +1,26 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.weekofyear +description: > + Temporal.PlainDateTime.prototype.weekOfYear returns undefined for all + custom calendars where weekOfYear() returns undefined. +features: [Temporal] +---*/ + +class CustomCalendar extends Temporal.Calendar { + constructor() { + super("iso8601"); + } + weekOfYear() { + return undefined; + } +} + +const calendar = new CustomCalendar(); +const customCalendarDate = new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); +assert.sameValue(customCalendarDate.weekOfYear, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/weekOfYear/validate-calendar-value.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/weekOfYear/validate-calendar-value.js index d1624e1617..89d47a3566 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/weekOfYear/validate-calendar-value.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/weekOfYear/validate-calendar-value.js @@ -9,7 +9,6 @@ features: [Temporal] ---*/ const badResults = [ - [undefined, TypeError], [null, TypeError], [false, TypeError], [Infinity, RangeError], diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withCalendar/calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withCalendar/calendar-iso-string.js new file mode 100644 index 0000000000..7ba0d5a207 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withCalendar/calendar-iso-string.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.withcalendar +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, { + dateAdd() {}, + dateFromFields() {}, + dateUntil() {}, + day() {}, + dayOfWeek() {}, + dayOfYear() {}, + daysInMonth() {}, + daysInWeek() {}, + daysInYear() {}, + fields() {}, + id: "replace-me", + inLeapYear() {}, + mergeFields() {}, + month() {}, + monthCode() {}, + monthDayFromFields() {}, + monthsInYear() {}, + weekOfYear() {}, + year() {}, + yearMonthFromFields() {}, + yearOfWeek() {}, +}); + +for (const arg of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const result = instance.withCalendar(arg); + assert.sameValue(result.getISOFields().calendar, "iso8601", `Calendar created from string "${arg}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..e514b4b7d3 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.withplaindate +description: An ISO 8601 string can be converted to a calendar ID in Calendar +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.withPlainDate(arg); + TemporalHelpers.assertPlainDateTime(result, 1976, 11, "M11", 18, 12, 34, 56, 987, 654, 321, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-number.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-number.js index cbd1950207..57c77ae669 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-number.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-number.js @@ -8,7 +8,7 @@ description: A number as calendar in a property bag is not accepted features: [Temporal] ---*/ -const instance = new Temporal.PlainDate(1976, 11, 18); +const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); const numbers = [ 1, @@ -16,6 +16,7 @@ const numbers = [ -19970327, 1234567890, ]; + for (const calendar of numbers) { const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; assert.throws( diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-year-zero.js index d39551d616..201aba871b 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.withPlainDate(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..8f9827733c --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.withplaindate +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.withPlainDate(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainTime/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainTime/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..5d63e53dc4 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/withPlainTime/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,31 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.withplaintime +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"], + ["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"], + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"], + ["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"], + ["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.withPlainTime(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/yearOfWeek/custom-calendar-weekofyear.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/yearOfWeek/custom-calendar-weekofyear.js new file mode 100644 index 0000000000..81b9ae2086 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/yearOfWeek/custom-calendar-weekofyear.js @@ -0,0 +1,26 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.yearofweek +description: > + Temporal.PlainDateTime.prototype.yearOfWeek returns undefined for all + custom calendars where yearOfWeek() returns undefined. +features: [Temporal] +---*/ + +class CustomCalendar extends Temporal.Calendar { + constructor() { + super("iso8601"); + } + yearOfWeek() { + return undefined; + } +} + +const calendar = new CustomCalendar(); +const customCalendarDate = new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); +assert.sameValue(customCalendarDate.yearOfWeek, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/yearOfWeek/validate-calendar-value.js b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/yearOfWeek/validate-calendar-value.js index cd43fd4474..8c67a02491 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/yearOfWeek/validate-calendar-value.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainDateTime/prototype/yearOfWeek/validate-calendar-value.js @@ -9,7 +9,6 @@ features: [Temporal] ---*/ const badResults = [ - [undefined, TypeError], [Infinity, RangeError], [-Infinity, RangeError], [Symbol("foo"), TypeError], diff --git a/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..0f227aa4be --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainmonthday.from +description: An ISO 8601 string can be converted to a calendar ID in Calendar +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { monthCode: "M11", day: 18, calendar }; + const result = Temporal.PlainMonthDay.from(arg); + TemporalHelpers.assertPlainMonthDay(result, "M11", 18, `Calendar created from string "${calendar}"`); + assert.sameValue(result.getISOFields().calendar, "iso8601", "calendar slot stores a string"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-propertybag-calendar-year-zero.js index 19fb53023f..0b5268347c 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => Temporal.PlainMonthDay.from(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..6fce02f500 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/from/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainmonthday.from +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; + +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => Temporal.PlainMonthDay.from(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..756ea33cf2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainmonthday.prototype.equals +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.PlainMonthDay(11, 18); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { monthCode: "M11", day: 18, calendar }; + const result = instance.equals(arg); + assert.sameValue(result, true, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-year-zero.js index e3303ba1f5..86756fe089 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.PlainMonthDay(5, 2); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.equals(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..bc74d401db --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainmonthday.prototype.equals +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainMonthDay(5, 2); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.equals(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/calendar-fromfields-called-with-undefined-options.js b/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/calendar-fromfields-called-with-undefined-options.js new file mode 100644 index 0000000000..996909c664 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/calendar-fromfields-called-with-undefined-options.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainmonthday.prototype.toplaindate +description: Calendar.dateFromFields method is called with undefined options +features: [Temporal] +---*/ + +let count = 0; + +const calendar = new class extends Temporal.Calendar { + dateFromFields(fields, options) { + count++; + assert.sameValue(options, undefined, "dateFromFields should be called with undefined options"); + return super.dateFromFields(fields, options); + } +}("iso8601"); + +const instance = new Temporal.PlainMonthDay(5, 2, calendar); +instance.toPlainDate({ year: 2019 }); +assert.sameValue(count, 1, "dateFromFields should have been called on the calendar"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/compare/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/compare/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..8667a8bf8f --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/compare/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,36 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaintime.compare +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"], + ["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"], + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"], + ["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"], + ["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; + +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => Temporal.PlainTime.compare(arg, new Temporal.PlainTime(12, 34, 56, 987, 654, 321)), + `annotation keys must be lowercase: ${arg} - ${descr} (first argument)` + ); + assert.throws( + RangeError, + () => Temporal.PlainTime.compare(new Temporal.PlainTime(12, 34, 56, 987, 654, 321), arg), + `annotation keys must be lowercase: ${arg} - ${descr} (second argument)` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/from/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/from/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..886c8b6af8 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/from/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,31 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaintime.from +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"], + ["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"], + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"], + ["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"], + ["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; + +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => Temporal.PlainTime.from(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/equals/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/equals/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..258b4b5c77 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/equals/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,31 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaintime.prototype.equals +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"], + ["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"], + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"], + ["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"], + ["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.equals(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/since/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/since/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..1e2b960f01 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/since/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,31 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaintime.prototype.since +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"], + ["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"], + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"], + ["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"], + ["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.since(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..8f2089e661 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaintime.prototype.toplaindatetime +description: An ISO 8601 string can be converted to a calendar ID in Calendar +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.toPlainDateTime(arg); + TemporalHelpers.assertPlainDateTime(result, 1976, 11, "M11", 18, 12, 34, 56, 987, 654, 321, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-number.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-number.js index 407773adb4..56d2ffce44 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-number.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-number.js @@ -8,7 +8,7 @@ description: A number as calendar in a property bag is not accepted features: [Temporal] ---*/ -const instance = new Temporal.PlainDate(1976, 11, 18); +const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); const numbers = [ 1, @@ -16,6 +16,7 @@ const numbers = [ -19970327, 1234567890, ]; + for (const calendar of numbers) { const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; assert.throws( diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-year-zero.js index f9ba398d5f..2bf5796cc3 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.toPlainDateTime(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..84f457f314 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaintime.prototype.toplaindatetime +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.toPlainDateTime(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..512dc81228 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaintime.prototype.tozoneddatetime +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.toZonedDateTime({ plainDate: arg, timeZone: "UTC" }); + assert.sameValue(result.epochNanoseconds, 217_168_496_987_654_321n, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-propertybag-calendar-year-zero.js index 2acf24b30d..ae338a02ba 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.toZonedDateTime({ plainDate: arg, timeZone: "UTC" }), diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..6a37c4b726 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaintime.prototype.tozoneddatetime +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.toZonedDateTime({ plainDate: arg, timeZone: "UTC" }), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/getoffsetnanosecondsfor-maximum-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/getoffsetnanosecondsfor-maximum-forward-offset-shift.js new file mode 100644 index 0000000000..cbafe771e2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/getoffsetnanosecondsfor-maximum-forward-offset-shift.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaintime.prototype.tozoneddatetime +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants can be at most 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + calls++; + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12 })]; + } +} + +const timeZone = new Shift24Hour(); + +const instance = new Temporal.PlainTime(12); +instance.toZonedDateTime({ timeZone, plainDate: new Temporal.PlainDate(1970, 1, 1) }); + +assert(calls >= 2, "getOffsetNanosecondsFor should be called at least twice"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..139efa0dcc --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js @@ -0,0 +1,44 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaintime.prototype.tozoneddatetime +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +const instance = new Temporal.PlainTime(12); +assert.throws(RangeError, () => instance.toZonedDateTime({ timeZone, plainDate: new Temporal.PlainDate(1970, 1, 1) }), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/getpossibleinstantsfor-maximum-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/getpossibleinstantsfor-maximum-backward-offset-shift.js new file mode 100644 index 0000000000..200423dd52 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/getpossibleinstantsfor-maximum-backward-offset-shift.js @@ -0,0 +1,53 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaintime.prototype.tozoneddatetime +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + calls++; + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12 }), + utcInstant.add({ hours: 12 }) + ]; + } +} + +const timeZone = new Shift24Hour(); + +const instance = new Temporal.PlainTime(12); +instance.toZonedDateTime({ timeZone, plainDate: new Temporal.PlainDate(1970, 1, 1) }); + +assert(calls >= 1, "getPossibleInstantsFor should be called at least once"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/getpossibleinstantsfor-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/getpossibleinstantsfor-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..968957a05e --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/getpossibleinstantsfor-out-of-range-backward-offset-shift.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaintime.prototype.tozoneddatetime +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +const instance = new Temporal.PlainTime(12); +assert.throws(RangeError, () => instance.toZonedDateTime({ timeZone, plainDate: new Temporal.PlainDate(1970, 1, 1) }), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/until/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/until/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..48c425a3ef --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainTime/prototype/until/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,31 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaintime.prototype.until +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"], + ["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"], + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"], + ["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"], + ["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.until(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/compare/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/compare/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..42192ffb4f --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/compare/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainyearmonth.compare +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 2019, monthCode: "M06", calendar }; + const result1 = Temporal.PlainYearMonth.compare(arg, new Temporal.PlainYearMonth(2019, 6)); + assert.sameValue(result1, 0, `Calendar created from string "${calendar}" (first argument)`); + const result2 = Temporal.PlainYearMonth.compare(new Temporal.PlainYearMonth(2019, 6), arg); + assert.sameValue(result2, 0, `Calendar created from string "${calendar}" (second argument)`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/compare/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/compare/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..705204f82b --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/compare/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,30 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainyearmonth.compare +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; + +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => Temporal.PlainYearMonth.compare(arg, new Temporal.PlainYearMonth(2019, 6)), + `annotation keys must be lowercase: ${arg} - ${descr} (first argument)` + ); + assert.throws( + RangeError, + () => Temporal.PlainYearMonth.compare(new Temporal.PlainYearMonth(2019, 6), arg), + `annotation keys must be lowercase: ${arg} - ${descr} (second argument)` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/from/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/from/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..a94d59d88f --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/from/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainyearmonth.from +description: An ISO 8601 string can be converted to a calendar ID in Calendar +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 2019, monthCode: "M06", calendar }; + const result = Temporal.PlainYearMonth.from(arg); + TemporalHelpers.assertPlainYearMonth(result, 2019, 6, "M06", `Calendar created from string "${calendar}"`); + assert.sameValue(result.getISOFields().calendar, "iso8601", "calendar slot stores a string"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/from/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/from/argument-propertybag-calendar-year-zero.js index 9d039d2365..03225ab174 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/from/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/from/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => Temporal.PlainYearMonth.from(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/from/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/from/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..15629e5f98 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/from/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainyearmonth.from +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; + +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => Temporal.PlainYearMonth.from(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..005d750ff9 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainyearmonth.prototype.equals +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.PlainYearMonth(2019, 6); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 2019, monthCode: "M06", calendar }; + const result = instance.equals(arg); + assert.sameValue(result, true, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-year-zero.js index 0e652fd79b..be30091e98 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.PlainYearMonth(2000, 5); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.equals(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..98808648b2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainyearmonth.prototype.equals +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainYearMonth(2000, 5); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.equals(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..7e7ed39768 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainyearmonth.prototype.since +description: An ISO 8601 string can be converted to a calendar ID in Calendar +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const instance = new Temporal.PlainYearMonth(2019, 6); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 2019, monthCode: "M06", calendar }; + const result = instance.since(arg); + TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-number.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-number.js index 08a1caa46b..b458e6d42b 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-number.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-number.js @@ -8,7 +8,7 @@ description: A number as calendar in a property bag is not accepted features: [Temporal] ---*/ -const instance = new Temporal.PlainDate(1976, 11, 18); +const instance = new Temporal.PlainYearMonth(2019, 6); const numbers = [ 1, @@ -16,6 +16,7 @@ const numbers = [ -19970327, 1234567890, ]; + for (const calendar of numbers) { const arg = { year: 2019, monthCode: "M06", calendar }; assert.throws( diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-year-zero.js index 6c0b70f03b..ddca0eaedc 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.PlainYearMonth(2000, 5); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.since(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/since/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/since/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..1746c55e7a --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/since/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainyearmonth.prototype.since +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainYearMonth(2000, 5); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.since(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/calendar-fromfields-called-with-undefined-options.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/calendar-fromfields-called-with-undefined-options.js new file mode 100644 index 0000000000..0edd3b289f --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/toPlainDate/calendar-fromfields-called-with-undefined-options.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainyearmonth.prototype.toplaindate +description: Calendar.dateFromFields method is called with undefined options +features: [Temporal] +---*/ + +let count = 0; + +const calendar = new class extends Temporal.Calendar { + dateFromFields(fields, options) { + count++; + assert.sameValue(options, undefined, "dateFromFields should be called with undefined options"); + return super.dateFromFields(fields, options); + } +}("iso8601"); + +const instance = new Temporal.PlainYearMonth(2000, 5, calendar); +instance.toPlainDate({ day: 24 }); +assert.sameValue(count, 1, "dateFromFields should have been called on the calendar"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..cddfd13793 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainyearmonth.prototype.until +description: An ISO 8601 string can be converted to a calendar ID in Calendar +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const instance = new Temporal.PlainYearMonth(2019, 6); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 2019, monthCode: "M06", calendar }; + const result = instance.until(arg); + TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-number.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-number.js index 363d158d7a..ce758e146e 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-number.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-number.js @@ -8,7 +8,7 @@ description: A number as calendar in a property bag is not accepted features: [Temporal] ---*/ -const instance = new Temporal.PlainDate(1976, 11, 18); +const instance = new Temporal.PlainYearMonth(2019, 6); const numbers = [ 1, @@ -16,6 +16,7 @@ const numbers = [ -19970327, 1234567890, ]; + for (const calendar of numbers) { const arg = { year: 2019, monthCode: "M06", calendar }; assert.throws( diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-year-zero.js index 71400ef76d..35789455ba 100644 --- a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.PlainYearMonth(2000, 5); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.until(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..d2f40af228 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/PlainYearMonth/prototype/until/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainyearmonth.prototype.until +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.PlainYearMonth(2000, 5); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.until(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..bf672c3f86 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.timezone.prototype.getinstantfor +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.TimeZone("UTC"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.getInstantFor(arg); + assert.sameValue(result.epochNanoseconds, 217_123_200_000_000_000n, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-propertybag-calendar-year-zero.js index 8065dd55fe..f5cef07a0c 100644 --- a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.TimeZone("UTC"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.getInstantFor(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..5e34035059 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.timezone.prototype.getinstantfor +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.TimeZone("UTC"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.getInstantFor(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/getoffsetnanosecondsfor-maximum-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/getoffsetnanosecondsfor-maximum-forward-offset-shift.js new file mode 100644 index 0000000000..18a309bc43 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/getoffsetnanosecondsfor-maximum-forward-offset-shift.js @@ -0,0 +1,51 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.timezone.prototype.getinstantfor +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants can be at most 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + calls++; + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12 })]; + } +} + +const timeZone = new Shift24Hour(); + +for (const disambiguation of ["earlier", "later", "compatible"]) { + timeZone.getInstantFor(new Temporal.PlainDateTime(1970, 1, 1, 12), { disambiguation }); + + assert(calls >= 2, "getOffsetNanosecondsFor should be called at least twice"); + calls = 0; +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..020151a0d8 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js @@ -0,0 +1,46 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.timezone.prototype.getinstantfor +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +for (const disambiguation of ["earlier", "later", "compatible"]) { + assert.throws(RangeError, () => timeZone.getInstantFor(new Temporal.PlainDateTime(1970, 1, 1, 12), { disambiguation }), "RangeError should be thrown"); +} + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/getpossibleinstantsfor-maximum-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/getpossibleinstantsfor-maximum-backward-offset-shift.js new file mode 100644 index 0000000000..db12836dba --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/getpossibleinstantsfor-maximum-backward-offset-shift.js @@ -0,0 +1,55 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.timezone.prototype.getinstantfor +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + calls++; + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12 }), + utcInstant.add({ hours: 12 }) + ]; + } +} + +const timeZone = new Shift24Hour(); + +for (const disambiguation of ["earlier", "later", "compatible"]) { + timeZone.getInstantFor(new Temporal.PlainDateTime(1970, 1, 1, 12), { disambiguation }); + + assert(calls >= 1, "getPossibleInstantsFor should be called at least once"); + calls = 0; +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/getpossibleinstantsfor-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/getpossibleinstantsfor-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..c8ad86aa14 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getInstantFor/getpossibleinstantsfor-out-of-range-backward-offset-shift.js @@ -0,0 +1,50 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.timezone.prototype.getinstantfor +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +for (const disambiguation of ["earlier", "later", "compatible"]) { + assert.throws(RangeError, () => timeZone.getInstantFor(new Temporal.PlainDateTime(1970, 1, 1, 12), { disambiguation }), "RangeError should be thrown"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getNextTransition/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getNextTransition/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..fd32a4f029 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getNextTransition/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.timezone.prototype.getnexttransition +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.TimeZone("UTC"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.getNextTransition(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getOffsetNanosecondsFor/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getOffsetNanosecondsFor/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..47d9b20d5a --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getOffsetNanosecondsFor/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.timezone.prototype.getoffsetnanosecondsfor +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.TimeZone("UTC"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.getOffsetNanosecondsFor(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getOffsetStringFor/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getOffsetStringFor/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..280857ae31 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getOffsetStringFor/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.timezone.prototype.getoffsetstringfor +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.TimeZone("UTC"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.getOffsetStringFor(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..069c805881 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.timezone.prototype.getplaindatetimefor +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.TimeZone("UTC"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.getPlainDateTimeFor(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/calendar-iso-string.js new file mode 100644 index 0000000000..5f66016904 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/calendar-iso-string.js @@ -0,0 +1,27 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.timezone.prototype.getplaindatetimefor +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.TimeZone("UTC"); + +for (const arg of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const result = instance.getPlainDateTimeFor(new Temporal.Instant(0n), arg); + assert.sameValue(result.getISOFields().calendar, "iso8601", `Calendar created from string "${arg}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..0ffa57e472 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.timezone.prototype.getpossibleinstantsfor +description: An ISO 8601 string can be converted to a calendar ID in Calendar +includes: [compareArray.js] +features: [Temporal] +---*/ + +const instance = new Temporal.TimeZone("UTC"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.getPossibleInstantsFor(arg); + assert.compareArray(result.map(i => i.epochNanoseconds), [217_123_200_000_000_000n], `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-propertybag-calendar-year-zero.js index 0afcf6f978..d112ab2be6 100644 --- a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.TimeZone("UTC"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.getPossibleInstantsFor(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..21cfb938e4 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.timezone.prototype.getpossibleinstantsfor +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.TimeZone("UTC"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.getPossibleInstantsFor(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPreviousTransition/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPreviousTransition/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..96c81db475 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/TimeZone/prototype/getPreviousTransition/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.timezone.prototype.getprevioustransition +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00Z[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00Z[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00Z[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.TimeZone("UTC"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.getPreviousTransition(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..3a440b4994 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,30 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.compare +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const datetime = new Temporal.ZonedDateTime(0n, "UTC"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1970, monthCode: "M01", day: 1, timeZone: "UTC", calendar }; + const result1 = Temporal.ZonedDateTime.compare(arg, datetime); + assert.sameValue(result1, 0, `Calendar created from string "${calendar}" (first argument)`); + const result2 = Temporal.ZonedDateTime.compare(datetime, arg); + assert.sameValue(result2, 0, `Calendar created from string "${calendar}" (second argument)`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..9e09864074 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-out-of-range-backward-offset-shift.js @@ -0,0 +1,51 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.compare +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const arg = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; +const datetime = new Temporal.ZonedDateTime(0n, timeZone); + +assert.throws(RangeError, () => Temporal.ZonedDateTime.compare(arg, datetime), "RangeError should be thrown (first argument)"); +assert.throws(RangeError, () => Temporal.ZonedDateTime.compare(datetime, arg), "RangeError should be thrown (second argument)"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..d2fe4ab99f --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-out-of-range-forward-offset-shift.js @@ -0,0 +1,46 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.compare +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const arg = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; +const datetime = new Temporal.ZonedDateTime(0n, timeZone); + +assert.throws(RangeError, () => Temporal.ZonedDateTime.compare(arg, datetime), "RangeError should be thrown (first argument)"); +assert.throws(RangeError, () => Temporal.ZonedDateTime.compare(datetime, arg), "RangeError should be thrown (second argument)"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/compare/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/compare/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..a3f48aa25a --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/compare/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,32 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.compare +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const datetime = new Temporal.ZonedDateTime(0n, "UTC"); + +const invalidStrings = [ + ["1970-01-01T00:00[UTC][U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[UTC][u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[UTC][FOO=bar]", "invalid capitalized unrecognized key"], +]; + +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => Temporal.ZonedDateTime.compare(arg, datetime), + `annotation keys must be lowercase: ${arg} - ${descr} (first argument)` + ); + assert.throws( + RangeError, + () => Temporal.ZonedDateTime.compare(datetime, arg), + `annotation keys must be lowercase: ${arg} - ${descr} (second argument)` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..ea5074b440 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.from +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const timeZone = new Temporal.TimeZone("UTC"); +const arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar }; + const result = Temporal.ZonedDateTime.from(arg); + assert.sameValue(result.calendarId, "iso8601", `Calendar created from string "${calendar}"`); + assert.sameValue(result.getISOFields().calendar, "iso8601", "calendar slot stores a string"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-year-zero.js index d736edeb21..2741d61844 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => Temporal.ZonedDateTime.from(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..1c4da44c1b --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-out-of-range-backward-offset-shift.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.from +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const arg = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; + +assert.throws(RangeError, () => Temporal.ZonedDateTime.from(arg), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..fad0037aae --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-out-of-range-forward-offset-shift.js @@ -0,0 +1,44 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.from +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const arg = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; + +assert.throws(RangeError, () => Temporal.ZonedDateTime.from(arg), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..1ea7b9aea4 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/from/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,32 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.from +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[UTC][U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[UTC][u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[UTC][FOO=bar]", "invalid capitalized unrecognized key"], +]; + +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => Temporal.ZonedDateTime.from(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); + for (const offset of ["use", "prefer", "ignore", "reject"]) { + assert.throws( + RangeError, + () => Temporal.ZonedDateTime.from(arg, { offset }), + `annotation keys must be lowercase: ${arg} - ${descr} (offset ${offset})` + ); + } +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..4ee800c7bc --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.equals +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +const instance = new Temporal.ZonedDateTime(0n, timeZone); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar }; + const result = instance.equals(arg); + assert.sameValue(result, true, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-year-zero.js index c0230f2f3e..196e992b08 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-year-zero.js @@ -17,7 +17,8 @@ const invalidStrings = [ ]; const timeZone = new Temporal.TimeZone("UTC"); const instance = new Temporal.ZonedDateTime(0n, timeZone); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.equals(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..bf311b856d --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-out-of-range-backward-offset-shift.js @@ -0,0 +1,50 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.equals +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const arg = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +assert.throws(RangeError, () => instance.equals(arg), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..8b27e78eff --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-out-of-range-forward-offset-shift.js @@ -0,0 +1,45 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.equals +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const arg = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +assert.throws(RangeError, () => instance.equals(arg), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..89b0d4d509 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.equals +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[UTC][U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[UTC][u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[UTC][FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.ZonedDateTime(0n, "UTC"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.equals(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/getoffsetnanosecondsfor-maximum-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/getoffsetnanosecondsfor-maximum-forward-offset-shift.js new file mode 100644 index 0000000000..f41e0be158 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/getoffsetnanosecondsfor-maximum-forward-offset-shift.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.hoursinday +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants can be at most 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + calls++; + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12 })]; + } +} + +const timeZone = new Shift24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +instance.hoursInDay; + +assert(calls >= 2, "getOffsetNanosecondsFor should be called at least twice"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..7a41b9456e --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js @@ -0,0 +1,44 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.hoursinday +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +assert.throws(RangeError, () => instance.hoursInDay, "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/getpossibleinstantsfor-maximum-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/getpossibleinstantsfor-maximum-backward-offset-shift.js new file mode 100644 index 0000000000..8312ef765b --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/getpossibleinstantsfor-maximum-backward-offset-shift.js @@ -0,0 +1,53 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.hoursinday +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + calls++; + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12 }), + utcInstant.add({ hours: 12 }) + ]; + } +} + +const timeZone = new Shift24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +instance.hoursInDay; + +assert(calls >= 1, "getPossibleInstantsFor should be called at least once"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/getpossibleinstantsfor-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/getpossibleinstantsfor-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..566b61b2b0 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/getpossibleinstantsfor-out-of-range-backward-offset-shift.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.hoursinday +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +assert.throws(RangeError, () => instance.hoursInDay, "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/div-zero.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/div-zero.js index 776cb7454f..dd912f46d4 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/div-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/div-zero.js @@ -18,10 +18,8 @@ class TimeZone extends Temporal.TimeZone { } } -const units = ["hour", "minute", "second", "millisecond", "microsecond", "nanosecond"]; -for (const smallestUnit of units) { - const zdt = new Temporal.ZonedDateTime(0n, new TimeZone("UTC")); - assert.throws(RangeError, () => zdt.round({ smallestUnit, roundingIncrement: 2 }), `zero day-length with smallestUnit ${smallestUnit}`); -} +const zdt = new Temporal.ZonedDateTime(0n, new TimeZone("UTC")); + +assert.throws(RangeError, () => zdt.round({ smallestUnit: "day" }), `zero day-length with smallestUnit 'day'`); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/getoffsetnanosecondsfor-maximum-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/getoffsetnanosecondsfor-maximum-forward-offset-shift.js new file mode 100644 index 0000000000..1d3a5425d0 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/getoffsetnanosecondsfor-maximum-forward-offset-shift.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.round +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants can be at most 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + calls++; + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12 })]; + } +} + +const timeZone = new Shift24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +instance.round({ smallestUnit: "hours" }); + +assert(calls >= 2, "getOffsetNanosecondsFor should be called at least twice"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/getpossibleinstantsfor-called-with-iso8601-calendar.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/getpossibleinstantsfor-called-with-iso8601-calendar.js index 0c622df167..91c8ec7bc2 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/getpossibleinstantsfor-called-with-iso8601-calendar.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/getpossibleinstantsfor-called-with-iso8601-calendar.js @@ -51,8 +51,8 @@ const nonBuiltinISOCalendar = new Temporal.Calendar("iso8601"); const timeZone = new SkippedDateTime(); const instance = new Temporal.ZonedDateTime(0n, timeZone, nonBuiltinISOCalendar); -instance.round({ smallestUnit: "hours" }); +instance.round({ smallestUnit: "day" }); -assert.sameValue(timeZone.calls, 6, "getPossibleInstantsFor should have been called 6 times"); +assert.sameValue(timeZone.calls, 4, "getPossibleInstantsFor should have been called 4 times"); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/getpossibleinstantsfor-maximum-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/getpossibleinstantsfor-maximum-backward-offset-shift.js new file mode 100644 index 0000000000..0c60d44311 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/getpossibleinstantsfor-maximum-backward-offset-shift.js @@ -0,0 +1,53 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.round +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + calls++; + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12 }), + utcInstant.add({ hours: 12 }) + ]; + } +} + +const timeZone = new Shift24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +instance.round({ smallestUnit: "hours" }); + +assert(calls >= 1, "getPossibleInstantsFor should be called at least once"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/getpossibleinstantsfor-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/getpossibleinstantsfor-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..dabcfe8ed6 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/getpossibleinstantsfor-out-of-range-backward-offset-shift.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.round +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +assert.throws(RangeError, () => instance.round({ smallestUnit: "hours" }), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/order-of-operations.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/order-of-operations.js index 48ca638b39..65fac9036c 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/order-of-operations.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/order-of-operations.js @@ -24,10 +24,6 @@ const expected = [ "get this.timeZone.getPossibleInstantsFor", // GetPlainDateTimeFor on receiver's instant "call this.timeZone.getOffsetNanosecondsFor", - // GetInstantFor on preceding midnight - "call this.timeZone.getPossibleInstantsFor", - // AddDaysToZonedDateTime - "call this.timeZone.getPossibleInstantsFor", // InterpretISODateTimeOffset "call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getOffsetNanosecondsFor", @@ -84,36 +80,8 @@ beforeFallBackInstance.round(nextHourOptions); assert.compareArray(actual, expected, "order of operations with rounding result at repeated wall-clock time"); actual.splice(0); // clear -const expectedSkippedDateTime = [ - "get options.roundingIncrement", - "get options.roundingIncrement.valueOf", - "call options.roundingIncrement.valueOf", - "get options.roundingMode", - "get options.roundingMode.toString", - "call options.roundingMode.toString", - "get options.smallestUnit", - "get options.smallestUnit.toString", - "call options.smallestUnit.toString", - // lookup - "get this.timeZone.getOffsetNanosecondsFor", - "get this.timeZone.getPossibleInstantsFor", - // GetPlainDateTimeFor on receiver's instant - "call this.timeZone.getOffsetNanosecondsFor", - // GetInstantFor on preceding midnight - "call this.timeZone.getPossibleInstantsFor", - // DisambiguatePossibleInstants - "call this.timeZone.getOffsetNanosecondsFor", - "call this.timeZone.getOffsetNanosecondsFor", - "call this.timeZone.getPossibleInstantsFor", - // AddZonedDateTime - "call this.timeZone.getPossibleInstantsFor", - // InterpretISODateTimeOffset - "call this.timeZone.getPossibleInstantsFor", - "call this.timeZone.getOffsetNanosecondsFor", -]; - springForwardInstance.round(options); -assert.compareArray(actual, expectedSkippedDateTime, "order of operations with preceding midnight at skipped wall-clock time"); +assert.compareArray(actual, expected, "order of operations with preceding midnight at skipped wall-clock time"); actual.splice(0); // clear const expectedSkippedResult = [ @@ -131,14 +99,6 @@ const expectedSkippedResult = [ "get this.timeZone.getPossibleInstantsFor", // GetPlainDateTimeFor on receiver's instant "call this.timeZone.getOffsetNanosecondsFor", - // GetInstantFor on preceding midnight - "call this.timeZone.getPossibleInstantsFor", - // AddDaysToZonedDateTime - "call this.timeZone.getPossibleInstantsFor", - // DisambiguatePossibleInstants - "call this.timeZone.getOffsetNanosecondsFor", - "call this.timeZone.getOffsetNanosecondsFor", - "call this.timeZone.getPossibleInstantsFor", // InterpretISODateTimeOffset "call this.timeZone.getPossibleInstantsFor", // DisambiguatePossibleInstants diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/smallest-unit-day-rounding-modes.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/smallest-unit-day-rounding-modes.js index f694712457..435bfa16d8 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/smallest-unit-day-rounding-modes.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/smallest-unit-day-rounding-modes.js @@ -41,21 +41,22 @@ class TimeZone extends Temporal.TimeZone { #count = 0; #nanoseconds; - constructor(nanoseconds) { + constructor(todayEpochNanoseconds, tomorrowEpochNanoseconds) { super("UTC"); - this.#nanoseconds = nanoseconds; + this.#nanoseconds = [todayEpochNanoseconds, tomorrowEpochNanoseconds]; } getPossibleInstantsFor(dateTime) { - if (++this.#count === 2) { - return [new Temporal.Instant(this.#nanoseconds)]; + const nanoseconds = this.#nanoseconds[this.#count++]; + if (nanoseconds === undefined) { + return super.getPossibleInstantsFor(dateTime); } - return super.getPossibleInstantsFor(dateTime); + return [new Temporal.Instant(nanoseconds)]; } } -function test(epochNanoseconds, tomorrowEpochNanoseconds, testCases) { +function test(epochNanoseconds, todayEpochNanoseconds, tomorrowEpochNanoseconds, testCases) { for (let [roundingMode, expected] of Object.entries(testCases)) { - let timeZone = new TimeZone(tomorrowEpochNanoseconds); + let timeZone = new TimeZone(todayEpochNanoseconds, tomorrowEpochNanoseconds); let zoned = new Temporal.ZonedDateTime(epochNanoseconds, timeZone); let result = zoned.round({ smallestUnit: "days", roundingMode }); assert.sameValue(result.epochNanoseconds, expected); @@ -64,31 +65,35 @@ function test(epochNanoseconds, tomorrowEpochNanoseconds, testCases) { const oneDay = 24n * 60n * 60n * 1000n * 1000n * 1000n; -// Test positive divisor (dayLengthNs). -test(3n, 10n, { - ceil: oneDay, +test(3n, undefined, 10n, { + ceil: 10n, // end-of-day according to TimeZone protocol floor: 0n, trunc: 0n, halfExpand: 0n, }); -test(-3n, 10n, { - ceil: 0n, +test(-3n, undefined, 10n, { + ceil: 10n, // end-of-day according to TimeZone protocol floor: -oneDay, trunc: -oneDay, - halfExpand: 0n, + halfExpand: 10n, // end-of-day according to TimeZone protocol }); -test(-3n, -10n, { - ceil: oneDay, - floor: 0n, - trunc: 0n, - halfExpand: 0n, -}); +assert.throws(RangeError, () => { + test(-3n, 0n, 10n, { ceil: undefined }); +}, "instant is before TimeZone protocol's start-of-day"); + +assert.throws(RangeError, () => { + test(-3n, undefined, -10n, { ceil: undefined }); +}, "instant is after TimeZone protocol's end-of-day"); + +assert.throws(RangeError, () => { + test(0n, 0n, 0n, { ceil: undefined }); +}, "instant is within zero-duration day"); // Test values at int64 boundaries. -test(3n, /*INT64_MAX=*/ 9223372036854775807n, { - ceil: oneDay, +test(3n, undefined, /*INT64_MAX=*/ 9223372036854775807n, { + ceil: /*INT64_MAX=*/ 9223372036854775807n, // end-of-day according to TimeZone protocol floor: 0n, trunc: 0n, halfExpand: 0n, diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/timezone-getpossibleinstantsfor-iterable.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/timezone-getpossibleinstantsfor-iterable.js index 922b114e0b..28c064e24d 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/timezone-getpossibleinstantsfor-iterable.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/round/timezone-getpossibleinstantsfor-iterable.js @@ -23,8 +23,6 @@ features: [Temporal] ---*/ const expected = [ - "2001-09-09T00:00:00", // called once on midnight of the input datetime - "2001-09-10T00:00:00", // called once on the previous value plus one calendar day "2001-09-09T02:00:00", // called once on the rounding result ]; diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..6eeb874839 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,30 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.since +description: An ISO 8601 string can be converted to a calendar ID in Calendar +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +const instance = new Temporal.ZonedDateTime(0n, timeZone); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar }; + const result = instance.since(arg); + TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-year-zero.js index 52a3aee0f5..b5dc42f348 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-year-zero.js @@ -17,7 +17,8 @@ const invalidStrings = [ ]; const timeZone = new Temporal.TimeZone("UTC"); const instance = new Temporal.ZonedDateTime(0n, timeZone); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.since(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..c5181e85e0 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-out-of-range-backward-offset-shift.js @@ -0,0 +1,50 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.since +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const arg = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +assert.throws(RangeError, () => instance.since(arg), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..d6f7970e8a --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-out-of-range-forward-offset-shift.js @@ -0,0 +1,45 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.since +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const arg = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +assert.throws(RangeError, () => instance.since(arg), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..5d0053cad5 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,26 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.since +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[UTC][U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[UTC][u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[UTC][FOO=bar]", "invalid capitalized unrecognized key"], +]; +const timeZone = new Temporal.TimeZone("UTC"); +const instance = new Temporal.ZonedDateTime(0n, timeZone); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.since(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/calendar-dateadd-called-with-options-undefined.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/calendar-dateadd-called-with-options-undefined.js index 7a5367bf29..932847c329 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/calendar-dateadd-called-with-options-undefined.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/calendar-dateadd-called-with-options-undefined.js @@ -14,27 +14,17 @@ features: [Temporal] const calendar = TemporalHelpers.calendarDateAddUndefinedOptions(); const timeZone = TemporalHelpers.oneShiftTimeZone(new Temporal.Instant(0n), 3600e9); const earlier = new Temporal.ZonedDateTime(0n, timeZone, calendar); - -// Basic difference with largestUnit larger than days. -// The call comes from this path: -// ZonedDateTime.since() -> DifferenceZonedDateTime -> AddZonedDateTime -> calendar.dateAdd() - -const later1 = new Temporal.ZonedDateTime(1_213_200_000_000_000n, timeZone, calendar); -later1.since(earlier, { largestUnit: "weeks" }); -assert.sameValue(calendar.dateAddCallCount, 1, "basic difference with largestUnit >days"); +const later = new Temporal.ZonedDateTime(1_213_200_000_000_000n, timeZone, calendar); // Difference with rounding, with smallestUnit a calendar unit. // The calls come from these paths: // ZonedDateTime.since() -> -// DifferenceZonedDateTime -> AddZonedDateTime -> calendar.dateAdd() // RoundDuration -> // MoveRelativeZonedDateTime -> AddZonedDateTime -> calendar.dateAdd() // MoveRelativeDate -> calendar.dateAdd() // BalanceDurationRelative -> MoveRelativeDate -> calendar.dateAdd() -calendar.dateAddCallCount = 0; - -later1.since(earlier, { smallestUnit: "weeks" }); -assert.sameValue(calendar.dateAddCallCount, 4, "rounding difference with calendar smallestUnit"); +later.since(earlier, { smallestUnit: "weeks" }); +assert.sameValue(calendar.dateAddCallCount, 3, "rounding difference with calendar smallestUnit"); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/differencezoneddatetime-inconsistent-custom-calendar.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/differencezoneddatetime-inconsistent-custom-calendar.js new file mode 100644 index 0000000000..391f978f0d --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/differencezoneddatetime-inconsistent-custom-calendar.js @@ -0,0 +1,56 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-temporal.zoneddatetime.prototype.since +description: > + Throws a RangeError when custom calendar method returns inconsistent result +info: | + DifferenceZonedDateTime ( ... ) + 8. Repeat 3 times: + ... + g. If _sign_ = 0, or _timeSign_ = 0, or _sign_ = _timeSign_, then + ... + viii. Return ? CreateNormalizedDurationRecord(_dateDifference_.[[Years]], + _dateDifference_.[[Months]], _dateDifference_.[[Weeks]], + _dateDifference_.[[Days]], _norm_). + h. Set _dayCorrection_ to _dayCorrection_ + 1. + 9. NOTE: This step is only reached when custom calendar or time zone methods + return inconsistent values. + 10. Throw a *RangeError* exception. +features: [Temporal] +---*/ + +// Based partly on a test case by André Bargull + +const fiftyDays12Hours = 50n * 86400_000_000_000n + 12n * 3600_000_000_000n; + +{ + const tz = new (class extends Temporal.TimeZone { + getPossibleInstantsFor(dateTime) { + return super.getPossibleInstantsFor(dateTime.subtract({ days: 3 })); + } + })("UTC"); + + const zdt1 = new Temporal.ZonedDateTime(0n, tz); + const zdt2 = new Temporal.ZonedDateTime(fiftyDays12Hours, tz); + + assert.throws(RangeError, () => zdt2.since(zdt1, { largestUnit: "weeks" }), + "Calendar calculation where more than 2 days correction is needed should cause RangeError"); +} + +{ + const cal = new (class extends Temporal.Calendar { + dateUntil(one, two, options) { + return super.dateUntil(one, two, options).negated(); + } + })("iso8601"); + + const zdt1 = new Temporal.ZonedDateTime(0n, "UTC", cal); + const zdt2 = new Temporal.ZonedDateTime(fiftyDays12Hours, "UTC", cal); + + assert.throws(RangeError, () => zdt2.since(zdt1, { largestUnit: "weeks" }), + "Calendar calculation causing mixed-sign values should cause RangeError"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/dst-month-day-boundary.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/dst-month-day-boundary.js new file mode 100644 index 0000000000..c45ebd5aa2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/dst-month-day-boundary.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.since +description: > + Difference with the endpoint being the end of a skipped hour, chooses the + smaller of two possible durations +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +// Based on a test case by Adam Shaw + +const timeZone = TemporalHelpers.springForwardFallBackTimeZone(); + +const d1 = new Temporal.ZonedDateTime(957258000_000_000_000n /* = 2000-05-02T02:00-07:00 */, timeZone); +const d2 = new Temporal.ZonedDateTime(954669600_000_000_000n /* = 2000-04-02T03:00-07:00 */, timeZone); +// NOTE: nonexistent hour just before d2 + +const result = d1.since(d2, { largestUnit: "months" }); + +TemporalHelpers.assertDuration( + result, 0, 0, 0, 29, 23, 0, 0, 0, 0, 0, + "Result should not balance up to months, but pick the smaller of two possible durations" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/dst-rounding-result.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/dst-rounding-result.js new file mode 100644 index 0000000000..c3a0f3f3a2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/dst-rounding-result.js @@ -0,0 +1,48 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-temporal.zoneddatetime.prototype.since +description: > + Rounding the resulting duration takes the time zone's UTC offset shifts + into account +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +// Based on a test case by Adam Shaw + +const timeZone = TemporalHelpers.springForwardFallBackTimeZone(); + +{ + // Month-only part of duration lands on skipped DST hour, should not cause + // disambiguation + const start = new Temporal.ZonedDateTime( + 950868000_000_000_000n /* = 2000-02-18T10Z */, + timeZone); /* = 2000-02-18T02-08 in local time */ + const end = new Temporal.ZonedDateTime( + 954709200_000_000_000n /* = 2000-04-02T21Z */, + timeZone); /* = 2000-04-02T14-07 in local time */ + + const duration = start.since(end, { largestUnit: "months" }); + TemporalHelpers.assertDuration(duration, 0, -1, 0, -15, -11, 0, 0, 0, 0, 0, + "1-month rounding window is shortened by DST"); +} + + +{ + // Month-only part of duration lands on skipped DST hour, should not cause + // disambiguation + const start = new Temporal.ZonedDateTime( + 951991200_000_000_000n /* = 2000-03-02T10Z */, + timeZone); /* = 2000-03-02T02-08 in local time */ + const end = new Temporal.ZonedDateTime( + 956005200_000_000_000n /* = 2000-04-17T21Z */, + timeZone); /* = 2000-04-17T14-07 in local time */ + + const duration = start.since(end, { largestUnit: "months" }); + TemporalHelpers.assertDuration(duration, 0, -1, 0, -15, -12, 0, 0, 0, 0, 0, + "1-month rounding window is not shortened by DST"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/find-intermediate-instant.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/find-intermediate-instant.js new file mode 100644 index 0000000000..7ef187ce3b --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/find-intermediate-instant.js @@ -0,0 +1,84 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-temporal.zoneddatetime.prototype.until +description: > + Up to 3 intermediate instants may be tried when calculating ZonedDateTime + difference +includes: [compareArray.js, temporalHelpers.js] +features: [BigInt, Temporal] +---*/ + +const calls = []; + +const springFallZone = TemporalHelpers.springForwardFallBackTimeZone(); +TemporalHelpers.observeMethod(calls, springFallZone, "getPossibleInstantsFor"); + +const dateLineZone = TemporalHelpers.crossDateLineTimeZone(); +TemporalHelpers.observeMethod(calls, dateLineZone, "getPossibleInstantsFor"); + +const zdt2 = new Temporal.ZonedDateTime(946722600_000_000_000n /* = 2000-01-01T02:30 local */, springFallZone); + +// Future -> past, without wall-clock overshoot +// Expects valid intermediate Instant WITHOUT day correction (computed once) +{ + const zdt1 = new Temporal.ZonedDateTime(949442400_000_000_000n /* = 2000-02-01T14:00 local */, springFallZone); + const result = zdt1.since(zdt2, { largestUnit: "years" }); + TemporalHelpers.assertDuration(result, 0, 1, 0, 0, 11, 30, 0, 0, 0, 0, "no wall-clock overshoot, no DST"); + assert.compareArray(calls, [ + "call getPossibleInstantsFor", // first intermediate in DifferenceZonedDateTime + ], "one intermediate should be tried"); +} + +calls.splice(0); // clear + +// Future -> past, WITH wall-clock overshoot +// Expects valid intermediate Instant with guaranteed 1-DAY correction (computed once) +{ + const zdt1 = new Temporal.ZonedDateTime(949395600_000_000_000n /* = 2000-02-01T01:00 local */, springFallZone); + const result = zdt1.since(zdt2, { largestUnit: "years" }); + TemporalHelpers.assertDuration(result, 0, 0, 0, 30, 22, 30, 0, 0, 0, 0, "wall-clock overshoot, no DST"); + assert.compareArray(calls, [ + "call getPossibleInstantsFor", // first intermediate in DifferenceZonedDateTime + ], "one intermediate should be tried"); +} + +calls.splice(0); // clear + +// Future -> past, WITH wall-clock overshoot +// Expects valid intermediate Instant with guaranteed 1-DAY correction (computed once) +// Intermediate Instant falls within spring DST gap and gets pushed forward, +// but since moving from future -> past, not possible to exacerbate overflow, +// so no other day corrections. +{ + const end = new Temporal.ZonedDateTime(957258000_000_000_000n /* = 2000-05-02T02:00 local */, springFallZone); + const start = new Temporal.ZonedDateTime(954671400_000_000_000n /* = 2000-04-02T03:30-07:00 local */, springFallZone); + const result = end.since(start, { largestUnit: "years" }); + TemporalHelpers.assertDuration(result, 0, 0, 0, 29, 22, 30, 0, 0, 0, 0, "wall-clock overshoot, inconsiquential DST"); + assert.compareArray(calls, [ + "call getPossibleInstantsFor", // first intermediate in DifferenceZonedDateTime + ], "one intermediate should be tried"); +} + +calls.splice(0); // clear + +// Past -> future, WITH wall-clock overshoot +// Tries intermediate Instant with 1-DAY correction (first compute) +// Then, ANOTHER day correction because updated intermediate Instant falls within dateline DST gap, +// pushing it forward, causing wall-clock overshoot again +// (Not possible when going backwards) +// (This test is just the same as the corresponding one in until(), but negative) +{ + const start = new Temporal.ZonedDateTime(1325102400_000_000_000n /* = 2011-12-28T10:00 local */, dateLineZone); + const end = new Temporal.ZonedDateTime(1325257200_000_000_000n /* = 2011-12-31T05:00 local */, dateLineZone); + const result = start.since(end, { largestUnit: "days" }); + TemporalHelpers.assertDuration(result, 0, 0, 0, -1, -19, 0, 0, 0, 0, 0, "wall-clock overshoot, consiquential DST"); + assert.compareArray(calls, [ + "call getPossibleInstantsFor", // first intermediate in DifferenceZonedDateTime + "call getPossibleInstantsFor", // second intermediate in DifferenceZonedDateTime + "call getPossibleInstantsFor", // DisambiguatePossibleInstants on second intermediate + ], "two intermediates should be tried, with disambiguation"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/normalized-time-duration-to-days-loop-arbitrarily.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/normalized-time-duration-to-days-loop-arbitrarily.js index 23f993f25f..454d5d216a 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/normalized-time-duration-to-days-loop-arbitrarily.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/normalized-time-duration-to-days-loop-arbitrarily.js @@ -5,74 +5,42 @@ /*--- esid: sec-temporal.zoneddatetime.prototype.since description: > - NormalizedTimeDurationToDays can loop arbitrarily up to max safe integer + NormalizedTimeDurationToDays should not be able to loop arbitrarily. info: | NormalizedTimeDurationToDays ( norm, zonedRelativeTo, timeZoneRec [ , precalculatedPlainDatetime ] ) ... - 21. Repeat, while done is false, - a. Let oneDayFarther be ? AddDaysToZonedDateTime(relativeResult.[[Instant]], - relativeResult.[[DateTime]], timeZoneRec, zonedRelativeTo.[[Calendar]], sign). - b. Set dayLengthNs to NormalizedTimeDurationFromEpochNanosecondsDifference(oneDayFarther.[[EpochNanoseconds]], - relativeResult.[[EpochNanoseconds]]). - c. Let oneDayLess be ? SubtractNormalizedTimeDuration(norm, dayLengthNs). - c. If NormalizedTimeDurationSign(oneDayLess) × sign ≥ 0, then - i. Set norm to oneDayLess. - ii. Set relativeResult to oneDayFarther. - iii. Set days to days + sign. - d. Else, - i. Set done to true. -includes: [temporalHelpers.js] + 22. If NormalizedTimeDurationSign(_oneDayLess_) × _sign_ ≥ 0, then + a. Set _norm_ to _oneDayLess_. + b. Set _relativeResult_ to _oneDayFarther_. + c. Set _days_ to _days_ + _sign_. + d. Set _oneDayFarther_ to ? AddDaysToZonedDateTime(_relativeResult_.[[Instant]], _relativeResult_.[[DateTime]], _timeZoneRec_, _zonedRelativeTo_.[[Calendar]], _sign_). + e. Set dayLengthNs to NormalizedTimeDurationFromEpochNanosecondsDifference(_oneDayFarther.[[EpochNanoseconds]], relativeResult.[[EpochNanoseconds]]). + f. If NormalizedTimeDurationSign(? SubtractNormalizedTimeDuration(_norm_, _dayLengthNs_)) × _sign_ ≥ 0, then + i. Throw a *RangeError* exception. features: [Temporal] ---*/ -const calls = []; const dayLengthNs = 86400000000000n; -const other = new Temporal.ZonedDateTime(dayLengthNs, "UTC", "iso8601"); - -function createRelativeTo(count) { - const dayInstant = new Temporal.Instant(dayLengthNs); - const substitutions = []; - const timeZone = new Temporal.TimeZone("UTC"); - // Return constant value for first _count_ calls - TemporalHelpers.substituteMethod( - timeZone, - "getPossibleInstantsFor", - substitutions - ); - substitutions.length = count; - let i = 0; - for (i = 0; i < substitutions.length; i++) { - // (this value) - substitutions[i] = [dayInstant]; +const dayInstant = new Temporal.Instant(dayLengthNs); +let calls = 0; +const timeZone = new class extends Temporal.TimeZone { + getPossibleInstantsFor() { + calls++; + return [dayInstant]; } - // Record calls in calls[] - TemporalHelpers.observeMethod(calls, timeZone, "getPossibleInstantsFor"); - return new Temporal.ZonedDateTime(0n, timeZone); -} - -let zdt = createRelativeTo(50); -calls.splice(0); // Reset calls list after ZonedDateTime construction -zdt.since(other, { - largestUnit: "day", -}); -assert.sameValue( - calls.length, - 50 + 1, - "Expected ZonedDateTime.since to call getPossibleInstantsFor correct number of times" -); +}("UTC"); -zdt = createRelativeTo(100); -calls.splice(0); // Reset calls list after previous loop + ZonedDateTime construction -zdt.since(other, { - largestUnit: "day", -}); -assert.sameValue( - calls.length, - 100 + 1, - "Expected ZonedDateTime.since to call getPossibleInstantsFor correct number of times" -); +const zdt = new Temporal.ZonedDateTime(0n, timeZone); +const other = new Temporal.ZonedDateTime(dayLengthNs * 2n, "UTC", "iso8601"); -zdt = createRelativeTo(105); -assert.throws(RangeError, () => zdt.since(other, { largestUnit: "day" }), "105 days > 2⁵³ ns"); +assert.throws(RangeError, () => zdt.since(other, { largestUnit: "day", smallestUnit: "second" }), "indefinite loop is prevented"); +assert.sameValue(calls, 4, "getPossibleInstantsFor is not called indefinitely"); + // Expected calls: + // DifferenceTemporalZonedDateTime -> + // DifferenceZonedDateTime -> GetInstantFor (1) + // NormalizedTimeDurationToDays -> + // AddDaysToZonedDateTime (2, step 12) + // AddDaysToZonedDateTime (3, step 15) + // AddDaysToZonedDateTime (4, step 18.d) reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/normalized-time-duration-to-days-range-errors.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/normalized-time-duration-to-days-range-errors.js index 0c0b07f5dc..a6af0a69bc 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/normalized-time-duration-to-days-range-errors.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/normalized-time-duration-to-days-range-errors.js @@ -8,12 +8,12 @@ description: > RangeErrors. info: | NormalizedTimeDurationToDays ( norm, zonedRelativeTo, timeZoneRec [ , precalculatedPlainDateTime ] ) - 22. If days < 0 and sign = 1, throw a RangeError exception. - 23. If days > 0 and sign = -1, throw a RangeError exception. + 23. If days < 0 and sign = 1, throw a RangeError exception. + 24. If days > 0 and sign = -1, throw a RangeError exception. ... - 25. If NormalizedTimeDurationSign(_norm_) = 1 and sign = -1, throw a RangeError exception. + 26. If NormalizedTimeDurationSign(_norm_) = 1 and sign = -1, throw a RangeError exception. ... - 28. If dayLength ≥ 2⁵³, throw a RangeError exception. + 29. If dayLength ≥ 2⁵³, throw a RangeError exception. features: [Temporal, BigInt] includes: [temporalHelpers.js] ---*/ @@ -40,13 +40,16 @@ const dayNs = 86_400_000_000_000; const zeroZDT = new Temporal.ZonedDateTime(0n, "UTC"); const oneZDT = new Temporal.ZonedDateTime(1n, "UTC"); const epochInstant = new Temporal.Instant(0n); -const options = { largestUnit: "days" }; +const options = { largestUnit: "days", smallestUnit: "seconds", roundingMode: "expand" }; -// Step 22: days < 0 and sign = 1 +// Step 23: days < 0 and sign = 1 let start = new Temporal.ZonedDateTime( 0n, // Sets DifferenceZonedDateTime _ns1_ timeZoneSubstituteValues( - [[epochInstant]], // Returned in step 16, setting _relativeResult_ + [ + TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally in DifferenceZonedDateTime + [epochInstant], // Returned in step 16, setting _relativeResult_ + ], [ // Behave normally in 2 calls made prior to NormalizedTimeDurationToDays TemporalHelpers.SUBSTITUTE_SKIP, @@ -60,14 +63,18 @@ assert.throws(RangeError, () => start.since( oneZDT, // Sets DifferenceZonedDateTime _ns2_ options - ) + ), + "days < 0 and sign = 1" ); -// Step 23: days > 0 and sign = -1 +// Step 24: days > 0 and sign = -1 start = new Temporal.ZonedDateTime( 1n, // Sets DifferenceZonedDateTime _ns1_ timeZoneSubstituteValues( - [[epochInstant]], // Returned in step 16, setting _relativeResult_ + [ + TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally in DifferenceZonedDateTime + [epochInstant], // Returned in step 16, setting _relativeResult_ + ], [ // Behave normally in 2 calls made prior to NormalizedTimeDurationToDays TemporalHelpers.SUBSTITUTE_SKIP, @@ -81,14 +88,18 @@ assert.throws(RangeError, () => start.since( zeroZDT, // Sets DifferenceZonedDateTime _ns2_ options - ) + ), + "days > 0 and sign = -1" ); -// Step 25: nanoseconds > 0 and sign = -1 +// Step 26: nanoseconds > 0 and sign = -1 start = new Temporal.ZonedDateTime( 1n, // Sets DifferenceZonedDateTime _ns1_ timeZoneSubstituteValues( - [[new Temporal.Instant(-1n)]], // Returned in step 16, setting _relativeResult_ + [ + TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally in DifferenceZonedDateTime + [new Temporal.Instant(-2_000_000_000n)], // Returned in step 16, setting _relativeResult_ + ], [ // Behave normally in 2 calls made prior to NormalizedTimeDurationToDays TemporalHelpers.SUBSTITUTE_SKIP, @@ -102,16 +113,20 @@ assert.throws(RangeError, () => start.since( zeroZDT, // Sets DifferenceZonedDateTime _ns2_ options - ) + ), + "norm > 0 and sign = -1" ); -// Step 28: day length is an unsafe integer +// Step 29: day length is an unsafe integer start = new Temporal.ZonedDateTime( 0n, timeZoneSubstituteValues( - // Not called in step 16 because _days_ = 0 - // Returned in step 21.a, making _oneDayFarther_ 2^53 ns later than _relativeResult_ - [[new Temporal.Instant(2n ** 53n)]], + [ + TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally in DifferenceZonedDateTime + // Not called in step 16 because _days_ = 0 + // Returned in step 19, making _oneDayFarther_ 2^53 ns later than _relativeResult_ + [new Temporal.Instant(2n ** 53n)], + ], [] ) ); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/order-of-operations.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/order-of-operations.js index 566a1ce192..90fc1e0475 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/order-of-operations.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/order-of-operations.js @@ -306,10 +306,6 @@ assert.compareArray(actual, [ // DifferenceZonedDateTime "call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor", - // NanosecondsToDays - "call this.timeZone.getOffsetNanosecondsFor", - "call this.timeZone.getOffsetNanosecondsFor", - // NanosecondsToDays → AddDaysToZonedDateTime "call this.timeZone.getPossibleInstantsFor", ], "order of operations with identical wall-clock times and largestUnit a calendar unit"); actual.splice(0); // clear @@ -328,17 +324,8 @@ const expectedOpsForCalendarDifference = [ "call this.timeZone.getOffsetNanosecondsFor", // DifferenceZonedDateTime "call this.timeZone.getOffsetNanosecondsFor", - // DifferenceISODateTime - "call this.calendar.dateUntil", - // AddZonedDateTime - "call this.calendar.dateAdd", - "call this.timeZone.getPossibleInstantsFor", - // NanosecondsToDays - "call this.timeZone.getOffsetNanosecondsFor", - "call this.timeZone.getOffsetNanosecondsFor", - // NanosecondsToDays → AddDaysToZonedDateTime - "call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor", + "call this.calendar.dateUntil", ]; const expectedOpsForCalendarRounding = [ diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/wrapping-at-end-of-month.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/wrapping-at-end-of-month.js new file mode 100644 index 0000000000..3fddf0d09b --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/since/wrapping-at-end-of-month.js @@ -0,0 +1,120 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.since +description: Tests balancing of days to months at end of month +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +// Difference between end of longer month to end of following shorter month +{ + const end = new Temporal.ZonedDateTime(5011200_000_000_000n /* = 1970-02-28T00Z */, "UTC"); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(2332800_000_000_000n /* = 1970-01-28T00Z */, "UTC").since(end, { largestUnit }), + 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, + "Jan 28th to Feb 28th is one month" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(2419200_000_000_000n /* = 1970-01-29T00Z */, "UTC").since(end, { largestUnit }), + 0, 0, 0, -30, 0, 0, 0, 0, 0, 0, + "Jan 29th to Feb 28th is 30 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(2505600_000_000_000n /* = 1970-01-30T00Z */, "UTC").since(end, { largestUnit }), + 0, 0, 0, -29, 0, 0, 0, 0, 0, 0, + "Jan 30th to Feb 28th is 29 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(2592000_000_000_000n /* = 1970-01-31T00Z */, "UTC").since(end, { largestUnit }), + 0, 0, 0, -28, 0, 0, 0, 0, 0, 0, + "Jan 31st to Feb 28th is 28 days, not one month" + ); + } +} + +// Difference between end of leap-year January to end of leap-year February +{ + const end = new Temporal.ZonedDateTime(68169600_000_000_000n /* = 1972-02-29T00Z */, "UTC"); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(65491200_000_000_000n /* = 1972-01-29T00Z */, "UTC").since(end, { largestUnit }), + 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, + "Jan 29th to Feb 29th is one month" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(65577600_000_000_000n /* = 1972-01-30T00Z */, "UTC").since(end, { largestUnit }), + 0, 0, 0, -30, 0, 0, 0, 0, 0, 0, + "Jan 30th to Feb 29th is 30 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(65664000_000_000_000n /* = 1972-01-31T00Z */, "UTC").since(end, { largestUnit }), + 0, 0, 0, -29, 0, 0, 0, 0, 0, 0, + "Jan 31st to Feb 29th is 29 days, not one month" + ); + } +} + +// Difference between end of longer month to end of not-immediately-following +// shorter month +{ + const end = new Temporal.ZonedDateTime(28771200_000_000_000n /* = 1970-11-30T00Z */, "UTC"); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(20822400_000_000_000n /* = 1970-08-30T00Z */, "UTC").since(end, { largestUnit }), + 0, -3, 0, 0, 0, 0, 0, 0, 0, 0, + "Aug 30th to Nov 30th is 3 months" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(20908800_000_000_000n /* = 1970-08-31T00Z */, "UTC").since(end, { largestUnit }), + 0, -2, 0, -30, 0, 0, 0, 0, 0, 0, + "Aug 31st to Nov 30th is 2 months 30 days, not 3 months" + ); + } +} + +// Difference between end of longer month in one year to shorter month in +// later year +{ + const end = new Temporal.ZonedDateTime(104976000_000_000_000n /* = 1973-04-30T00Z */, "UTC"); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(31363200_000_000_000n /* = 1970-12-30T00Z */, "UTC").since(end, { largestUnit: "months" }), + 0, -28, 0, 0, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 28 months" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(31363200_000_000_000n /* = 1970-12-30T00Z */, "UTC").since(end, { largestUnit: "years" }), + -2, -4, 0, 0, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 2 years, 4 months" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(31449600_000_000_000n /* = 1970-12-31T00Z */, "UTC").since(end, { largestUnit: "months" }), + 0, -27, 0, -30, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 27 months, 30 days, not 28 months" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(31449600_000_000_000n /* = 1970-12-31T00Z */, "UTC").since(end, { largestUnit: "years" }), + -2, -3, 0, -30, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 2 years, 3 months, 30 days, not 2 years 4 months" + ); +} + +// Difference where months passes through a month that's the same length or +// shorter than either the start or end month +{ + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(2419200_000_000_000n /* = 1970-01-29T00Z */, "UTC").since(new Temporal.ZonedDateTime(7430400_000_000_000n /* = 1970-03-28T00Z */, "UTC"), { largestUnit: "months" }), + 0, -1, 0, -28, 0, 0, 0, 0, 0, 0, + "Jan 29th to Mar 28th is 1 month 28 days, not 58 days" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(2592000_000_000_000n /* = 1970-01-31T00Z */, "UTC").since(new Temporal.ZonedDateTime(44409600_000_000_000n /* = 1971-05-30T00Z */, "UTC"), { largestUnit: "years" }), + -1, -3, 0, -30, 0, 0, 0, 0, 0, 0, + "Jan 31st 1970 to May 30th 1971 is 1 year, 3 months, 30 days, not 1 year, 2 months, 60 days" + ); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/getoffsetnanosecondsfor-maximum-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/getoffsetnanosecondsfor-maximum-forward-offset-shift.js new file mode 100644 index 0000000000..d71f6be08e --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/getoffsetnanosecondsfor-maximum-forward-offset-shift.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.startofday +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants can be at most 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 0n + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + calls++; + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12 })]; + } +} + +const timeZone = new Shift24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +instance.startOfDay(); + +assert(calls >= 2, "getOffsetNanosecondsFor should be called at least twice"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..82e86c4ee5 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js @@ -0,0 +1,44 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.startofday +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 0n + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +assert.throws(RangeError, () => instance.startOfDay(), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/getpossibleinstantsfor-maximum-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/getpossibleinstantsfor-maximum-backward-offset-shift.js new file mode 100644 index 0000000000..f1342dfe2d --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/getpossibleinstantsfor-maximum-backward-offset-shift.js @@ -0,0 +1,53 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.startofday +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + calls++; + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12 }), + utcInstant.add({ hours: 12 }) + ]; + } +} + +const timeZone = new Shift24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +instance.startOfDay(); + +assert(calls >= 1, "getPossibleInstantsFor should be called at least once"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/getpossibleinstantsfor-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/getpossibleinstantsfor-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..06055c287e --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/getpossibleinstantsfor-out-of-range-backward-offset-shift.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.startofday +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +assert.throws(RangeError, () => instance.startOfDay(), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..b01b28a4bd --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,30 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.until +description: An ISO 8601 string can be converted to a calendar ID in Calendar +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +const instance = new Temporal.ZonedDateTime(0n, timeZone); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar }; + const result = instance.until(arg); + TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-year-zero.js index f0c915198e..f69f22d2b8 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-year-zero.js @@ -17,7 +17,8 @@ const invalidStrings = [ ]; const timeZone = new Temporal.TimeZone("UTC"); const instance = new Temporal.ZonedDateTime(0n, timeZone); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.until(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..bf1b4089f0 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-out-of-range-backward-offset-shift.js @@ -0,0 +1,50 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.until +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const arg = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +assert.throws(RangeError, () => instance.until(arg), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..891307c99d --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-out-of-range-forward-offset-shift.js @@ -0,0 +1,45 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.until +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); +const arg = { year: 1970, month: 1, day: 1, hour: 12, timeZone }; + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +assert.throws(RangeError, () => instance.until(arg), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..7226f0cb8c --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,26 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.until +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01T00:00[UTC][U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01T00:00[UTC][u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01T00:00[UTC][FOO=bar]", "invalid capitalized unrecognized key"], +]; +const timeZone = new Temporal.TimeZone("UTC"); +const instance = new Temporal.ZonedDateTime(0n, timeZone); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.until(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/calendar-dateadd-called-with-options-undefined.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/calendar-dateadd-called-with-options-undefined.js index 5710b9c2b4..14a26aa8ef 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/calendar-dateadd-called-with-options-undefined.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/calendar-dateadd-called-with-options-undefined.js @@ -14,27 +14,17 @@ features: [Temporal] const calendar = TemporalHelpers.calendarDateAddUndefinedOptions(); const timeZone = TemporalHelpers.oneShiftTimeZone(new Temporal.Instant(0n), 3600e9); const earlier = new Temporal.ZonedDateTime(0n, timeZone, calendar); - -// Basic difference with largestUnit larger than days. -// The call comes from this path: -// ZonedDateTime.until() -> DifferenceZonedDateTime -> AddZonedDateTime -> calendar.dateAdd() - -const later1 = new Temporal.ZonedDateTime(1_213_200_000_000_000n, timeZone, calendar); -earlier.until(later1, { largestUnit: "weeks" }); -assert.sameValue(calendar.dateAddCallCount, 1, "basic difference with largestUnit >days"); +const later = new Temporal.ZonedDateTime(1_213_200_000_000_000n, timeZone, calendar); // Difference with rounding, with smallestUnit a calendar unit. // The calls come from these paths: // ZonedDateTime.until() -> -// DifferenceZonedDateTime -> AddZonedDateTime -> calendar.dateAdd() // RoundDuration -> // MoveRelativeZonedDateTime -> AddZonedDateTime -> calendar.dateAdd() // MoveRelativeDate -> calendar.dateAdd() // BalanceDurationRelative -> MoveRelativeDate -> calendar.dateAdd() -calendar.dateAddCallCount = 0; - -earlier.until(later1, { smallestUnit: "weeks" }); -assert.sameValue(calendar.dateAddCallCount, 4, "rounding difference with calendar smallestUnit"); +earlier.until(later, { smallestUnit: "weeks" }); +assert.sameValue(calendar.dateAddCallCount, 3, "rounding difference with calendar smallestUnit"); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/differencezoneddatetime-inconsistent-custom-calendar.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/differencezoneddatetime-inconsistent-custom-calendar.js new file mode 100644 index 0000000000..7b77608492 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/differencezoneddatetime-inconsistent-custom-calendar.js @@ -0,0 +1,56 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-temporal.zoneddatetime.prototype.until +description: > + Throws a RangeError when custom calendar method returns inconsistent result +info: | + DifferenceZonedDateTime ( ... ) + 8. Repeat 3 times: + ... + g. If _sign_ = 0, or _timeSign_ = 0, or _sign_ = _timeSign_, then + ... + viii. Return ? CreateNormalizedDurationRecord(_dateDifference_.[[Years]], + _dateDifference_.[[Months]], _dateDifference_.[[Weeks]], + _dateDifference_.[[Days]], _norm_). + h. Set _dayCorrection_ to _dayCorrection_ + 1. + 9. NOTE: This step is only reached when custom calendar or time zone methods + return inconsistent values. + 10. Throw a *RangeError* exception. +features: [Temporal] +---*/ + +// Based partly on a test case by André Bargull + +const fiftyDays12Hours = 50n * 86400_000_000_000n + 12n * 3600_000_000_000n; + +{ + const tz = new (class extends Temporal.TimeZone { + getPossibleInstantsFor(dateTime) { + return super.getPossibleInstantsFor(dateTime.add({ days: 3 })); + } + })("UTC"); + + const zdt1 = new Temporal.ZonedDateTime(0n, tz); + const zdt2 = new Temporal.ZonedDateTime(fiftyDays12Hours, tz); + + assert.throws(RangeError, () => zdt1.until(zdt2, { largestUnit: "weeks" }), + "Calendar calculation where more than 2 days correction is needed should cause RangeError"); +} + +{ + const cal = new (class extends Temporal.Calendar { + dateUntil(one, two, options) { + return super.dateUntil(one, two, options).negated(); + } + })("iso8601"); + + const zdt1 = new Temporal.ZonedDateTime(0n, "UTC", cal); + const zdt2 = new Temporal.ZonedDateTime(fiftyDays12Hours, "UTC", cal); + + assert.throws(RangeError, () => zdt1.until(zdt2, { largestUnit: "weeks" }), + "Calendar calculation causing mixed-sign values should cause RangeError"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/dst-month-day-boundary.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/dst-month-day-boundary.js new file mode 100644 index 0000000000..73596e06c5 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/dst-month-day-boundary.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.until +description: > + Difference with the endpoint being the end of a skipped hour, chooses the + smaller of two possible durations +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +// Based on a test case by Adam Shaw + +const timeZone = TemporalHelpers.springForwardFallBackTimeZone(); + +const d1 = new Temporal.ZonedDateTime(957258000_000_000_000n /* = 2000-05-02T02:00-07:00 */, timeZone); +const d2 = new Temporal.ZonedDateTime(954669600_000_000_000n /* = 2000-04-02T03:00-07:00 */, timeZone); +// NOTE: nonexistent hour just before d2 + +const result = d1.until(d2, { largestUnit: "months" }); + +TemporalHelpers.assertDuration( + result, 0, 0, 0, -29, -23, 0, 0, 0, 0, 0, + "Result should not balance up to months, but pick the smaller of two possible durations" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/dst-rounding-result.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/dst-rounding-result.js new file mode 100644 index 0000000000..e6faed63f3 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/dst-rounding-result.js @@ -0,0 +1,48 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-temporal.zoneddatetime.prototype.until +description: > + Rounding the resulting duration takes the time zone's UTC offset shifts + into account +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +// Based on a test case by Adam Shaw + +const timeZone = TemporalHelpers.springForwardFallBackTimeZone(); + +{ + // Month-only part of duration lands on skipped DST hour, should not cause + // disambiguation + const start = new Temporal.ZonedDateTime( + 950868000_000_000_000n /* = 2000-02-18T10Z */, + timeZone); /* = 2000-02-18T02-08 in local time */ + const end = new Temporal.ZonedDateTime( + 954709200_000_000_000n /* = 2000-04-02T21Z */, + timeZone); /* = 2000-04-02T14-07 in local time */ + + const duration = start.until(end, { largestUnit: "months" }); + TemporalHelpers.assertDuration(duration, 0, 1, 0, 15, 11, 0, 0, 0, 0, 0, + "1-month rounding window is shortened by DST"); +} + + +{ + // Month-only part of duration lands on skipped DST hour, should not cause + // disambiguation + const start = new Temporal.ZonedDateTime( + 951991200_000_000_000n /* = 2000-03-02T10Z */, + timeZone); /* = 2000-03-02T02-08 in local time */ + const end = new Temporal.ZonedDateTime( + 956005200_000_000_000n /* = 2000-04-17T21Z */, + timeZone); /* = 2000-04-17T14-07 in local time */ + + const duration = start.until(end, { largestUnit: "months" }); + TemporalHelpers.assertDuration(duration, 0, 1, 0, 15, 12, 0, 0, 0, 0, 0, + "1-month rounding window is not shortened by DST"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/find-intermediate-instant.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/find-intermediate-instant.js new file mode 100644 index 0000000000..9440f950a6 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/find-intermediate-instant.js @@ -0,0 +1,85 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-temporal.zoneddatetime.prototype.until +description: > + Up to 3 intermediate instants may be tried when calculating ZonedDateTime + difference +includes: [compareArray.js, temporalHelpers.js] +features: [BigInt, Temporal] +---*/ + +const calls = []; + +const springFallZone = TemporalHelpers.springForwardFallBackTimeZone(); +TemporalHelpers.observeMethod(calls, springFallZone, "getPossibleInstantsFor"); + +const dateLineZone = TemporalHelpers.crossDateLineTimeZone(); +TemporalHelpers.observeMethod(calls, dateLineZone, "getPossibleInstantsFor"); + +const zdt1 = new Temporal.ZonedDateTime(946722600_000_000_000n /* = 2000-01-01T02:30 local */, springFallZone); + +// Past -> future, without wall-clock overshoot +// Expects valid intermediate Instant WITHOUT day correction (computed once) +{ + const zdt2 = new Temporal.ZonedDateTime(949442400_000_000_000n /* = 2000-02-01T14:00 local */, springFallZone); + const result = zdt1.until(zdt2, { largestUnit: "years" }); + TemporalHelpers.assertDuration(result, 0, 1, 0, 0, 11, 30, 0, 0, 0, 0, "no wall-clock overshoot, no DST"); + assert.compareArray(calls, [ + "call getPossibleInstantsFor", // first intermediate in DifferenceZonedDateTime + ], "one intermediate should be tried"); +} + +calls.splice(0); // clear + +// Past -> future, WITH wall-clock overshoot +// Expects valid intermediate Instant with guaranteed 1-DAY correction (computed once) +{ + const zdt2 = new Temporal.ZonedDateTime(949395600_000_000_000n /* = 2000-02-01T01:00 local */, springFallZone); + const result = zdt1.until(zdt2, { largestUnit: "years" }); + TemporalHelpers.assertDuration(result, 0, 0, 0, 30, 22, 30, 0, 0, 0, 0, "wall-clock overshoot, no DST"); + assert.compareArray(calls, [ + "call getPossibleInstantsFor", // first intermediate in DifferenceZonedDateTime + ], "one intermediate should be tried"); +} + +calls.splice(0); // clear + +// Past -> future, WITH wall-clock overshoot +// Tries intermediate Instant with 1-DAY correction (first compute) +// Then, ANOTHER correction because updated intermediate Instant falls within spring DST gap, +// pushing it forward, causing wall-clock overshoot again +// (Not possible when going backwards) +{ + const zdt2 = new Temporal.ZonedDateTime(954669600_000_000_000n /* = 2000-04-02T02:00 local */, springFallZone); + const result = zdt1.until(zdt2, { largestUnit: "years" }); + TemporalHelpers.assertDuration(result, 0, 3, 0, 0, 23, 30, 0, 0, 0, 0, "wall-clock overshoot, small consiquential DST"); + assert.compareArray(calls, [ + "call getPossibleInstantsFor", // first intermediate in DifferenceZonedDateTime + "call getPossibleInstantsFor", // DisambiguatePossibleInstants on first intermediate + "call getPossibleInstantsFor", // second intermediate in DifferenceZonedDateTime + ], "two intermediates should be tried, with disambiguation"); +} + +calls.splice(0); // clear + +// Past -> future, WITH wall-clock overshoot +// Tries intermediate Instant with 1-DAY correction (first compute) +// Then, ANOTHER correction because updated intermediate Instant falls within dateline DST gap, +// pushing it forward, causing wall-clock overshoot again +// (Not possible when going backwards) +// (This test is just the same as the corresponding one in since(), but negative) +{ + const start = new Temporal.ZonedDateTime(1325102400_000_000_000n /* = 2011-12-28T10:00 local */, dateLineZone); + const end = new Temporal.ZonedDateTime(1325257200_000_000_000n /* = 2011-12-31T05:00 local */, dateLineZone); + const result = start.until(end, { largestUnit: "days" }); + TemporalHelpers.assertDuration(result, 0, 0, 0, 1, 19, 0, 0, 0, 0, 0, "wall-clock overshoot, big consiquential DST"); + assert.compareArray(calls, [ + "call getPossibleInstantsFor", // first intermediate in DifferenceZonedDateTime + "call getPossibleInstantsFor", // second intermediate in DifferenceZonedDateTime + "call getPossibleInstantsFor", // DisambiguatePossibleInstants on second intermediate + ], "two intermediates should be tried, with disambiguation"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/normalized-time-duration-to-days-loop-arbitrarily.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/normalized-time-duration-to-days-loop-arbitrarily.js index f057d733d9..77886a2042 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/normalized-time-duration-to-days-loop-arbitrarily.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/normalized-time-duration-to-days-loop-arbitrarily.js @@ -5,74 +5,42 @@ /*--- esid: sec-temporal.zoneddatetime.prototype.until description: > - NormalizedTimeDurationToDays can loop arbitrarily up to max safe integer + NormalizedTimeDurationToDays should not be able to loop arbitrarily. info: | NormalizedTimeDurationToDays ( norm, zonedRelativeTo, timeZoneRec [ , precalculatedPlainDatetime ] ) ... - 21. Repeat, while done is false, - a. Let oneDayFarther be ? AddDaysToZonedDateTime(relativeResult.[[Instant]], - relativeResult.[[DateTime]], timeZoneRec, zonedRelativeTo.[[Calendar]], sign). - b. Set dayLengthNs to NormalizedTimeDurationFromEpochNanosecondsDifference(oneDayFarther.[[EpochNanoseconds]], - relativeResult.[[EpochNanoseconds]]). - c. Let oneDayLess be ? SubtractNormalizedTimeDuration(norm, dayLengthNs). - c. If NormalizedTimeDurationSign(oneDayLess) × sign ≥ 0, then - i. Set norm to oneDayLess. - ii. Set relativeResult to oneDayFarther. - iii. Set days to days + sign. - d. Else, - i. Set done to true. -includes: [temporalHelpers.js] + 22. If NormalizedTimeDurationSign(_oneDayLess_) × _sign_ ≥ 0, then + a. Set _norm_ to _oneDayLess_. + b. Set _relativeResult_ to _oneDayFarther_. + c. Set _days_ to _days_ + _sign_. + d. Set _oneDayFarther_ to ? AddDaysToZonedDateTime(_relativeResult_.[[Instant]], _relativeResult_.[[DateTime]], _timeZoneRec_, _zonedRelativeTo_.[[Calendar]], _sign_). + e. Set dayLengthNs to NormalizedTimeDurationFromEpochNanosecondsDifference(_oneDayFarther.[[EpochNanoseconds]], relativeResult.[[EpochNanoseconds]]). + f. If NormalizedTimeDurationSign(? SubtractNormalizedTimeDuration(_norm_, _dayLengthNs_)) × _sign_ ≥ 0, then + i. Throw a *RangeError* exception. features: [Temporal] ---*/ -const calls = []; const dayLengthNs = 86400000000000n; -const other = new Temporal.ZonedDateTime(dayLengthNs, "UTC", "iso8601"); - -function createRelativeTo(count) { - const dayInstant = new Temporal.Instant(dayLengthNs); - const substitutions = []; - const timeZone = new Temporal.TimeZone("UTC"); - // Return constant value for first _count_ calls - TemporalHelpers.substituteMethod( - timeZone, - "getPossibleInstantsFor", - substitutions - ); - substitutions.length = count; - let i = 0; - for (i = 0; i < substitutions.length; i++) { - // (this value) - substitutions[i] = [dayInstant]; +const dayInstant = new Temporal.Instant(dayLengthNs); +let calls = 0; +const timeZone = new class extends Temporal.TimeZone { + getPossibleInstantsFor() { + calls++; + return [dayInstant]; } - // Record calls in calls[] - TemporalHelpers.observeMethod(calls, timeZone, "getPossibleInstantsFor"); - return new Temporal.ZonedDateTime(0n, timeZone); -} - -let zdt = createRelativeTo(50); -calls.splice(0); // Reset calls list after ZonedDateTime construction -zdt.until(other, { - largestUnit: "day", -}); -assert.sameValue( - calls.length, - 50 + 1, - "Expected ZonedDateTime.until to call getPossibleInstantsFor correct number of times" -); +}("UTC"); -zdt = createRelativeTo(100); -calls.splice(0); // Reset calls list after previous loop + ZonedDateTime construction -zdt.until(other, { - largestUnit: "day", -}); -assert.sameValue( - calls.length, - 100 + 1, - "Expected ZonedDateTime.until to call getPossibleInstantsFor correct number of times" -); +const zdt = new Temporal.ZonedDateTime(0n, timeZone); +const other = new Temporal.ZonedDateTime(dayLengthNs * 2n, "UTC", "iso8601"); -zdt = createRelativeTo(105); -assert.throws(RangeError, () => zdt.until(other, { largestUnit: "day" }), "105 days > 2⁵³ ns"); +assert.throws(RangeError, () => zdt.until(other, { largestUnit: "day", smallestUnit: "second" }), "indefinite loop is prevented"); +assert.sameValue(calls, 4, "getPossibleInstantsFor is not called indefinitely"); + // Expected calls: + // DifferenceTemporalZonedDateTime -> + // DifferenceZonedDateTime -> GetInstantFor (1) + // NormalizedTimeDurationToDays -> + // AddDaysToZonedDateTime (2, step 12) + // AddDaysToZonedDateTime (3, step 15) + // AddDaysToZonedDateTime (4, step 18.d) reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/normalized-time-duration-to-days-range-errors.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/normalized-time-duration-to-days-range-errors.js index 178b1c981b..479dcf0b0c 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/normalized-time-duration-to-days-range-errors.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/normalized-time-duration-to-days-range-errors.js @@ -8,12 +8,12 @@ description: > RangeErrors. info: | NormalizedTimeDurationToDays ( norm, zonedRelativeTo, timeZoneRec [ , precalculatedPlainDateTime ] ) - 22. If days < 0 and sign = 1, throw a RangeError exception. - 23. If days > 0 and sign = -1, throw a RangeError exception. + 23. If days < 0 and sign = 1, throw a RangeError exception. + 24. If days > 0 and sign = -1, throw a RangeError exception. ... - 25. If NormalizedTimeDurationSign(_norm_) = 1 and sign = -1, throw a RangeError exception. + 26. If NormalizedTimeDurationSign(_norm_) = 1 and sign = -1, throw a RangeError exception. ... - 28. If dayLength ≥ 2⁵³, throw a RangeError exception. + 29. If dayLength ≥ 2⁵³, throw a RangeError exception. features: [Temporal, BigInt] includes: [temporalHelpers.js] ---*/ @@ -40,13 +40,16 @@ const dayNs = 86_400_000_000_000; const zeroZDT = new Temporal.ZonedDateTime(0n, "UTC"); const oneZDT = new Temporal.ZonedDateTime(1n, "UTC"); const epochInstant = new Temporal.Instant(0n); -const options = { largestUnit: "days" }; +const options = { largestUnit: "days", smallestUnit: "seconds", roundingMode: "expand" }; -// Step 22: days < 0 and sign = 1 +// Step 23: days < 0 and sign = 1 let start = new Temporal.ZonedDateTime( 0n, // Sets DifferenceZonedDateTime _ns1_ timeZoneSubstituteValues( - [[epochInstant]], // Returned in step 16, setting _relativeResult_ + [ + TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally in DifferenceZonedDateTime + [epochInstant], // Returned in step 16, setting _relativeResult_ + ], [ // Behave normally in 2 calls made prior to NormalizedTimeDurationToDays TemporalHelpers.SUBSTITUTE_SKIP, @@ -60,14 +63,18 @@ assert.throws(RangeError, () => start.until( oneZDT, // Sets DifferenceZonedDateTime _ns2_ options - ) + ), + "days < 0 and sign = 1" ); -// Step 23: days > 0 and sign = -1 +// Step 24: days > 0 and sign = -1 start = new Temporal.ZonedDateTime( 1n, // Sets DifferenceZonedDateTime _ns1_ timeZoneSubstituteValues( - [[epochInstant]], // Returned in step 16, setting _relativeResult_ + [ + TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally in DifferenceZonedDateTime + [epochInstant], // Returned in step 16, setting _relativeResult_ + ], [ // Behave normally in 2 calls made prior to NormalizedTimeDurationToDays TemporalHelpers.SUBSTITUTE_SKIP, @@ -81,14 +88,18 @@ assert.throws(RangeError, () => start.until( zeroZDT, // Sets DifferenceZonedDateTime _ns2_ options - ) + ), + "days > 0 and sign = -1" ); -// Step 25: nanoseconds > 0 and sign = -1 +// Step 26: nanoseconds > 0 and sign = -1 start = new Temporal.ZonedDateTime( 1n, // Sets DifferenceZonedDateTime _ns1_ timeZoneSubstituteValues( - [[new Temporal.Instant(-1n)]], // Returned in step 16, setting _relativeResult_ + [ + TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally in DifferenceZonedDateTime + [new Temporal.Instant(-2_000_000_000n)], // Returned in step 16, setting _relativeResult_ + ], [ // Behave normally in 2 calls made prior to NormalizedTimeDurationToDays TemporalHelpers.SUBSTITUTE_SKIP, @@ -102,16 +113,20 @@ assert.throws(RangeError, () => start.until( zeroZDT, // Sets DifferenceZonedDateTime _ns2_ options - ) + ), + "norm > 0 and sign = -1" ); -// Step 28: day length is an unsafe integer +// Step 29: day length is an unsafe integer start = new Temporal.ZonedDateTime( 0n, timeZoneSubstituteValues( - // Not called in step 16 because _days_ = 0 - // Returned in step 21.a, making _oneDayFarther_ 2^53 ns later than _relativeResult_ - [[new Temporal.Instant(2n ** 53n)]], + [ + TemporalHelpers.SUBSTITUTE_SKIP, // Behave normally in DifferenceZonedDateTime + // Not called in step 16 because _days_ = 0 + // Returned in step 19, making _oneDayFarther_ 2^53 ns later than _relativeResult_ + [new Temporal.Instant(2n ** 53n)], + ], [] ) ); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/order-of-operations.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/order-of-operations.js index 6a233dc989..c88ecfd0d6 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/order-of-operations.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/order-of-operations.js @@ -306,10 +306,6 @@ assert.compareArray(actual, [ // DifferenceZonedDateTime "call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor", - // NanosecondsToDays - "call this.timeZone.getOffsetNanosecondsFor", - "call this.timeZone.getOffsetNanosecondsFor", - // NanosecondsToDays → AddDaysToZonedDateTime "call this.timeZone.getPossibleInstantsFor", ], "order of operations with identical wall-clock times and largestUnit a calendar unit"); actual.splice(0); // clear @@ -328,17 +324,8 @@ const expectedOpsForCalendarDifference = [ "call this.timeZone.getOffsetNanosecondsFor", // DifferenceZonedDateTime "call this.timeZone.getOffsetNanosecondsFor", - // DifferenceISODateTime - "call this.calendar.dateUntil", - // AddZonedDateTime - "call this.calendar.dateAdd", - "call this.timeZone.getPossibleInstantsFor", - // NanosecondsToDays - "call this.timeZone.getOffsetNanosecondsFor", - "call this.timeZone.getOffsetNanosecondsFor", - // NanosecondsToDays → AddDaysToZonedDateTime - "call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor", + "call this.calendar.dateUntil", ]; const expectedOpsForCalendarRounding = [ diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/wrapping-at-end-of-month.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/wrapping-at-end-of-month.js new file mode 100644 index 0000000000..50b40393f1 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/until/wrapping-at-end-of-month.js @@ -0,0 +1,120 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.until +description: Tests balancing of days to months at end of month +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +// Difference between end of longer month to end of following shorter month +{ + const end = new Temporal.ZonedDateTime(5011200_000_000_000n /* = 1970-02-28T00Z */, "UTC"); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(2332800_000_000_000n /* = 1970-01-28T00Z */, "UTC").until(end, { largestUnit }), + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + "Jan 28th to Feb 28th is one month" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(2419200_000_000_000n /* = 1970-01-29T00Z */, "UTC").until(end, { largestUnit }), + 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, + "Jan 29th to Feb 28th is 30 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(2505600_000_000_000n /* = 1970-01-30T00Z */, "UTC").until(end, { largestUnit }), + 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, + "Jan 30th to Feb 28th is 29 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(2592000_000_000_000n /* = 1970-01-31T00Z */, "UTC").until(end, { largestUnit }), + 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, + "Jan 31st to Feb 28th is 28 days, not one month" + ); + } +} + +// Difference between end of leap-year January to end of leap-year February +{ + const end = new Temporal.ZonedDateTime(68169600_000_000_000n /* = 1972-02-29T00Z */, "UTC"); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(65491200_000_000_000n /* = 1972-01-29T00Z */, "UTC").until(end, { largestUnit }), + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, + "Jan 29th to Feb 29th is one month" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(65577600_000_000_000n /* = 1972-01-30T00Z */, "UTC").until(end, { largestUnit }), + 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, + "Jan 30th to Feb 29th is 30 days, not one month" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(65664000_000_000_000n /* = 1972-01-31T00Z */, "UTC").until(end, { largestUnit }), + 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, + "Jan 31st to Feb 29th is 29 days, not one month" + ); + } +} + +// Difference between end of longer month to end of not-immediately-following +// shorter month +{ + const end = new Temporal.ZonedDateTime(28771200_000_000_000n /* = 1970-11-30T00Z */, "UTC"); + for (const largestUnit of ["years", "months"]) { + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(20822400_000_000_000n /* = 1970-08-30T00Z */, "UTC").until(end, { largestUnit }), + 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, + "Aug 30th to Nov 30th is 3 months" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(20908800_000_000_000n /* = 1970-08-31T00Z */, "UTC").until(end, { largestUnit }), + 0, 2, 0, 30, 0, 0, 0, 0, 0, 0, + "Aug 31st to Nov 30th is 2 months 30 days, not 3 months" + ); + } +} + +// Difference between end of longer month in one year to shorter month in +// later year +{ + const end = new Temporal.ZonedDateTime(104976000_000_000_000n /* = 1973-04-30T00Z */, "UTC"); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(31363200_000_000_000n /* = 1970-12-30T00Z */, "UTC").until(end, { largestUnit: "months" }), + 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 28 months" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(31363200_000_000_000n /* = 1970-12-30T00Z */, "UTC").until(end, { largestUnit: "years" }), + 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 2 years, 4 months" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(31449600_000_000_000n /* = 1970-12-31T00Z */, "UTC").until(end, { largestUnit: "months" }), + 0, 27, 0, 30, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 27 months, 30 days, not 28 months" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(31449600_000_000_000n /* = 1970-12-31T00Z */, "UTC").until(end, { largestUnit: "years" }), + 2, 3, 0, 30, 0, 0, 0, 0, 0, 0, + "Dec 30th 1970 to Apr 30th 1973 is 2 years, 3 months, 30 days, not 2 years 4 months" + ); +} + +// Difference where months passes through a month that's the same length or +// shorter than either the start or end month +{ + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(2419200_000_000_000n /* = 1970-01-29T00Z */, "UTC").until(new Temporal.ZonedDateTime(7430400_000_000_000n /* = 1970-03-28T00Z */, "UTC"), { largestUnit: "months" }), + 0, 1, 0, 28, 0, 0, 0, 0, 0, 0, + "Jan 29th to Mar 28th is 1 month 28 days, not 58 days" + ); + TemporalHelpers.assertDuration( + new Temporal.ZonedDateTime(2592000_000_000_000n /* = 1970-01-31T00Z */, "UTC").until(new Temporal.ZonedDateTime(44409600_000_000_000n /* = 1971-05-30T00Z */, "UTC"), { largestUnit: "years" }), + 1, 3, 0, 30, 0, 0, 0, 0, 0, 0, + "Jan 31st 1970 to May 30th 1971 is 1 year, 3 months, 30 days, not 1 year, 2 months, 60 days" + ); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/weekOfYear/custom-calendar-weekofyear.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/weekOfYear/custom-calendar-weekofyear.js new file mode 100644 index 0000000000..43a7d2ba14 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/weekOfYear/custom-calendar-weekofyear.js @@ -0,0 +1,27 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.weekofyear +description: > + Temporal.ZonedDateTime.prototype.weekOfYear returns undefined for all + custom calendars where weekOfYear() returns undefined. +features: [Temporal] +---*/ + +class CustomCalendar extends Temporal.Calendar { + constructor() { + super("iso8601"); + } + weekOfYear() { + return undefined; + } +} + +const calendar = new CustomCalendar(); +// Epoch Nanoseconds for new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); +const customCalendarDate = new Temporal.ZonedDateTime(1_704_112_496_987_654_321n, "UTC", calendar); +assert.sameValue(customCalendarDate.weekOfYear, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/weekOfYear/validate-calendar-value.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/weekOfYear/validate-calendar-value.js index 8b18332ce4..b2b83c1d41 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/weekOfYear/validate-calendar-value.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/weekOfYear/validate-calendar-value.js @@ -9,7 +9,6 @@ features: [Temporal] ---*/ const badResults = [ - [undefined, TypeError], [null, TypeError], [false, TypeError], [Infinity, RangeError], diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/with/getoffsetnanosecondsfor-maximum-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/with/getoffsetnanosecondsfor-maximum-forward-offset-shift.js new file mode 100644 index 0000000000..a1c2cec71d --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/with/getoffsetnanosecondsfor-maximum-forward-offset-shift.js @@ -0,0 +1,52 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.with +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants can be at most 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 0n; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + calls++; + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12 })]; + } +} + +const timeZone = new Shift24Hour(); +const instance = new Temporal.ZonedDateTime(0n, timeZone); + +for (const disambiguation of ["earlier", "later", "compatible"]) { + instance.with({ day: 1 }, { disambiguation }); + + assert(calls >= 2, "getOffsetNanosecondsFor should be called at least twice"); + calls = 0; +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/with/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/with/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..a93ee7ff32 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/with/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js @@ -0,0 +1,46 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.with +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 0n; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +for (const disambiguation of ["earlier", "later", "compatible"]) { + assert.throws(RangeError, () => instance.with({ day: 1 }, { disambiguation }), "RangeError should be thrown"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/with/getpossibleinstantsfor-maximum-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/with/getpossibleinstantsfor-maximum-backward-offset-shift.js new file mode 100644 index 0000000000..b053782926 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/with/getpossibleinstantsfor-maximum-backward-offset-shift.js @@ -0,0 +1,56 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.with +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + calls++; + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12 }), + utcInstant.add({ hours: 12 }) + ]; + } +} + +const timeZone = new Shift24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +for (const disambiguation of ["earlier", "later", "compatible"]) { + instance.with({ day: 1 }, { disambiguation }); + + assert(calls >= 1, "getPossibleInstantsFor should be called at least once"); + calls = 0; +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/with/getpossibleinstantsfor-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/with/getpossibleinstantsfor-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..7db6925321 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/with/getpossibleinstantsfor-out-of-range-backward-offset-shift.js @@ -0,0 +1,51 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.with +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +for (const disambiguation of ["earlier", "later", "compatible"]) { + assert.throws(RangeError, () => instance.with({ day: 1 }, { disambiguation }), "RangeError should be thrown"); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/calendar-iso-string.js new file mode 100644 index 0000000000..834be0ebb6 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/calendar-iso-string.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.withcalendar +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, "UTC", { + dateAdd() {}, + dateFromFields() {}, + dateUntil() {}, + day() {}, + dayOfWeek() {}, + dayOfYear() {}, + daysInMonth() {}, + daysInWeek() {}, + daysInYear() {}, + fields() {}, + id: "replace-me", + inLeapYear() {}, + mergeFields() {}, + month() {}, + monthCode() {}, + monthDayFromFields() {}, + monthsInYear() {}, + weekOfYear() {}, + year() {}, + yearMonthFromFields() {}, + yearOfWeek() {}, +}); + +for (const arg of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const result = instance.withCalendar(arg); + assert.sameValue(result.getISOFields().calendar, "iso8601", `Calendar created from string "${arg}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..a0b1fa2928 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,29 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.withplaindate +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const timeZone = new Temporal.TimeZone("UTC"); +const instance = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, timeZone); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.withPlainDate(arg); + assert.sameValue(result.epochNanoseconds, 217_129_600_000_000_000n, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-propertybag-calendar-year-zero.js index 3d7d95215e..52cefeffa3 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-propertybag-calendar-year-zero.js @@ -17,7 +17,8 @@ const invalidStrings = [ ]; const timeZone = new Temporal.TimeZone("UTC"); const instance = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, timeZone); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.withPlainDate(arg), diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..c1f874813b --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,26 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.withplaindate +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const timeZone = new Temporal.TimeZone("UTC"); +const instance = new Temporal.ZonedDateTime(0n, timeZone); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.withPlainDate(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/getoffsetnanosecondsfor-maximum-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/getoffsetnanosecondsfor-maximum-forward-offset-shift.js new file mode 100644 index 0000000000..d595cb1952 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/getoffsetnanosecondsfor-maximum-forward-offset-shift.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.withplaindate +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants can be at most 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + calls++; + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12 })]; + } +} + +const timeZone = new Shift24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +instance.withPlainDate(new Temporal.PlainDate(1970, 1, 1)); + +assert(calls >= 2, "getOffsetNanosecondsFor should be called at least twice"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..7af0ddc2d1 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js @@ -0,0 +1,44 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.withplaindate +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 12n * 3600n * 1_000_000_000n; // 1970-01-01T12:00Z + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +assert.throws(RangeError, () => instance.withPlainDate(new Temporal.PlainDate(1970, 1, 1)), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/getpossibleinstantsfor-maximum-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/getpossibleinstantsfor-maximum-backward-offset-shift.js new file mode 100644 index 0000000000..2ed4c8f1d9 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/getpossibleinstantsfor-maximum-backward-offset-shift.js @@ -0,0 +1,53 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.withplaindate +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + calls++; + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12 }), + utcInstant.add({ hours: 12 }) + ]; + } +} + +const timeZone = new Shift24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +instance.withPlainDate(new Temporal.PlainDate(1970, 1, 1)); + +assert(calls >= 1, "getPossibleInstantsFor should be called at least once"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/getpossibleinstantsfor-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/getpossibleinstantsfor-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..b43bdba300 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/getpossibleinstantsfor-out-of-range-backward-offset-shift.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.withplaindate +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +assert.throws(RangeError, () => instance.withPlainDate(new Temporal.PlainDate(1970, 1, 1)), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..d07df63e1e --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,32 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.withplaintime +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["00:00[U-CA=iso8601]", "invalid capitalized key, time-only"], + ["T00:00[U-CA=iso8601]", "invalid capitalized key, time designator"], + ["1970-01-01T00:00[U-CA=iso8601]", "invalid capitalized key"], + ["00:00[u-CA=iso8601]", "invalid partially-capitalized key, time-only"], + ["T00:00[u-CA=iso8601]", "invalid partially-capitalized key, time designator"], + ["1970-01-01T00:00[u-CA=iso8601]", "invalid partially-capitalized key"], + ["00:00[FOO=bar]", "invalid capitalized unrecognized key, time-only"], + ["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"], + ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const timeZone = new Temporal.TimeZone("UTC"); +const instance = new Temporal.ZonedDateTime(0n, timeZone); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.withPlainTime(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/getoffsetnanosecondsfor-maximum-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/getoffsetnanosecondsfor-maximum-forward-offset-shift.js new file mode 100644 index 0000000000..0bf0721c54 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/getoffsetnanosecondsfor-maximum-forward-offset-shift.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.withplaintime +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants can be at most 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 0n + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + calls++; + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12 })]; + } +} + +const timeZone = new Shift24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +instance.withPlainTime(); + +assert(calls >= 2, "getOffsetNanosecondsFor should be called at least twice"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js new file mode 100644 index 0000000000..8f2615faae --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/getoffsetnanosecondsfor-out-of-range-forward-offset-shift.js @@ -0,0 +1,44 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.withplaintime +description: > + UTC offset shift returned by adjacent invocations of getOffsetNanosecondsFor + in DisambiguatePossibleInstants cannot be greater than 24 hours. +features: [Temporal] +info: | + DisambiguatePossibleInstants: + 18. If abs(_nanoseconds_) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + _shiftEpochNs = 0n + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + if (instant.epochNanoseconds < this._shiftEpochNs) return -12 * 3600e9; + return 12 * 3600e9 + 1; + } + + getPossibleInstantsFor(plainDateTime) { + const [utcInstant] = super.getPossibleInstantsFor(plainDateTime); + const { year, month, day } = plainDateTime; + + if (year < 1970) return [utcInstant.subtract({ hours: 12 })]; + if (year === 1970 && month === 1 && day === 1) return []; + return [utcInstant.add({ hours: 12, nanoseconds: 1 })]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +assert.throws(RangeError, () => instance.withPlainTime(), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/getpossibleinstantsfor-maximum-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/getpossibleinstantsfor-maximum-backward-offset-shift.js new file mode 100644 index 0000000000..21dcd8b3ba --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/getpossibleinstantsfor-maximum-backward-offset-shift.js @@ -0,0 +1,53 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.withplaintime +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +let calls = 0; + +class Shift24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + calls++; + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12 }), + utcInstant.add({ hours: 12 }) + ]; + } +} + +const timeZone = new Shift24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +instance.withPlainTime(); + +assert(calls >= 1, "getPossibleInstantsFor should be called at least once"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/getpossibleinstantsfor-out-of-range-backward-offset-shift.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/getpossibleinstantsfor-out-of-range-backward-offset-shift.js new file mode 100644 index 0000000000..f2856f0aea --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/getpossibleinstantsfor-out-of-range-backward-offset-shift.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.withplaintime +description: > + UTC offset shift returned by getPossibleInstantsFor can be at most 24 hours. +features: [Temporal] +info: | + GetPossibleInstantsFor: + 5.b.i. Let _numResults_ be _list_'s length. + ii. If _numResults_ > 1, then + 1. Let _epochNs_ be a new empty List. + 2. For each value _instant_ in list, do + a. Append _instant_.[[EpochNanoseconds]] to the end of the List _epochNs_. + 3. Let _min_ be the least element of the List _epochNs_. + 4. Let _max_ be the greatest element of the List _epochNs_. + 5. If abs(ℝ(_max_ - _min_)) > nsPerDay, throw a *RangeError* exception. +---*/ + +class ShiftLonger24Hour extends Temporal.TimeZone { + id = 'TestTimeZone'; + + constructor() { + super('UTC'); + } + + getOffsetNanosecondsFor(instant) { + return 0; + } + + getPossibleInstantsFor(plainDateTime) { + const utc = new Temporal.TimeZone("UTC"); + const [utcInstant] = utc.getPossibleInstantsFor(plainDateTime); + return [ + utcInstant.subtract({ hours: 12, nanoseconds: 1 }), + utcInstant.add({ hours: 12 }), + utcInstant, // add a third value in case the implementation doesn't sort + ]; + } +} + +const timeZone = new ShiftLonger24Hour(); + +const instance = new Temporal.ZonedDateTime(0n, timeZone); +assert.throws(RangeError, () => instance.withPlainTime(), "RangeError should be thrown"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/yearOfWeek/custom-calendar-weekofyear.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/yearOfWeek/custom-calendar-weekofyear.js new file mode 100644 index 0000000000..331002f262 --- /dev/null +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/yearOfWeek/custom-calendar-weekofyear.js @@ -0,0 +1,27 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.yearofweek +description: > + Temporal.ZonedDateTime.prototype.yearOfWeek returns undefined for all + custom calendars where yearOfWeek() returns undefined. +features: [Temporal] +---*/ + +class CustomCalendar extends Temporal.Calendar { + constructor() { + super("iso8601"); + } + yearOfWeek() { + return undefined; + } +} + +const calendar = new CustomCalendar(); +// Epoch Nanoseconds for new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); +const customCalendarDate = new Temporal.ZonedDateTime(1_704_112_496_987_654_321n, "UTC", calendar); +assert.sameValue(customCalendarDate.yearOfWeek, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/yearOfWeek/validate-calendar-value.js b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/yearOfWeek/validate-calendar-value.js index 9bd447f9a1..9eb067c70b 100644 --- a/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/yearOfWeek/validate-calendar-value.js +++ b/js/src/tests/test262/built-ins/Temporal/ZonedDateTime/prototype/yearOfWeek/validate-calendar-value.js @@ -9,7 +9,6 @@ features: [Temporal] ---*/ const badResults = [ - [undefined, TypeError], [Infinity, RangeError], [-Infinity, RangeError], [Symbol("foo"), TypeError], diff --git a/js/src/tests/test262/built-ins/Temporal/shell.js b/js/src/tests/test262/built-ins/Temporal/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/built-ins/Temporal/shell.js +++ b/js/src/tests/test262/built-ins/Temporal/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/ThrowTypeError/length.js b/js/src/tests/test262/built-ins/ThrowTypeError/length.js index d30e3ec045..cc55b8f77b 100644 --- a/js/src/tests/test262/built-ins/ThrowTypeError/length.js +++ b/js/src/tests/test262/built-ins/ThrowTypeError/length.js @@ -18,10 +18,11 @@ var ThrowTypeError = Object.getOwnPropertyDescriptor(function() { return arguments; }(), "callee").get; -assert.sameValue(ThrowTypeError.length, 0); - -verifyNotEnumerable(ThrowTypeError, "length"); -verifyNotWritable(ThrowTypeError, "length"); -verifyNotConfigurable(ThrowTypeError, "length"); +verifyProperty(ThrowTypeError, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: false +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/Symbol.species/length.js b/js/src/tests/test262/built-ins/TypedArray/Symbol.species/length.js index 8efd820740..1c0470e699 100644 --- a/js/src/tests/test262/built-ins/TypedArray/Symbol.species/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/Symbol.species/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -25,10 +26,11 @@ features: [Symbol.species] var desc = Object.getOwnPropertyDescriptor(TypedArray, 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/TypedArray/Symbol.species/name.js b/js/src/tests/test262/built-ins/TypedArray/Symbol.species/name.js index 8747ac6130..444d7c99cb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/Symbol.species/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/Symbol.species/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -22,10 +23,11 @@ features: [Symbol.species] var desc = Object.getOwnPropertyDescriptor(TypedArray, Symbol.species); -assert.sameValue(desc.get.name, "get [Symbol.species]"); - -verifyNotEnumerable(desc.get, "name"); -verifyNotWritable(desc.get, "name"); -verifyConfigurable(desc.get, "name"); +verifyProperty(desc.get, "name", { + value: "get [Symbol.species]", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/Symbol.species/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/Symbol.species/prop-desc.js index 5a97e8f5e1..fd203d961c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/Symbol.species/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/Symbol.species/prop-desc.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/TypedArray/Symbol.species/result.js b/js/src/tests/test262/built-ins/TypedArray/Symbol.species/result.js index 3b79165925..11c1ca5ecb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/Symbol.species/result.js +++ b/js/src/tests/test262/built-ins/TypedArray/Symbol.species/result.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/TypedArray/from/arylk-get-length-error.js b/js/src/tests/test262/built-ins/TypedArray/from/arylk-get-length-error.js index 705df14bf9..fb759d77dc 100644 --- a/js/src/tests/test262/built-ins/TypedArray/from/arylk-get-length-error.js +++ b/js/src/tests/test262/built-ins/TypedArray/from/arylk-get-length-error.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/TypedArray/from/arylk-to-length-error.js b/js/src/tests/test262/built-ins/TypedArray/from/arylk-to-length-error.js index e4ab814d5f..357362d82e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/from/arylk-to-length-error.js +++ b/js/src/tests/test262/built-ins/TypedArray/from/arylk-to-length-error.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/TypedArray/from/from-array-mapper-detaches-result.js b/js/src/tests/test262/built-ins/TypedArray/from/from-array-mapper-detaches-result.js new file mode 100644 index 0000000000..0af40c814e --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArray/from/from-array-mapper-detaches-result.js @@ -0,0 +1,39 @@ +// Copyright (C) 2024 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-%typedarray%.from +description: > + If the mapper function detaches the result typed array, .from performs Set operation which ignores out-of-bounds indices. +info: | + %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] ) + + ... + 12. Repeat, while k < len, + ... + c. If mapping is true, then + i. Let mappedValue be ? Call(mapfn, thisArg, « kValue, 𝔽(k) »). + ... + e. Perform ? Set(targetObj, Pk, mappedValue, true). + ... +includes: [detachArrayBuffer.js] +features: [TypedArray] +---*/ + +let ab = new ArrayBuffer(3); +let target = new Int8Array(ab); +let values = [0, 1, 2]; + +let result = Int32Array.from.call(function() { + return target; +}, values, v => { + if (v === 1) { + $DETACHBUFFER(ab); + } + return v + 10; +}); + +assert.sameValue(result, target); +assert.sameValue(result.length, 0); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/from/from-array-mapper-makes-result-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/from/from-array-mapper-makes-result-out-of-bounds.js new file mode 100644 index 0000000000..c3c541a2a8 --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArray/from/from-array-mapper-makes-result-out-of-bounds.js @@ -0,0 +1,40 @@ +// |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-%typedarray%.from +description: > + If the mapper function makes result typed array out-of-bounds, .from performs Set operation which ignores out-of-bounds indices. +info: | + %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] ) + + ... + 12. Repeat, while k < len, + ... + c. If mapping is true, then + i. Let mappedValue be ? Call(mapfn, thisArg, « kValue, 𝔽(k) »). + ... + e. Perform ? Set(targetObj, Pk, mappedValue, true). + ... +features: [TypedArray, resizable-arraybuffer] +---*/ + +let rab = new ArrayBuffer(3, {maxByteLength: 5}); +let target = new Int8Array(rab); +let values = [0, 1, 2]; + +let result = Int32Array.from.call(function() { + return target; +}, values, v => { + if (v === 1) { + rab.resize(1); + } + return v + 10; +}); + +assert.sameValue(result, target); +assert.sameValue(result.length, 1); +assert.sameValue(result[0], 10); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/from/from-typedarray-into-itself-mapper-detaches-result.js b/js/src/tests/test262/built-ins/TypedArray/from/from-typedarray-into-itself-mapper-detaches-result.js new file mode 100644 index 0000000000..3ef68a8e8d --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArray/from/from-typedarray-into-itself-mapper-detaches-result.js @@ -0,0 +1,39 @@ +// Copyright (C) 2024 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-%typedarray%.from +description: > + If the mapper function detaches the result typed array, .from performs Set operation which ignores out-of-bounds indices. +info: | + %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] ) + + ... + 12. Repeat, while k < len, + ... + c. If mapping is true, then + i. Let mappedValue be ? Call(mapfn, thisArg, « kValue, 𝔽(k) »). + ... + e. Perform ? Set(targetObj, Pk, mappedValue, true). + ... +includes: [detachArrayBuffer.js] +features: [TypedArray] +---*/ + +let ab = new ArrayBuffer(3); +let target = new Int8Array(ab); +target.set([0, 1, 2]); + +let result = Int32Array.from.call(function() { + return target; +}, target, v => { + if (v === 1) { + $DETACHBUFFER(ab); + } + return v + 10; +}); + +assert.sameValue(result, target); +assert.sameValue(result.length, 0); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/from/from-typedarray-into-itself-mapper-makes-result-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/from/from-typedarray-into-itself-mapper-makes-result-out-of-bounds.js new file mode 100644 index 0000000000..d83cf5f5f6 --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArray/from/from-typedarray-into-itself-mapper-makes-result-out-of-bounds.js @@ -0,0 +1,40 @@ +// |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-%typedarray%.from +description: > + If the mapper function makes result typed array out-of-bounds, .from performs Set operation which ignores out-of-bounds indices. +info: | + %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] ) + + ... + 12. Repeat, while k < len, + ... + c. If mapping is true, then + i. Let mappedValue be ? Call(mapfn, thisArg, « kValue, 𝔽(k) »). + ... + e. Perform ? Set(targetObj, Pk, mappedValue, true). + ... +features: [TypedArray, resizable-arraybuffer] +---*/ + +let rab = new ArrayBuffer(3, {maxByteLength: 5}); +let target = new Int8Array(rab); +target.set([0, 1, 2]); + +let result = Int32Array.from.call(function() { + return target; +}, target, v => { + if (v === 1) { + rab.resize(1); + } + return v + 10; +}); + +assert.sameValue(result, target); +assert.sameValue(result.length, 1); +assert.sameValue(result[0], 10); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/from/from-typedarray-mapper-detaches-result.js b/js/src/tests/test262/built-ins/TypedArray/from/from-typedarray-mapper-detaches-result.js new file mode 100644 index 0000000000..25b64bdde8 --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArray/from/from-typedarray-mapper-detaches-result.js @@ -0,0 +1,39 @@ +// Copyright (C) 2024 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-%typedarray%.from +description: > + If the mapper function detaches the result typed array, .from performs Set operation which ignores out-of-bounds indices. +info: | + %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] ) + + ... + 12. Repeat, while k < len, + ... + c. If mapping is true, then + i. Let mappedValue be ? Call(mapfn, thisArg, « kValue, 𝔽(k) »). + ... + e. Perform ? Set(targetObj, Pk, mappedValue, true). + ... +includes: [detachArrayBuffer.js] +features: [TypedArray] +---*/ + +let ab = new ArrayBuffer(3); +let target = new Int8Array(ab); +let values = new Int8Array([0, 1, 2]); + +let result = Int32Array.from.call(function() { + return target; +}, values, v => { + if (v === 1) { + $DETACHBUFFER(ab); + } + return v + 10; +}); + +assert.sameValue(result, target); +assert.sameValue(result.length, 0); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/from/from-typedarray-mapper-makes-result-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/from/from-typedarray-mapper-makes-result-out-of-bounds.js new file mode 100644 index 0000000000..389155bfe9 --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArray/from/from-typedarray-mapper-makes-result-out-of-bounds.js @@ -0,0 +1,40 @@ +// |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-%typedarray%.from +description: > + If the mapper function makes result typed array out-of-bounds, .from performs Set operation which ignores out-of-bounds indices. +info: | + %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] ) + + ... + 12. Repeat, while k < len, + ... + c. If mapping is true, then + i. Let mappedValue be ? Call(mapfn, thisArg, « kValue, 𝔽(k) »). + ... + e. Perform ? Set(targetObj, Pk, mappedValue, true). + ... +features: [TypedArray, resizable-arraybuffer] +---*/ + +let rab = new ArrayBuffer(3, {maxByteLength: 5}); +let target = new Int8Array(rab); +let values = new Int8Array([0, 1, 2]); + +let result = Int32Array.from.call(function() { + return target; +}, values, v => { + if (v === 1) { + rab.resize(1); + } + return v + 10; +}); + +assert.sameValue(result, target); +assert.sameValue(result.length, 1); +assert.sameValue(result[0], 10); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/from/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/from/invoked-as-func.js index 97ce6b2ff9..364a5d4a24 100644 --- a/js/src/tests/test262/built-ins/TypedArray/from/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/from/invoked-as-func.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/TypedArray/from/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/from/invoked-as-method.js index d2414e0923..9cafb59fdf 100644 --- a/js/src/tests/test262/built-ins/TypedArray/from/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/from/invoked-as-method.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/TypedArray/from/iter-access-error.js b/js/src/tests/test262/built-ins/TypedArray/from/iter-access-error.js index b37537d19e..5d37f8179c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/from/iter-access-error.js +++ b/js/src/tests/test262/built-ins/TypedArray/from/iter-access-error.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/TypedArray/from/iter-invoke-error.js b/js/src/tests/test262/built-ins/TypedArray/from/iter-invoke-error.js index de395eb2dc..99605d1254 100644 --- a/js/src/tests/test262/built-ins/TypedArray/from/iter-invoke-error.js +++ b/js/src/tests/test262/built-ins/TypedArray/from/iter-invoke-error.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/TypedArray/from/iter-next-error.js b/js/src/tests/test262/built-ins/TypedArray/from/iter-next-error.js index 7cbea13246..7783529181 100644 --- a/js/src/tests/test262/built-ins/TypedArray/from/iter-next-error.js +++ b/js/src/tests/test262/built-ins/TypedArray/from/iter-next-error.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/TypedArray/from/iter-next-value-error.js b/js/src/tests/test262/built-ins/TypedArray/from/iter-next-value-error.js index a1674c417b..3742e273ab 100644 --- a/js/src/tests/test262/built-ins/TypedArray/from/iter-next-value-error.js +++ b/js/src/tests/test262/built-ins/TypedArray/from/iter-next-value-error.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/TypedArray/from/iterated-array-changed-by-tonumber.js b/js/src/tests/test262/built-ins/TypedArray/from/iterated-array-changed-by-tonumber.js new file mode 100644 index 0000000000..a0d6099170 --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArray/from/iterated-array-changed-by-tonumber.js @@ -0,0 +1,39 @@ +// Copyright (C) 2024 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-%typedarray%.from +description: > + Modifications to input array after iteration are handled correctly. +info: | + %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] ) + + ... + 6. If usingIterator is not undefined, then + a. Let values be ? IteratorToList(? GetIteratorFromMethod(source, usingIterator)). + b. Let len be the number of elements in values. + ... + e. Repeat, while k < len, + ... + vi. Perform ? Set(targetObj, Pk, mappedValue, true). + ... +features: [TypedArray] +---*/ + +let values = [0, { + valueOf() { + // Removes all array elements. Caller must have saved all elements. + values.length = 0; + return 100; + } +}, 2]; + +// `from` called with array which uses the built-in array iterator. +let ta = Int32Array.from(values); + +assert.sameValue(ta.length, 3); +assert.sameValue(ta[0], 0); +assert.sameValue(ta[1], 100); +assert.sameValue(ta[2], 2); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/from/length.js b/js/src/tests/test262/built-ins/TypedArray/from/length.js index 6ec675f750..27d8ecb128 100644 --- a/js/src/tests/test262/built-ins/TypedArray/from/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/from/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -24,10 +25,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.from.length, 1); - -verifyNotEnumerable(TypedArray.from, "length"); -verifyNotWritable(TypedArray.from, "length"); -verifyConfigurable(TypedArray.from, "length"); +verifyProperty(TypedArray.from, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/from/mapfn-is-not-callable.js b/js/src/tests/test262/built-ins/TypedArray/from/mapfn-is-not-callable.js index ece0766bee..42fa25ef61 100644 --- a/js/src/tests/test262/built-ins/TypedArray/from/mapfn-is-not-callable.js +++ b/js/src/tests/test262/built-ins/TypedArray/from/mapfn-is-not-callable.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/TypedArray/from/name.js b/js/src/tests/test262/built-ins/TypedArray/from/name.js index 9fa98be4e7..888eecdb3f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/from/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/from/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.from.name, "from"); - -verifyNotEnumerable(TypedArray.from, "name"); -verifyNotWritable(TypedArray.from, "name"); -verifyConfigurable(TypedArray.from, "name"); +verifyProperty(TypedArray.from, "name", { + value: "from", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/from/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/from/not-a-constructor.js index 41a794dfca..72a0817679 100644 --- a/js/src/tests/test262/built-ins/TypedArray/from/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/from/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -25,7 +26,7 @@ assert.sameValue(isConstructor(TypedArray.from), false, 'isConstructor(TypedArra assert.throws(TypeError, () => { new TypedArray.from([]); -}, '`new TypedArray.from([])` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/from/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/from/prop-desc.js index 7dd61adf7d..bc9f0ca5ee 100644 --- a/js/src/tests/test262/built-ins/TypedArray/from/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/from/prop-desc.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/TypedArray/from/this-is-not-constructor.js b/js/src/tests/test262/built-ins/TypedArray/from/this-is-not-constructor.js index 7838753ba5..821152f3c1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/from/this-is-not-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/from/this-is-not-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/TypedArray/invoked.js b/js/src/tests/test262/built-ins/TypedArray/invoked.js index 3dca11ff4c..2af6656365 100644 --- a/js/src/tests/test262/built-ins/TypedArray/invoked.js +++ b/js/src/tests/test262/built-ins/TypedArray/invoked.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/TypedArray/length.js b/js/src/tests/test262/built-ins/TypedArray/length.js index 2f4e13aeff..e603641abe 100644 --- a/js/src/tests/test262/built-ins/TypedArray/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/length.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/TypedArray/name.js b/js/src/tests/test262/built-ins/TypedArray/name.js index ef6ccf58c1..a40ba68ba7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/name.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. /*--- @@ -18,10 +19,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.name, 'TypedArray'); - -verifyNotEnumerable(TypedArray, 'name'); -verifyNotWritable(TypedArray, 'name'); -verifyConfigurable(TypedArray, 'name'); +verifyProperty(TypedArray, "name", { + value: "TypedArray", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/of/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/of/invoked-as-func.js index 1f40a9659b..4e798e82e8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/of/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/of/invoked-as-func.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/TypedArray/of/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/of/invoked-as-method.js index 0b671ca852..9d24453218 100644 --- a/js/src/tests/test262/built-ins/TypedArray/of/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/of/invoked-as-method.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/TypedArray/of/length.js b/js/src/tests/test262/built-ins/TypedArray/of/length.js index 9739cd5045..8ac2068bb3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/of/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/of/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -24,10 +25,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.of.length, 0); - -verifyNotEnumerable(TypedArray.of, "length"); -verifyNotWritable(TypedArray.of, "length"); -verifyConfigurable(TypedArray.of, "length"); +verifyProperty(TypedArray.of, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/of/name.js b/js/src/tests/test262/built-ins/TypedArray/of/name.js index c18c95cafe..1fbb1cc54e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/of/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/of/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.of.name, "of"); - -verifyNotEnumerable(TypedArray.of, "name"); -verifyNotWritable(TypedArray.of, "name"); -verifyConfigurable(TypedArray.of, "name"); +verifyProperty(TypedArray.of, "name", { + value: "of", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/of/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/of/not-a-constructor.js index 575bb492fb..ca84c190ed 100644 --- a/js/src/tests/test262/built-ins/TypedArray/of/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/of/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -25,7 +26,7 @@ assert.sameValue(isConstructor(TypedArray.of), false, 'isConstructor(TypedArray. assert.throws(TypeError, () => { new TypedArray.of(1, 2, 3, 4); -}, '`new TypedArray.of(1, 2, 3, 4)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/of/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/of/prop-desc.js index 86bad8552c..f940c5fb8c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/of/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/of/prop-desc.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/TypedArray/of/resized-with-out-of-bounds-and-in-bounds-indices.js b/js/src/tests/test262/built-ins/TypedArray/of/resized-with-out-of-bounds-and-in-bounds-indices.js new file mode 100644 index 0000000000..6e0ee8a25e --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArray/of/resized-with-out-of-bounds-and-in-bounds-indices.js @@ -0,0 +1,60 @@ +// |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-%typedarray%.of +description: > + Performs Set operation which ignores out-of-bounds indices. +info: | + %TypedArray%.of ( ...items ) + + ... + 6. Repeat, while k < len, + ... + c. Perform ? Set(newObj, Pk, kValue, true). + ... + +features: [TypedArray, resizable-arraybuffer] +---*/ + +let rab = new ArrayBuffer(3, {maxByteLength: 4}); +let ta = new Int8Array(rab); + +let one = { + valueOf() { + // Shrink buffer. Assignment to `ta[0]` should be ignored. + rab.resize(0); + return 1; + } +}; + +let two = { + valueOf() { + // Grow buffer. All following assignment should succeed. + rab.resize(4); + return 2; + } +}; + +// Typed array is correctly zero initialised. +assert.sameValue(ta.length, 3); +assert.sameValue(ta[0], 0); +assert.sameValue(ta[1], 0); +assert.sameValue(ta[2], 0); + +let result = Int8Array.of.call(function() { + return ta; +}, one, two, 3); + +// Correct result value. +assert.sameValue(result, ta); + +// Values are correctly set. +assert.sameValue(ta.length, 4); +assert.sameValue(ta[0], 0); +assert.sameValue(ta[1], 2); +assert.sameValue(ta[2], 3); +assert.sameValue(ta[3], 0); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/of/this-is-not-constructor.js b/js/src/tests/test262/built-ins/TypedArray/of/this-is-not-constructor.js index 606fba3255..047c7a24f0 100644 --- a/js/src/tests/test262/built-ins/TypedArray/of/this-is-not-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/of/this-is-not-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/TypedArray/prototype.js b/js/src/tests/test262/built-ins/TypedArray/prototype.js index 95287ce179..a8cc57c472 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype.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/TypedArray/prototype/Symbol.iterator.js b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.iterator.js index 1e125255c1..37f4b383d3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.iterator.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.iterator.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArray/prototype/Symbol.iterator/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.iterator/not-a-constructor.js index 2a894cabda..fb31d3f1bf 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.iterator/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.iterator/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8[Symbol.iterator](); -}, '`let u8 = new Uint8Array(1); new u8[Symbol.iterator]()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/length.js index 246f30b499..05191eb113 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/length.js @@ -25,10 +25,11 @@ features: [BigInt, Symbol.toStringTag] var desc = Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag); -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/TypedArray/prototype/Symbol.toStringTag/BigInt/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/name.js index 3b77f82c2b..c553953baf 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/BigInt/name.js @@ -22,10 +22,11 @@ features: [BigInt, Symbol.toStringTag] var desc = Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag); -assert.sameValue(desc.get.name, "get [Symbol.toStringTag]"); - -verifyNotEnumerable(desc.get, "name"); -verifyNotWritable(desc.get, "name"); -verifyConfigurable(desc.get, "name"); +verifyProperty(desc.get, "name", { + value: "get [Symbol.toStringTag]", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/detached-buffer.js index 2644bfebd4..53747b724f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/detached-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/TypedArray/prototype/Symbol.toStringTag/invoked-as-accessor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/invoked-as-accessor.js index 227ff392a1..0b3ffb30fc 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/invoked-as-accessor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/invoked-as-accessor.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/TypedArray/prototype/Symbol.toStringTag/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/invoked-as-func.js index f05d7656d6..af72124902 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/invoked-as-func.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/TypedArray/prototype/Symbol.toStringTag/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/length.js index d47c20684b..e7e0117258 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -25,10 +26,11 @@ features: [Symbol.toStringTag] var desc = Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag); -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/TypedArray/prototype/Symbol.toStringTag/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/name.js index 6de76bd40f..05141ff900 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -22,10 +23,11 @@ features: [Symbol.toStringTag] var desc = Object.getOwnPropertyDescriptor(TypedArray.prototype, Symbol.toStringTag); -assert.sameValue(desc.get.name, "get [Symbol.toStringTag]"); - -verifyNotEnumerable(desc.get, "name"); -verifyNotWritable(desc.get, "name"); -verifyConfigurable(desc.get, "name"); +verifyProperty(desc.get, "name", { + value: "get [Symbol.toStringTag]", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/prop-desc.js index 7fda276f58..ad6754e5cf 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/prop-desc.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/TypedArray/prototype/Symbol.toStringTag/return-typedarrayname.js b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/return-typedarrayname.js index 4cc973019c..5c09a7f9c5 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/return-typedarrayname.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/return-typedarrayname.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/TypedArray/prototype/Symbol.toStringTag/this-has-no-typedarrayname-internal.js b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/this-has-no-typedarrayname-internal.js index 06450f6030..2cc5fd385c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/this-has-no-typedarrayname-internal.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/this-has-no-typedarrayname-internal.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/TypedArray/prototype/Symbol.toStringTag/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/this-is-not-object.js index 460564f162..4875b31c33 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/Symbol.toStringTag/this-is-not-object.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/TypedArray/prototype/at/index-argument-tointeger.js b/js/src/tests/test262/built-ins/TypedArray/prototype/at/index-argument-tointeger.js index 0177ff8308..6d876f3ec3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/at/index-argument-tointeger.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/at/index-argument-tointeger.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArray/prototype/at/index-non-numeric-argument-tointeger-invalid.js b/js/src/tests/test262/built-ins/TypedArray/prototype/at/index-non-numeric-argument-tointeger-invalid.js index e3f65c143d..2f6c5b24fe 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/at/index-non-numeric-argument-tointeger-invalid.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/at/index-non-numeric-argument-tointeger-invalid.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- @@ -24,7 +25,7 @@ testWithTypedArrayConstructors(TA => { assert.throws(TypeError, () => { a.at(Symbol()); - }, '`a.at(Symbol())` throws TypeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/at/index-non-numeric-argument-tointeger.js b/js/src/tests/test262/built-ins/TypedArray/prototype/at/index-non-numeric-argument-tointeger.js index 4d604500bb..f8eb8dd7fa 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/at/index-non-numeric-argument-tointeger.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/at/index-non-numeric-argument-tointeger.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArray/prototype/at/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/at/length.js index acd90fd31c..29aa7993b7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/at/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/at/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- @@ -18,13 +19,11 @@ assert.sameValue( 'The value of `typeof TypedArray.prototype.at` is "function"' ); -assert.sameValue( - TypedArray.prototype.at.length, 1, - 'The value of TypedArray.prototype.at.length is 1' -); - -verifyNotEnumerable(TypedArray.prototype.at, 'length'); -verifyNotWritable(TypedArray.prototype.at, 'length'); -verifyConfigurable(TypedArray.prototype.at, 'length'); +verifyProperty(TypedArray.prototype.at, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/at/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/at/name.js index fd4fcf2324..436c47a595 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/at/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/at/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArray/prototype/at/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/at/prop-desc.js index 946b185db0..dada242916 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/at/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/at/prop-desc.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArray/prototype/at/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/at/return-abrupt-from-this-out-of-bounds.js index 1613acdcce..59cd73cd26 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/at/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/at/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/at/return-abrupt-from-this.js b/js/src/tests/test262/built-ins/TypedArray/prototype/at/return-abrupt-from-this.js index aaf89b12ef..563a419ad1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/at/return-abrupt-from-this.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/at/return-abrupt-from-this.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- @@ -21,22 +22,22 @@ assert.sameValue( assert.throws(TypeError, () => { TypedArray.prototype.at.call(undefined); -}, '`TypedArray.prototype.at.call(undefined)` throws TypeError'); +}); assert.throws(TypeError, () => { TypedArray.prototype.at.call(null); -}, '`TypedArray.prototype.at.call(null)` throws TypeError'); +}); testWithTypedArrayConstructors(TA => { assert.sameValue(typeof TA.prototype.at, 'function', 'The value of `typeof TA.prototype.at` is "function"'); assert.throws(TypeError, () => { TA.prototype.at.call(undefined); - }, '`TA.prototype.at.call(undefined)` throws TypeError'); + }); assert.throws(TypeError, () => { TA.prototype.at.call(null); - }, '`TA.prototype.at.call(null)` throws TypeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/at/returns-item-relative-index.js b/js/src/tests/test262/built-ins/TypedArray/prototype/at/returns-item-relative-index.js index ff4d81fc04..c615b657da 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/at/returns-item-relative-index.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/at/returns-item-relative-index.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArray/prototype/at/returns-item.js b/js/src/tests/test262/built-ins/TypedArray/prototype/at/returns-item.js index 77ac1a0317..615c69c4b8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/at/returns-item.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/at/returns-item.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArray/prototype/at/returns-undefined-for-holes-in-sparse-arrays.js b/js/src/tests/test262/built-ins/TypedArray/prototype/at/returns-undefined-for-holes-in-sparse-arrays.js index c4eafb1e10..7b0ddba071 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/at/returns-undefined-for-holes-in-sparse-arrays.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/at/returns-undefined-for-holes-in-sparse-arrays.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArray/prototype/at/returns-undefined-for-out-of-range-index.js b/js/src/tests/test262/built-ins/TypedArray/prototype/at/returns-undefined-for-out-of-range-index.js index 8a954e3971..af9af6f6f5 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/at/returns-undefined-for-out-of-range-index.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/at/returns-undefined-for-out-of-range-index.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArray/prototype/buffer/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/detached-buffer.js index 37d07fc49b..2d3da6c56d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/detached-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/TypedArray/prototype/buffer/invoked-as-accessor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/invoked-as-accessor.js index d1ce4b348a..4d02a18818 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/invoked-as-accessor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/invoked-as-accessor.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/TypedArray/prototype/buffer/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/invoked-as-func.js index 4b47043775..14d8be3c48 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/invoked-as-func.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/TypedArray/prototype/buffer/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/length.js index 5d0450e8f0..a343b2d947 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -25,10 +26,11 @@ features: [TypedArray] var desc = Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer"); -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/TypedArray/prototype/buffer/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/name.js index f0464af9dc..af4c7cc517 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -22,10 +23,11 @@ features: [TypedArray] var desc = Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer"); -assert.sameValue(desc.get.name, "get buffer"); - -verifyNotEnumerable(desc.get, "name"); -verifyNotWritable(desc.get, "name"); -verifyConfigurable(desc.get, "name"); +verifyProperty(desc.get, "name", { + value: "get buffer", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/prop-desc.js index 70f7c8973f..3d1d6b63ad 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/prop-desc.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/TypedArray/prototype/buffer/return-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/return-buffer.js index aa17d649bf..c9ff2122a9 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/return-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/return-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/TypedArray/prototype/buffer/this-has-no-typedarrayname-internal.js b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/this-has-no-typedarrayname-internal.js index 69844e2da1..4f57e51995 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/this-has-no-typedarrayname-internal.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/this-has-no-typedarrayname-internal.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/TypedArray/prototype/buffer/this-inherits-typedarray.js b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/this-inherits-typedarray.js index 27d44fee16..82b823a8db 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/this-inherits-typedarray.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/this-inherits-typedarray.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Google. 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/TypedArray/prototype/buffer/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/this-is-not-object.js index 6f23eb7253..670fcbba4f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/buffer/this-is-not-object.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/TypedArray/prototype/byteLength/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/detached-buffer.js index 205495e17c..9f69a6a2a2 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/detached-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/TypedArray/prototype/byteLength/invoked-as-accessor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/invoked-as-accessor.js index 6f61359335..aed9dcd57b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/invoked-as-accessor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/invoked-as-accessor.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/TypedArray/prototype/byteLength/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/invoked-as-func.js index 2564aef2f1..ec048f95d6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/invoked-as-func.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/TypedArray/prototype/byteLength/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/length.js index c8d44217b9..665001a4e4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -25,10 +26,11 @@ features: [TypedArray] var desc = Object.getOwnPropertyDescriptor(TypedArray.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/TypedArray/prototype/byteLength/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/name.js index b6da9f6c41..c004b2d570 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -22,10 +23,11 @@ features: [TypedArray] var desc = Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteLength"); -assert.sameValue(desc.get.name, "get byteLength"); - -verifyNotEnumerable(desc.get, "name"); -verifyNotWritable(desc.get, "name"); -verifyConfigurable(desc.get, "name"); +verifyProperty(desc.get, "name", { + value: "get byteLength", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/prop-desc.js index cb1a455857..ebe22609dd 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/prop-desc.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/TypedArray/prototype/byteLength/resizable-array-buffer-auto.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/resizable-array-buffer-auto.js index eec8cf0b14..3ac27e0682 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/resizable-array-buffer-auto.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/resizable-array-buffer-auto.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/TypedArray/prototype/byteLength/resizable-array-buffer-fixed.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/resizable-array-buffer-fixed.js index 5bef61d780..81ab5c4fb4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/resizable-array-buffer-fixed.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/resizable-array-buffer-fixed.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/TypedArray/prototype/byteLength/return-bytelength.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/return-bytelength.js index a344aa1d4f..7c47369993 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/return-bytelength.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/return-bytelength.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/TypedArray/prototype/byteLength/this-has-no-typedarrayname-internal.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/this-has-no-typedarrayname-internal.js index 212bd2b016..26c935b03f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/this-has-no-typedarrayname-internal.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/this-has-no-typedarrayname-internal.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/TypedArray/prototype/byteLength/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/this-is-not-object.js index 84a1e60675..0ed69a16db 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteLength/this-is-not-object.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/TypedArray/prototype/byteOffset/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/detached-buffer.js index e831fd0232..2fcdf445a8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/detached-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/TypedArray/prototype/byteOffset/invoked-as-accessor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/invoked-as-accessor.js index 7ebe5f7ff2..20894b2b5f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/invoked-as-accessor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/invoked-as-accessor.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/TypedArray/prototype/byteOffset/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/invoked-as-func.js index e7ff71bfef..49ca72256a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/invoked-as-func.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/TypedArray/prototype/byteOffset/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/length.js index f8e16555cb..a539d8f4f7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -25,10 +26,11 @@ features: [TypedArray] var desc = Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset"); -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/TypedArray/prototype/byteOffset/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/name.js index 4a2e7d3ea3..7c3b3e2c87 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -22,10 +23,11 @@ features: [TypedArray] var desc = Object.getOwnPropertyDescriptor(TypedArray.prototype, "byteOffset"); -assert.sameValue(desc.get.name, "get byteOffset"); - -verifyNotEnumerable(desc.get, "name"); -verifyNotWritable(desc.get, "name"); -verifyConfigurable(desc.get, "name"); +verifyProperty(desc.get, "name", { + value: "get byteOffset", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/prop-desc.js index 8d6f554f4a..efe5371932 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/prop-desc.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/TypedArray/prototype/byteOffset/resizable-array-buffer-auto.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/resizable-array-buffer-auto.js index 7aa66e07e5..6a43427556 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/resizable-array-buffer-auto.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/resizable-array-buffer-auto.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/TypedArray/prototype/byteOffset/resizable-array-buffer-fixed.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/resizable-array-buffer-fixed.js index 5bbfb4e5b7..c01adaf4c0 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/resizable-array-buffer-fixed.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/resizable-array-buffer-fixed.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/TypedArray/prototype/byteOffset/return-byteoffset.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/return-byteoffset.js index 889aef45b5..de9ea26f85 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/return-byteoffset.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/return-byteoffset.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/TypedArray/prototype/byteOffset/this-has-no-typedarrayname-internal.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/this-has-no-typedarrayname-internal.js index 4388d3d760..8fc44140ca 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/this-has-no-typedarrayname-internal.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/this-has-no-typedarrayname-internal.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/TypedArray/prototype/byteOffset/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/this-is-not-object.js index da5c78ed28..a2cd9b964e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/byteOffset/this-is-not-object.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/TypedArray/prototype/constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/constructor.js index d41ffbfa41..fa10f9aa9f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArray/prototype/copyWithin/bit-precision.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/bit-precision.js index e72c355cb9..9a606f8609 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/bit-precision.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/bit-precision.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/TypedArray/prototype/copyWithin/byteoffset.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/byteoffset.js index ec9f014d04..927aa049d4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/byteoffset.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/byteoffset.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Chengzhong Wu. 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/TypedArray/prototype/copyWithin/coerced-values-end-detached-prototype.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-end-detached-prototype.js index 2b687ed165..17fb256515 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-end-detached-prototype.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-end-detached-prototype.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2019 Google. 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/TypedArray/prototype/copyWithin/coerced-values-end-detached.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-end-detached.js index 484f388021..3505f5e46d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-end-detached.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-end-detached.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2019 Google. 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/TypedArray/prototype/copyWithin/coerced-values-end.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-end.js index 01a44699d5..252941dc59 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-end.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-end.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/TypedArray/prototype/copyWithin/coerced-values-start-detached.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-start-detached.js index 559d3a18df..81bca9bdfd 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-start-detached.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-start-detached.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2019 Google. 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/TypedArray/prototype/copyWithin/coerced-values-start.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-start.js index 9eb1399586..dbbe1eca2b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-start.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-start.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/TypedArray/prototype/copyWithin/coerced-values-target.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-target.js index cfe5773f8f..22f0a180da 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-target.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/coerced-values-target.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/TypedArray/prototype/copyWithin/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/detached-buffer.js index 78e7bbda66..48f65c7244 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/detached-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/TypedArray/prototype/copyWithin/get-length-ignores-length-prop.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/get-length-ignores-length-prop.js index d5cc8f993d..70e43bb49a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/get-length-ignores-length-prop.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/get-length-ignores-length-prop.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/TypedArray/prototype/copyWithin/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/invoked-as-func.js index 61da74b61a..14d0fd743b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/invoked-as-func.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/TypedArray/prototype/copyWithin/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/invoked-as-method.js index 1c7783022f..abdc42c3e7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/invoked-as-method.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/TypedArray/prototype/copyWithin/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/length.js index f7652c91da..e52c164dcf 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.copyWithin.length, 2); - -verifyNotEnumerable(TypedArray.prototype.copyWithin, "length"); -verifyNotWritable(TypedArray.prototype.copyWithin, "length"); -verifyConfigurable(TypedArray.prototype.copyWithin, "length"); +verifyProperty(TypedArray.prototype.copyWithin, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/name.js index 7a888ea988..12e395b7ec 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.copyWithin.name, "copyWithin"); - -verifyNotEnumerable(TypedArray.prototype.copyWithin, "name"); -verifyNotWritable(TypedArray.prototype.copyWithin, "name"); -verifyConfigurable(TypedArray.prototype.copyWithin, "name"); +verifyProperty(TypedArray.prototype.copyWithin, "name", { + value: "copyWithin", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-end.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-end.js index 51fdfe1ab0..2027336179 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-end.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-end.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/TypedArray/prototype/copyWithin/negative-out-of-bounds-end.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-end.js index 97ae46c850..4393bdde66 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-end.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-end.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/TypedArray/prototype/copyWithin/negative-out-of-bounds-start.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-start.js index 31cfc40993..1d53604a5f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-start.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-start.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/TypedArray/prototype/copyWithin/negative-out-of-bounds-target.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-target.js index ac9c07bf31..651a0761d1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-target.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-target.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/TypedArray/prototype/copyWithin/negative-start.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-start.js index 21c18b503e..feb6d8b9ce 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-start.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-start.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/TypedArray/prototype/copyWithin/negative-target.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-target.js index b8fc48835a..288f507766 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-target.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/negative-target.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/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-end.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-end.js index 569b7d95b4..1af316d086 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-end.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-end.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/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js index d2b7e87fbc..edaa63bce5 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.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/TypedArray/prototype/copyWithin/non-negative-target-and-start.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/non-negative-target-and-start.js index d0d152e3d2..ddf884f514 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/non-negative-target-and-start.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/non-negative-target-and-start.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/TypedArray/prototype/copyWithin/non-negative-target-start-and-end.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/non-negative-target-start-and-end.js index 62a6bfcd4a..fcd2962426 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/non-negative-target-start-and-end.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/non-negative-target-start-and-end.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/TypedArray/prototype/copyWithin/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/not-a-constructor.js index 34042bfc79..96ab695c1f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.copyWithin(); -}, '`let u8 = new Uint8Array(1); new u8.copyWithin()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/prop-desc.js index 96da143cac..31ae3e64c6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/prop-desc.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/TypedArray/prototype/copyWithin/return-abrupt-from-end-is-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-end-is-symbol.js index 09d60ac7d1..6adcb9f266 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-end-is-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-end-is-symbol.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/TypedArray/prototype/copyWithin/return-abrupt-from-end.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-end.js index 5d7ef05e4e..12066c7c01 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-end.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-end.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/TypedArray/prototype/copyWithin/return-abrupt-from-start-is-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-start-is-symbol.js index 4a5455bf26..a46ea66ef5 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-start-is-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-start-is-symbol.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/TypedArray/prototype/copyWithin/return-abrupt-from-start.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-start.js index 6a0843ae3f..d87c5dcb9c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-start.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-start.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/TypedArray/prototype/copyWithin/return-abrupt-from-target-is-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-target-is-symbol.js index a1148053a7..85fc5f07ee 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-target-is-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-target-is-symbol.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/TypedArray/prototype/copyWithin/return-abrupt-from-target.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-target.js index 0e9c56d1a2..06c396b8a8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-target.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-target.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/TypedArray/prototype/copyWithin/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-this-out-of-bounds.js index 4335158b50..f29e67a2f4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/copyWithin/return-this.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-this.js index 2ff0381574..b339b2ee48 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-this.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/return-this.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/TypedArray/prototype/copyWithin/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/this-is-not-object.js index 7f19b0b3ef..bc8457b1c7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/this-is-not-object.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/TypedArray/prototype/copyWithin/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/this-is-not-typedarray-instance.js index 9bd0b0458d..358643d1a3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/this-is-not-typedarray-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/TypedArray/prototype/copyWithin/undefined-end.js b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/undefined-end.js index e4e7072486..4d04dd440e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/undefined-end.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/copyWithin/undefined-end.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/TypedArray/prototype/entries/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/detached-buffer.js index 4a644f910c..b3e18e6f6f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/entries/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/detached-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/TypedArray/prototype/entries/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/invoked-as-func.js index 1e5894ad29..6f3526bd98 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/entries/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/invoked-as-func.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/TypedArray/prototype/entries/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/invoked-as-method.js index 17ce58a45c..9fb1f3de90 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/entries/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/invoked-as-method.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/TypedArray/prototype/entries/iter-prototype.js b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/iter-prototype.js index 7637d66454..89f60b422f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/entries/iter-prototype.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/iter-prototype.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/TypedArray/prototype/entries/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/length.js index f7c54bd2a0..0d7d3e87c7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/entries/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.entries.length, 0); - -verifyNotEnumerable(TypedArray.prototype.entries, "length"); -verifyNotWritable(TypedArray.prototype.entries, "length"); -verifyConfigurable(TypedArray.prototype.entries, "length"); +verifyProperty(TypedArray.prototype.entries, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/entries/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/name.js index 4947bc59fa..2e84afb33a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/entries/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.entries.name, "entries"); - -verifyNotEnumerable(TypedArray.prototype.entries, "name"); -verifyNotWritable(TypedArray.prototype.entries, "name"); -verifyConfigurable(TypedArray.prototype.entries, "name"); +verifyProperty(TypedArray.prototype.entries, "name", { + value: "entries", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/entries/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/not-a-constructor.js index 8b28d47a0f..c7b6d4c120 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/entries/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.entries(); -}, '`let u8 = new Uint8Array(1); new u8.entries()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/entries/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/prop-desc.js index ce4a744117..352e2ebf53 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/entries/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/prop-desc.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/TypedArray/prototype/entries/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/return-abrupt-from-this-out-of-bounds.js index 7b4f90f25a..ab788c1ac8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/entries/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/entries/return-itor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/return-itor.js index 16923a967c..e1bb6478f2 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/entries/return-itor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/return-itor.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/TypedArray/prototype/entries/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/this-is-not-object.js index 58afdee779..8943ba9f63 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/entries/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/this-is-not-object.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/TypedArray/prototype/entries/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/this-is-not-typedarray-instance.js index f0574cd6b2..5d3ba24265 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/entries/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/entries/this-is-not-typedarray-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/TypedArray/prototype/every/callbackfn-arguments-with-thisarg.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-arguments-with-thisarg.js index 643e3d9ab1..bf2f2581f1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-arguments-with-thisarg.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-arguments-with-thisarg.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/TypedArray/prototype/every/callbackfn-arguments-without-thisarg.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-arguments-without-thisarg.js index 3db2e4efb3..f030f60ac3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-arguments-without-thisarg.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-arguments-without-thisarg.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/TypedArray/prototype/every/callbackfn-detachbuffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-detachbuffer.js index c31447279d..855d890f50 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-detachbuffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-detachbuffer.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/TypedArray/prototype/every/callbackfn-no-interaction-over-non-integer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-no-interaction-over-non-integer.js index b9f512de47..e7f3019b27 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-no-interaction-over-non-integer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-no-interaction-over-non-integer.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/TypedArray/prototype/every/callbackfn-not-callable-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-not-callable-throws.js index a3a9538f6a..5f8b86346b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-not-callable-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-not-callable-throws.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/TypedArray/prototype/every/callbackfn-not-called-on-empty.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-not-called-on-empty.js index 5218382720..5ee88ee3a5 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-not-called-on-empty.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-not-called-on-empty.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/TypedArray/prototype/every/callbackfn-resize.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-resize.js index 97dc191eaf..d141515703 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-resize.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-resize.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/TypedArray/prototype/every/callbackfn-return-does-not-change-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-return-does-not-change-instance.js index 8f6678cf55..102e2b0752 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-return-does-not-change-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-return-does-not-change-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/TypedArray/prototype/every/callbackfn-returns-abrupt.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-returns-abrupt.js index 4b7474124c..81222a5a2e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-returns-abrupt.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-returns-abrupt.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/TypedArray/prototype/every/callbackfn-set-value-during-interaction.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-set-value-during-interaction.js index b9d28709b8..477f776630 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-set-value-during-interaction.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-set-value-during-interaction.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/TypedArray/prototype/every/callbackfn-this.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-this.js index 0619270eaf..e5f184182e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-this.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/callbackfn-this.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/TypedArray/prototype/every/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/detached-buffer.js index 22e87b85f5..39d5c603c9 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/detached-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/TypedArray/prototype/every/get-length-uses-internal-arraylength.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/get-length-uses-internal-arraylength.js index ec9c9ae8ef..3a173694db 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/get-length-uses-internal-arraylength.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/get-length-uses-internal-arraylength.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/TypedArray/prototype/every/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/invoked-as-func.js index c62503b63e..a9225b5fec 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/invoked-as-func.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/TypedArray/prototype/every/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/invoked-as-method.js index f7e77e539b..f596f4c44d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/invoked-as-method.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/TypedArray/prototype/every/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/length.js index af76735482..140327c4c2 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.every.length, 1); - -verifyNotEnumerable(TypedArray.prototype.every, "length"); -verifyNotWritable(TypedArray.prototype.every, "length"); -verifyConfigurable(TypedArray.prototype.every, "length"); +verifyProperty(TypedArray.prototype.every, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/every/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/name.js index 53cae5735e..73531de5e2 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.every.name, "every"); - -verifyNotEnumerable(TypedArray.prototype.every, "name"); -verifyNotWritable(TypedArray.prototype.every, "name"); -verifyConfigurable(TypedArray.prototype.every, "name"); +verifyProperty(TypedArray.prototype.every, "name", { + value: "every", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/every/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/not-a-constructor.js index 16bffa2af1..e84209e404 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.every(() => {}); -}, '`let u8 = new Uint8Array(1); new u8.every(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/every/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/prop-desc.js index f4d99d733a..eff1286ae9 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/prop-desc.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/TypedArray/prototype/every/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/return-abrupt-from-this-out-of-bounds.js index e9215ead91..460e0dba54 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/every/returns-false-if-any-cb-returns-false.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/returns-false-if-any-cb-returns-false.js index 437bfd2b3d..0fdd31d60b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/returns-false-if-any-cb-returns-false.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/returns-false-if-any-cb-returns-false.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/TypedArray/prototype/every/returns-true-if-every-cb-returns-true.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/returns-true-if-every-cb-returns-true.js index b75a13bb27..19612096fd 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/returns-true-if-every-cb-returns-true.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/returns-true-if-every-cb-returns-true.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/TypedArray/prototype/every/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/this-is-not-object.js index 9086272c65..fc002d4370 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/this-is-not-object.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/TypedArray/prototype/every/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/this-is-not-typedarray-instance.js index 5d73f3d3d0..626bd565f2 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/this-is-not-typedarray-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/TypedArray/prototype/every/values-are-not-cached.js b/js/src/tests/test262/built-ins/TypedArray/prototype/every/values-are-not-cached.js index 6b64c3fb8d..07a714edfd 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/every/values-are-not-cached.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/every/values-are-not-cached.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/TypedArray/prototype/fill/absent-indices-computed-from-initial-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/absent-indices-computed-from-initial-length.js new file mode 100644 index 0000000000..e2ae779081 --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/absent-indices-computed-from-initial-length.js @@ -0,0 +1,54 @@ +// |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-%typedarray%.prototype.fill +description: > + Absent start and end parameters are computed from initial length. +info: | + %TypedArray%.prototype.fill ( value [ , start [ , end ] ] ) + + ... + 2. Let taRecord be ? ValidateTypedArray(O, seq-cst). + 3. Let len be TypedArrayLength(taRecord). + ... + 5. Otherwise, set value to ? ToNumber(value). + 6. Let relativeStart be ? ToIntegerOrInfinity(start). + ... + 9. Else, let startIndex be min(relativeStart, len). + 10. If end is undefined, let relativeEnd be len; else let relativeEnd be ? ToIntegerOrInfinity(end). + ... + 13. Else, let endIndex be min(relativeEnd, len). + ... + +features: [TypedArray, resizable-arraybuffer] +---*/ + +let rab = new ArrayBuffer(1, {maxByteLength: 4}); +let ta = new Int8Array(rab); + +let value = { + valueOf() { + // Set buffer to maximum byte length. + rab.resize(4); + + // Return the fill value. + return 123; + } +}; + +// Ensure typed array is correctly initialised. +assert.sameValue(ta.length, 1); +assert.sameValue(ta[0], 0); + +ta.fill(value); + +// Ensure typed array has correct length and only the first element was filled. +assert.sameValue(ta.length, 4); +assert.sameValue(ta[0], 123); +assert.sameValue(ta[1], 0); +assert.sameValue(ta[2], 0); +assert.sameValue(ta[3], 0); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/coerced-end-detach.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/coerced-end-detach.js index ccaa1ae6bd..44881f8a7e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/coerced-end-detach.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/coerced-end-detach.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Google. 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/TypedArray/prototype/fill/coerced-indexes.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/coerced-indexes.js index f2f78c3d39..43225f1632 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/coerced-indexes.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/coerced-indexes.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/TypedArray/prototype/fill/coerced-start-detach.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/coerced-start-detach.js index 63656210b1..891c1e1c05 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/coerced-start-detach.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/coerced-start-detach.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Google. 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/TypedArray/prototype/fill/coerced-value-detach.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/coerced-value-detach.js index cdfa9efd88..b7bc5c54e2 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/coerced-value-detach.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/coerced-value-detach.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Google. 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/TypedArray/prototype/fill/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/detached-buffer.js index e81231bc64..c43330e575 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/detached-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/TypedArray/prototype/fill/fill-values-conversion-once.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-conversion-once.js index 0abceac140..1a9c45bfa3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-conversion-once.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-conversion-once.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2017 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/TypedArray/prototype/fill/fill-values-conversion-operations-consistent-nan.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-conversion-operations-consistent-nan.js index 0990868026..2263805084 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-conversion-operations-consistent-nan.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-conversion-operations-consistent-nan.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/TypedArray/prototype/fill/fill-values-conversion-operations.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-conversion-operations.js index c23bfe9b2b..78325d980f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-conversion-operations.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-conversion-operations.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/TypedArray/prototype/fill/fill-values-custom-start-and-end.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-custom-start-and-end.js index 7f8d6dd51f..802022c54b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-custom-start-and-end.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-custom-start-and-end.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/TypedArray/prototype/fill/fill-values-non-numeric.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-non-numeric.js index 371f9bde5f..70b83203ce 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-non-numeric.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-non-numeric.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/TypedArray/prototype/fill/fill-values-relative-end.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-relative-end.js index 086bf5d1b9..f324c228a7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-relative-end.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-relative-end.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/TypedArray/prototype/fill/fill-values-relative-start.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-relative-start.js index d418285a8e..af824a5dcb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-relative-start.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-relative-start.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/TypedArray/prototype/fill/fill-values-symbol-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-symbol-throws.js index 48bbe9c94e..08b9ee6ae8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-symbol-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values-symbol-throws.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/TypedArray/prototype/fill/fill-values.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values.js index a3a4bad901..c9315ee3e5 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/fill-values.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/TypedArray/prototype/fill/get-length-ignores-length-prop.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/get-length-ignores-length-prop.js index bdd67a6212..085264a17f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/get-length-ignores-length-prop.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/get-length-ignores-length-prop.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/TypedArray/prototype/fill/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/invoked-as-func.js index 10b81cbf80..7845158253 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/invoked-as-func.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/TypedArray/prototype/fill/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/invoked-as-method.js index 2293f0644a..1ab0241f6d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/invoked-as-method.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/TypedArray/prototype/fill/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/length.js index 2106e754bc..7427e6459a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.fill.length, 1); - -verifyNotEnumerable(TypedArray.prototype.fill, "length"); -verifyNotWritable(TypedArray.prototype.fill, "length"); -verifyConfigurable(TypedArray.prototype.fill, "length"); +verifyProperty(TypedArray.prototype.fill, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/name.js index c1e6729cee..5fe1511722 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.fill.name, "fill"); - -verifyNotEnumerable(TypedArray.prototype.fill, "name"); -verifyNotWritable(TypedArray.prototype.fill, "name"); -verifyConfigurable(TypedArray.prototype.fill, "name"); +verifyProperty(TypedArray.prototype.fill, "name", { + value: "fill", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/not-a-constructor.js index 984f6435ce..ebc79348f6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.fill(); -}, '`let u8 = new Uint8Array(1); new u8.fill()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/prop-desc.js index b9de7e83b7..91e78b8b2a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/prop-desc.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/TypedArray/prototype/fill/return-abrupt-from-end-as-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-end-as-symbol.js index 0c77c38dcd..54a911522f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-end-as-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-end-as-symbol.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/TypedArray/prototype/fill/return-abrupt-from-end.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-end.js index aa95620a25..506a1fdf71 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-end.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-end.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/TypedArray/prototype/fill/return-abrupt-from-set-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-set-value.js index 90d3c469ac..dd3266124a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-set-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-set-value.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/TypedArray/prototype/fill/return-abrupt-from-start-as-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-start-as-symbol.js index 2a94acc7e4..6b2ab793e0 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-start-as-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-start-as-symbol.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/TypedArray/prototype/fill/return-abrupt-from-start.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-start.js index e7016c9159..afe1580f6b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-start.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-start.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/TypedArray/prototype/fill/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-this-out-of-bounds.js index 2f1fec95a1..709a6a6fc4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/fill/return-this.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-this.js index afba1718ac..aa940228fc 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-this.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/return-this.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/TypedArray/prototype/fill/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/this-is-not-object.js index 17d8f004c5..5b5fe09212 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/this-is-not-object.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/TypedArray/prototype/fill/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/this-is-not-typedarray-instance.js index 4568ee60c1..cbaeac38ea 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/fill/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/fill/this-is-not-typedarray-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/TypedArray/prototype/filter/arraylength-internal.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/arraylength-internal.js index 33c21ff6f6..c4af66e07b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/arraylength-internal.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/arraylength-internal.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/TypedArray/prototype/filter/callbackfn-arguments-with-thisarg.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-arguments-with-thisarg.js index 35859300b2..41d142d699 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-arguments-with-thisarg.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-arguments-with-thisarg.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/TypedArray/prototype/filter/callbackfn-arguments-without-thisarg.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-arguments-without-thisarg.js index 4b64fc8fe4..afb437336c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-arguments-without-thisarg.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-arguments-without-thisarg.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/TypedArray/prototype/filter/callbackfn-called-before-ctor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-called-before-ctor.js index 1d4cdffd48..e0bffe0f09 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-called-before-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-called-before-ctor.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/TypedArray/prototype/filter/callbackfn-called-before-species.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-called-before-species.js index e4294991a3..5bd94f2290 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-called-before-species.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-called-before-species.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/TypedArray/prototype/filter/callbackfn-detachbuffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-detachbuffer.js index 27ea1c0524..d3e06e1464 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-detachbuffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-detachbuffer.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/TypedArray/prototype/filter/callbackfn-no-iteration-over-non-integer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-no-iteration-over-non-integer.js index 0c88c6a18b..cc343e93ba 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-no-iteration-over-non-integer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-no-iteration-over-non-integer.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/TypedArray/prototype/filter/callbackfn-not-callable-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-not-callable-throws.js index e14ad06554..96aa2376ec 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-not-callable-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-not-callable-throws.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/TypedArray/prototype/filter/callbackfn-not-called-on-empty.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-not-called-on-empty.js index b9de4395ac..e3c22bf7f7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-not-called-on-empty.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-not-called-on-empty.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/TypedArray/prototype/filter/callbackfn-resize.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-resize.js index c11fbfabd6..5bcf83822e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-resize.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-resize.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/TypedArray/prototype/filter/callbackfn-return-does-not-change-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-return-does-not-change-instance.js index 6dfefa332e..da8f248ff8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-return-does-not-change-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-return-does-not-change-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/TypedArray/prototype/filter/callbackfn-returns-abrupt.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-returns-abrupt.js index 8b40373c4a..ef53548249 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-returns-abrupt.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-returns-abrupt.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/TypedArray/prototype/filter/callbackfn-set-value-during-iteration.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-set-value-during-iteration.js index 4f42d5a7f2..115ec2c23a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-set-value-during-iteration.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-set-value-during-iteration.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/TypedArray/prototype/filter/callbackfn-this.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-this.js index 500140145c..8a9b7f80dd 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-this.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/callbackfn-this.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/TypedArray/prototype/filter/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/detached-buffer.js index 56763ff852..f41c66fdd6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/detached-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/TypedArray/prototype/filter/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/invoked-as-func.js index 6b2b117b87..ff10f2e89a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/invoked-as-func.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/TypedArray/prototype/filter/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/invoked-as-method.js index e05b086e7e..bf96655c59 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/invoked-as-method.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/TypedArray/prototype/filter/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/length.js index 43eb0a71d7..e24910e251 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.filter.length, 1); - -verifyNotEnumerable(TypedArray.prototype.filter, "length"); -verifyNotWritable(TypedArray.prototype.filter, "length"); -verifyConfigurable(TypedArray.prototype.filter, "length"); +verifyProperty(TypedArray.prototype.filter, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/name.js index 517b0a9b17..db0d552c0f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.filter.name, "filter"); - -verifyNotEnumerable(TypedArray.prototype.filter, "name"); -verifyNotWritable(TypedArray.prototype.filter, "name"); -verifyConfigurable(TypedArray.prototype.filter, "name"); +verifyProperty(TypedArray.prototype.filter, "name", { + value: "filter", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/not-a-constructor.js index 403a52833e..b88ca7fd3a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.filter(() => {}); -}, '`let u8 = new Uint8Array(1); new u8.filter(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/prop-desc.js index 4fd22727f2..428194e07c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/prop-desc.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/TypedArray/prototype/filter/result-does-not-share-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/result-does-not-share-buffer.js index f9c95146bb..e39b204533 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/result-does-not-share-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/result-does-not-share-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/TypedArray/prototype/filter/result-empty-callbackfn-returns-false.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/result-empty-callbackfn-returns-false.js index 333865b7f9..991f488edf 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/result-empty-callbackfn-returns-false.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/result-empty-callbackfn-returns-false.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/TypedArray/prototype/filter/result-full-callbackfn-returns-true.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/result-full-callbackfn-returns-true.js index ebdc9cd740..bb5da95a23 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/result-full-callbackfn-returns-true.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/result-full-callbackfn-returns-true.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/TypedArray/prototype/filter/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/return-abrupt-from-this-out-of-bounds.js index fea18d1f0d..9a46dae8ff 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/filter/speciesctor-destination-resizable.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-destination-resizable.js index 65c4d3db3e..74954ac780 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-destination-resizable.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-destination-resizable.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) 2023 Igalia, S.L. 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/TypedArray/prototype/filter/speciesctor-get-ctor-abrupt.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-abrupt.js index d3ff3fa259..645b1a2f59 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-abrupt.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-abrupt.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/TypedArray/prototype/filter/speciesctor-get-ctor-inherited.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-inherited.js index 264a90ef1e..5e79c2d6aa 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-inherited.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-inherited.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/TypedArray/prototype/filter/speciesctor-get-ctor-returns-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-returns-throws.js index bf3e736c60..6d0195c146 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-returns-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-returns-throws.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/TypedArray/prototype/filter/speciesctor-get-ctor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor.js index df73eb95af..315bddaae5 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor.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/TypedArray/prototype/filter/speciesctor-get-species-abrupt.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-abrupt.js index 2c3ca7cce1..5500c0a55a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-abrupt.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-abrupt.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/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-invocation.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-invocation.js index 233bab0335..7859b12810 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-invocation.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-invocation.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/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js index 1408f79470..8203b94e93 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-length-throws-resizable-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) 2023 Igalia, S.L. 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/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-length-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-length-throws.js index e95a16d1af..5f3bb10c55 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-length-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-length-throws.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/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-length.js index 7b2ef2a03a..dda264b286 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-length.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/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-returns-another-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-returns-another-instance.js index f0bb676bbd..f11de582c7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-returns-another-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-returns-another-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/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-throws.js index 795267c2a3..29f4412124 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-throws.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/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor.js index 2a8a77a84e..168c101383 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor.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/TypedArray/prototype/filter/speciesctor-get-species-returns-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-returns-throws.js index c7be1baf0b..a0f4aca8e3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-returns-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-returns-throws.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/TypedArray/prototype/filter/speciesctor-get-species-use-default-ctor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-use-default-ctor.js index eceb6c5440..8f03a32f10 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-use-default-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species-use-default-ctor.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/TypedArray/prototype/filter/speciesctor-get-species.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species.js index e9139c9c20..e65b0809dc 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/speciesctor-get-species.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/TypedArray/prototype/filter/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/this-is-not-object.js index 53275207fd..0f8bee7e41 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/this-is-not-object.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/TypedArray/prototype/filter/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/this-is-not-typedarray-instance.js index e223f362dc..29ec2b83cf 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/this-is-not-typedarray-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/TypedArray/prototype/filter/values-are-not-cached.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/values-are-not-cached.js index e9f070db01..b62ed2f880 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/values-are-not-cached.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/values-are-not-cached.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/TypedArray/prototype/filter/values-are-set.js b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/values-are-set.js index f819a8fd83..bcad70a7f1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/filter/values-are-set.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/filter/values-are-set.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/TypedArray/prototype/find/callbackfn-resize.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/callbackfn-resize.js index faf3e09ace..8aed7fb8db 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/callbackfn-resize.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/callbackfn-resize.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/TypedArray/prototype/find/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/detached-buffer.js index 5de4a56041..f5039a14fe 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/detached-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/TypedArray/prototype/find/get-length-ignores-length-prop.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/get-length-ignores-length-prop.js index ff41a27af9..5afd88bb6a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/get-length-ignores-length-prop.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/get-length-ignores-length-prop.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/TypedArray/prototype/find/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/invoked-as-func.js index e63cc49e07..1cb40629d8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/invoked-as-func.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/TypedArray/prototype/find/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/invoked-as-method.js index a4d8b598ba..472f26ba99 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/invoked-as-method.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/TypedArray/prototype/find/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/length.js index 1583fe26d2..dc9eaeb1c1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.find.length, 1); - -verifyNotEnumerable(TypedArray.prototype.find, "length"); -verifyNotWritable(TypedArray.prototype.find, "length"); -verifyConfigurable(TypedArray.prototype.find, "length"); +verifyProperty(TypedArray.prototype.find, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/find/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/name.js index 1d1f09f6b8..e9e781cc0e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.find.name, "find"); - -verifyNotEnumerable(TypedArray.prototype.find, "name"); -verifyNotWritable(TypedArray.prototype.find, "name"); -verifyConfigurable(TypedArray.prototype.find, "name"); +verifyProperty(TypedArray.prototype.find, "name", { + value: "find", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/find/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/not-a-constructor.js index c7453c01f2..222f8ee1e4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.find(() => {}); -}, '`let u8 = new Uint8Array(1); new u8.find(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-call-changes-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-call-changes-value.js index 7dcaccf39b..8fe7135dbb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-call-changes-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-call-changes-value.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/TypedArray/prototype/find/predicate-call-parameters.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-call-parameters.js index 3df875dc37..4b9b7c6181 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-call-parameters.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-call-parameters.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/TypedArray/prototype/find/predicate-call-this-non-strict.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-call-this-non-strict.js index b96f0ee394..f0855b64a4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-call-this-non-strict.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-call-this-non-strict.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/TypedArray/prototype/find/predicate-call-this-strict-strict.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-call-this-strict-strict.js index 207b73208c..23f3c2222e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-call-this-strict-strict.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-call-this-strict-strict.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) 'use strict'; // 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/TypedArray/prototype/find/predicate-is-not-callable-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-is-not-callable-throws.js index 40f7c959dd..e1cef73142 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-is-not-callable-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-is-not-callable-throws.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/TypedArray/prototype/find/predicate-may-detach-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-may-detach-buffer.js index ca16ed882d..646c5b49fb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-may-detach-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-may-detach-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/TypedArray/prototype/find/predicate-not-called-on-empty-array.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-not-called-on-empty-array.js index 7ea189e4b1..35ff0b381e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-not-called-on-empty-array.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/predicate-not-called-on-empty-array.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/TypedArray/prototype/find/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/prop-desc.js index ed0168a1cd..26844b760f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/prop-desc.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/TypedArray/prototype/find/return-abrupt-from-predicate-call.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/return-abrupt-from-predicate-call.js index 2215239c21..ac2232d5a3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/return-abrupt-from-predicate-call.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/return-abrupt-from-predicate-call.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/TypedArray/prototype/find/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/return-abrupt-from-this-out-of-bounds.js index 3ec89c8902..d9f728cfa1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/find/return-found-value-predicate-result-is-true.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/return-found-value-predicate-result-is-true.js index f5cfd69ff7..6701a42d00 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/return-found-value-predicate-result-is-true.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/return-found-value-predicate-result-is-true.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/TypedArray/prototype/find/return-undefined-if-predicate-returns-false-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/return-undefined-if-predicate-returns-false-value.js index bbfa0928e9..c00e18b93c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/return-undefined-if-predicate-returns-false-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/return-undefined-if-predicate-returns-false-value.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/TypedArray/prototype/find/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/this-is-not-object.js index 9a6479ee49..5df0c8a1b2 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/this-is-not-object.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/TypedArray/prototype/find/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/find/this-is-not-typedarray-instance.js index cdec6e01ad..5cf1abef6f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/find/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/find/this-is-not-typedarray-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/TypedArray/prototype/findIndex/callbackfn-resize.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/callbackfn-resize.js index 6b820315b9..58e1de8613 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/callbackfn-resize.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/callbackfn-resize.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/TypedArray/prototype/findIndex/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/detached-buffer.js index b936c3dc74..532c6f98c0 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/detached-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/TypedArray/prototype/findIndex/get-length-ignores-length-prop.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/get-length-ignores-length-prop.js index 19f41d6844..b25f4f1cc9 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/get-length-ignores-length-prop.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/get-length-ignores-length-prop.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/TypedArray/prototype/findIndex/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/invoked-as-func.js index 4d1c3dbcaf..580e734514 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/invoked-as-func.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/TypedArray/prototype/findIndex/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/invoked-as-method.js index e787cd2dfc..1074567ec1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/invoked-as-method.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/TypedArray/prototype/findIndex/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/length.js index 47fd253eef..469cb12f45 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.findIndex.length, 1); - -verifyNotEnumerable(TypedArray.prototype.findIndex, "length"); -verifyNotWritable(TypedArray.prototype.findIndex, "length"); -verifyConfigurable(TypedArray.prototype.findIndex, "length"); +verifyProperty(TypedArray.prototype.findIndex, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/name.js index efe006ee61..9449c89d33 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.findIndex.name, "findIndex"); - -verifyNotEnumerable(TypedArray.prototype.findIndex, "name"); -verifyNotWritable(TypedArray.prototype.findIndex, "name"); -verifyConfigurable(TypedArray.prototype.findIndex, "name"); +verifyProperty(TypedArray.prototype.findIndex, "name", { + value: "findIndex", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/not-a-constructor.js index c41db60aef..d76e1fbebb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.findIndex(() => {}); -}, '`let u8 = new Uint8Array(1); new u8.findIndex(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-call-changes-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-call-changes-value.js index 8ee1fcccae..e4852f2ff6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-call-changes-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-call-changes-value.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/TypedArray/prototype/findIndex/predicate-call-parameters.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-call-parameters.js index 86ec93c907..db366042e7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-call-parameters.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-call-parameters.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/TypedArray/prototype/findIndex/predicate-call-this-non-strict.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-call-this-non-strict.js index db41c2cae1..44136d1a82 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-call-this-non-strict.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-call-this-non-strict.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/TypedArray/prototype/findIndex/predicate-call-this-strict-strict.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-call-this-strict-strict.js index d13f4c3bcf..76fe16e62e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-call-this-strict-strict.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-call-this-strict-strict.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) 'use strict'; // 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/TypedArray/prototype/findIndex/predicate-is-not-callable-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-is-not-callable-throws.js index cc43dfd920..8dbeb26dc8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-is-not-callable-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-is-not-callable-throws.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/TypedArray/prototype/findIndex/predicate-may-detach-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-may-detach-buffer.js index a86b1b06b0..a87daf661a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-may-detach-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-may-detach-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/TypedArray/prototype/findIndex/predicate-not-called-on-empty-array.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-not-called-on-empty-array.js index 5ad0de0f26..19c8af911b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-not-called-on-empty-array.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/predicate-not-called-on-empty-array.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/TypedArray/prototype/findIndex/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/prop-desc.js index 26f01cd00a..2898dfb805 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/prop-desc.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/TypedArray/prototype/findIndex/return-abrupt-from-predicate-call.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/return-abrupt-from-predicate-call.js index abb7c66056..55f53cc8da 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/return-abrupt-from-predicate-call.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/return-abrupt-from-predicate-call.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/TypedArray/prototype/findIndex/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/return-abrupt-from-this-out-of-bounds.js index d41faea12a..d8e7dd35b7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/findIndex/return-index-predicate-result-is-true.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/return-index-predicate-result-is-true.js index c0c0a8a07b..6f15afb6b1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/return-index-predicate-result-is-true.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/return-index-predicate-result-is-true.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/TypedArray/prototype/findIndex/return-negative-one-if-predicate-returns-false-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/return-negative-one-if-predicate-returns-false-value.js index e17e63a44b..d2667bae6f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/return-negative-one-if-predicate-returns-false-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/return-negative-one-if-predicate-returns-false-value.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/TypedArray/prototype/findIndex/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/this-is-not-object.js index 5297a42273..0901b90e10 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/this-is-not-object.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/TypedArray/prototype/findIndex/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/this-is-not-typedarray-instance.js index 60b87b1561..afbe2d98df 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findIndex/this-is-not-typedarray-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/TypedArray/prototype/findLast/callbackfn-resize.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/callbackfn-resize.js index 1e30c04bfd..4e3a422ff2 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/callbackfn-resize.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/callbackfn-resize.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/TypedArray/prototype/findLast/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/detached-buffer.js index 4aa8408d8b..50578225db 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/detached-buffer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/get-length-ignores-length-prop.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/get-length-ignores-length-prop.js index 2914416949..9a961f226e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/get-length-ignores-length-prop.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/get-length-ignores-length-prop.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/invoked-as-func.js index ccfb329e0b..07cced9ad6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/invoked-as-func.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/invoked-as-method.js index cb1bc32592..4878a90b0a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/invoked-as-method.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/length.js index 0513865dd8..37c04d2a86 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/name.js index 4ed9497836..b3d95cfe83 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/not-a-constructor.js index 0aa9fd189c..525852aa6a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.findLast(() => {}); -}, '`let u8 = new Uint8Array(1); new u8.findLast(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-call-changes-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-call-changes-value.js index fa6d96cb83..ee31cec69d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-call-changes-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-call-changes-value.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/predicate-call-parameters.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-call-parameters.js index b31a93f459..88f9cbe7a2 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-call-parameters.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-call-parameters.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/predicate-call-this-non-strict.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-call-this-non-strict.js index b35b25e9f2..c573a47072 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-call-this-non-strict.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-call-this-non-strict.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/predicate-call-this-strict-strict.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-call-this-strict-strict.js index 6c9b6936bf..5477085dbe 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-call-this-strict-strict.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-call-this-strict-strict.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) 'use strict'; // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/predicate-is-not-callable-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-is-not-callable-throws.js index 4e46f36162..c985b86afb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-is-not-callable-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-is-not-callable-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/predicate-may-detach-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-may-detach-buffer.js index 51cc7dad9a..d11ad4f14b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-may-detach-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-may-detach-buffer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/predicate-not-called-on-empty-array.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-not-called-on-empty-array.js index ffe6e0a944..a9319ec4b2 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-not-called-on-empty-array.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/predicate-not-called-on-empty-array.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/prop-desc.js index bc0ad32e75..3f4098b8a7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/prop-desc.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/return-abrupt-from-predicate-call.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/return-abrupt-from-predicate-call.js index b18ead0dc0..6b76c97118 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/return-abrupt-from-predicate-call.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/return-abrupt-from-predicate-call.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/return-abrupt-from-this-out-of-bounds.js index 5b1641f81d..406ac6ef97 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/return-abrupt-from-this-out-of-bounds.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 Microsoft. 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/TypedArray/prototype/findLast/return-found-value-predicate-result-is-true.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/return-found-value-predicate-result-is-true.js index 842492b522..90c8e943d1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/return-found-value-predicate-result-is-true.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/return-found-value-predicate-result-is-true.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/return-undefined-if-predicate-returns-false-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/return-undefined-if-predicate-returns-false-value.js index 313915e115..748670de1e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/return-undefined-if-predicate-returns-false-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/return-undefined-if-predicate-returns-false-value.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/this-is-not-object.js index 8e3cd5e0fb..a0416e1bad 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/this-is-not-object.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLast/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/this-is-not-typedarray-instance.js index d86c6593a8..38f21ba53d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLast/this-is-not-typedarray-instance.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/callbackfn-resize.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/callbackfn-resize.js index 49814daf75..cd34b58f24 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/callbackfn-resize.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/callbackfn-resize.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/TypedArray/prototype/findLastIndex/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/detached-buffer.js index 953b277879..c17b5a6000 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/detached-buffer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/get-length-ignores-length-prop.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/get-length-ignores-length-prop.js index 389ec09afa..cfa812a0b8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/get-length-ignores-length-prop.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/get-length-ignores-length-prop.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/invoked-as-func.js index bec6bb9b56..b5c7345b50 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/invoked-as-func.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/invoked-as-method.js index 89ee3f90f7..71cb3de75d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/invoked-as-method.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/length.js index 9586c335a5..f6dce29629 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/name.js index 87e4639963..6df3d55193 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/not-a-constructor.js index ec57906ae8..3f08ec6126 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.findLastIndex(() => {}); -}, '`let u8 = new Uint8Array(1); new u8.findLastIndex(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-call-changes-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-call-changes-value.js index d288354edd..881ebec44a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-call-changes-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-call-changes-value.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/predicate-call-parameters.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-call-parameters.js index 6fd62813ea..03dc1a3e42 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-call-parameters.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-call-parameters.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/predicate-call-this-non-strict.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-call-this-non-strict.js index 3c82732709..2c89afded1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-call-this-non-strict.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-call-this-non-strict.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/predicate-call-this-strict-strict.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-call-this-strict-strict.js index db22a84372..842a570cfb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-call-this-strict-strict.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-call-this-strict-strict.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) 'use strict'; // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/predicate-is-not-callable-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-is-not-callable-throws.js index 3785ecdac2..9b580e2b45 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-is-not-callable-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-is-not-callable-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/predicate-may-detach-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-may-detach-buffer.js index 9edb72ff2f..7bc92ad6f3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-may-detach-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-may-detach-buffer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/predicate-not-called-on-empty-array.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-not-called-on-empty-array.js index 857a521897..28ad969074 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-not-called-on-empty-array.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/predicate-not-called-on-empty-array.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/prop-desc.js index 344ab98b2f..37fa0ce855 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/prop-desc.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/return-abrupt-from-predicate-call.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/return-abrupt-from-predicate-call.js index e615464938..7c2bf989ab 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/return-abrupt-from-predicate-call.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/return-abrupt-from-predicate-call.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/return-abrupt-from-this-out-of-bounds.js index 52ab6a5cd6..4594f837d8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/return-abrupt-from-this-out-of-bounds.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 Microsoft. 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/TypedArray/prototype/findLastIndex/return-index-predicate-result-is-true.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/return-index-predicate-result-is-true.js index c81fb38cdf..11a2870293 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/return-index-predicate-result-is-true.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/return-index-predicate-result-is-true.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/return-negative-one-if-predicate-returns-false-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/return-negative-one-if-predicate-returns-false-value.js index e535075e9b..7735ae6f4f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/return-negative-one-if-predicate-returns-false-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/return-negative-one-if-predicate-returns-false-value.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/this-is-not-object.js index 1dbfc3115f..c6347d6170 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/this-is-not-object.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/findLastIndex/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/this-is-not-typedarray-instance.js index cc92b40bec..1b11832d93 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/findLastIndex/this-is-not-typedarray-instance.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Microsoft. 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/TypedArray/prototype/forEach/arraylength-internal.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/arraylength-internal.js index c7e0f770e7..986422ac80 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/arraylength-internal.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/arraylength-internal.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/TypedArray/prototype/forEach/callbackfn-arguments-with-thisarg.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-arguments-with-thisarg.js index eb007e15bb..bd12688aeb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-arguments-with-thisarg.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-arguments-with-thisarg.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/TypedArray/prototype/forEach/callbackfn-arguments-without-thisarg.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-arguments-without-thisarg.js index adfda0ac0b..90ebff38fd 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-arguments-without-thisarg.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-arguments-without-thisarg.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/TypedArray/prototype/forEach/callbackfn-detachbuffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-detachbuffer.js index ce1e7515af..14f490f168 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-detachbuffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-detachbuffer.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/TypedArray/prototype/forEach/callbackfn-is-not-callable.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-is-not-callable.js index b831382b20..da435af8c7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-is-not-callable.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-is-not-callable.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/TypedArray/prototype/forEach/callbackfn-no-interaction-over-non-integer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-no-interaction-over-non-integer.js index 011ae6dcbe..6fad187137 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-no-interaction-over-non-integer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-no-interaction-over-non-integer.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/TypedArray/prototype/forEach/callbackfn-not-called-on-empty.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-not-called-on-empty.js index cdd228a7fa..32707e0f19 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-not-called-on-empty.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-not-called-on-empty.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/TypedArray/prototype/forEach/callbackfn-resize.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-resize.js index 6a5ba40878..f8e852ac0c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-resize.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-resize.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/TypedArray/prototype/forEach/callbackfn-return-does-not-change-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-return-does-not-change-instance.js index 1d5493d02e..5bd383e578 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-return-does-not-change-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-return-does-not-change-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/TypedArray/prototype/forEach/callbackfn-returns-abrupt.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-returns-abrupt.js index a8c3a758e9..507fec380c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-returns-abrupt.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-returns-abrupt.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/TypedArray/prototype/forEach/callbackfn-set-value-during-interaction.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-set-value-during-interaction.js index 414ae3d1e6..6cec273bc3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-set-value-during-interaction.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-set-value-during-interaction.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/TypedArray/prototype/forEach/callbackfn-this.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-this.js index 0715e8db66..0cecf426f1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-this.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/callbackfn-this.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/TypedArray/prototype/forEach/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/detached-buffer.js index e35a41d5e4..e0a93ccb87 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/detached-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/TypedArray/prototype/forEach/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/invoked-as-func.js index d4846aefc6..d8f645a070 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/invoked-as-func.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/TypedArray/prototype/forEach/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/invoked-as-method.js index dad90f6f41..9995d92863 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/invoked-as-method.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/TypedArray/prototype/forEach/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/length.js index b31c55e2de..32b2dffce3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.forEach.length, 1); - -verifyNotEnumerable(TypedArray.prototype.forEach, "length"); -verifyNotWritable(TypedArray.prototype.forEach, "length"); -verifyConfigurable(TypedArray.prototype.forEach, "length"); +verifyProperty(TypedArray.prototype.forEach, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/name.js index 0f492bcbaf..20979d6f67 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.forEach.name, "forEach"); - -verifyNotEnumerable(TypedArray.prototype.forEach, "name"); -verifyNotWritable(TypedArray.prototype.forEach, "name"); -verifyConfigurable(TypedArray.prototype.forEach, "name"); +verifyProperty(TypedArray.prototype.forEach, "name", { + value: "forEach", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/not-a-constructor.js index e966540f48..3e30858a12 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.forEach(() => {}); -}, '`let u8 = new Uint8Array(1); new u8.forEach(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/prop-desc.js index 611f1508a6..1d5efd77ef 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/prop-desc.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/TypedArray/prototype/forEach/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/return-abrupt-from-this-out-of-bounds.js index 00dc492e14..015aad4762 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/forEach/returns-undefined.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/returns-undefined.js index 37a0c81076..88b5c588c5 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/returns-undefined.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/returns-undefined.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/TypedArray/prototype/forEach/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/this-is-not-object.js index 8a228dc6c3..999764f3bf 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/this-is-not-object.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/TypedArray/prototype/forEach/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/this-is-not-typedarray-instance.js index 34677e33e4..1f0c972ea3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/this-is-not-typedarray-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/TypedArray/prototype/forEach/values-are-not-cached.js b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/values-are-not-cached.js index 9b1fe0706a..74f5b08f44 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/values-are-not-cached.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/forEach/values-are-not-cached.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/TypedArray/prototype/includes/detached-buffer-during-fromIndex-returns-false-for-zero.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/detached-buffer-during-fromIndex-returns-false-for-zero.js index 493f0bc00d..8c707f19f8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/detached-buffer-during-fromIndex-returns-false-for-zero.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/detached-buffer-during-fromIndex-returns-false-for-zero.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArray/prototype/includes/detached-buffer-during-fromIndex-returns-true-for-undefined.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/detached-buffer-during-fromIndex-returns-true-for-undefined.js index 43ba9f0629..fbedbc0525 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/detached-buffer-during-fromIndex-returns-true-for-undefined.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/detached-buffer-during-fromIndex-returns-true-for-undefined.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArray/prototype/includes/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/detached-buffer.js index 3d8dff1368..d9e1217a7d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/detached-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/TypedArray/prototype/includes/fromIndex-equal-or-greater-length-returns-false.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/fromIndex-equal-or-greater-length-returns-false.js index 4298fc7c08..9f440d7d78 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/fromIndex-equal-or-greater-length-returns-false.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/fromIndex-equal-or-greater-length-returns-false.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/TypedArray/prototype/includes/fromIndex-infinity.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/fromIndex-infinity.js index d067193aaa..4ba0bb426c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/fromIndex-infinity.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/fromIndex-infinity.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/TypedArray/prototype/includes/fromIndex-minus-zero.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/fromIndex-minus-zero.js index 0bb301447f..149ee34f0b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/fromIndex-minus-zero.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/fromIndex-minus-zero.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/TypedArray/prototype/includes/get-length-uses-internal-arraylength.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/get-length-uses-internal-arraylength.js index b7a1f870a0..48743ce951 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/get-length-uses-internal-arraylength.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/get-length-uses-internal-arraylength.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/TypedArray/prototype/includes/index-compared-against-initial-length-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/index-compared-against-initial-length-out-of-bounds.js new file mode 100644 index 0000000000..a589430e35 --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/index-compared-against-initial-length-out-of-bounds.js @@ -0,0 +1,54 @@ +// |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-%typedarray%.prototype.includes +description: > + Index is compared against the initial length when typed array is made out-of-bounds. +info: | + %TypedArray%.prototype.includes ( searchElement [ , fromIndex ] ) + + ... + 2. Let taRecord be ? ValidateTypedArray(O, seq-cst). + 3. Let len be TypedArrayLength(taRecord). + ... + 5. Let n be ? ToIntegerOrInfinity(fromIndex). + ... + 9. If n ≥ 0, then + a. Let k be n. + ... + 11. Repeat, while k < len, + ... + +features: [TypedArray, resizable-arraybuffer] +---*/ + +let rab = new ArrayBuffer(4, {maxByteLength: 20}); + +// Uses byteOffset to make typed array out-of-bounds when shrinking size to zero. +let byteOffset = 1; + +let ta = new Int8Array(rab, byteOffset); + +let index = { + valueOf() { + // Shrink buffer to zero. + rab.resize(0); + + // Index is larger than the initial length. + return 10; + } +}; + +// Typed array is in-bounds. +assert.sameValue(ta.length, 3); + +let result = ta.includes(undefined, index); + +// Typed array is out-of-bounds. +assert.sameValue(ta.length, 0); + +assert.sameValue(result, false); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/index-compared-against-initial-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/index-compared-against-initial-length.js new file mode 100644 index 0000000000..572381275e --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/index-compared-against-initial-length.js @@ -0,0 +1,50 @@ +// |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-%typedarray%.prototype.includes +description: > + Index is compared against the initial length. +info: | + %TypedArray%.prototype.includes ( searchElement [ , fromIndex ] ) + + ... + 2. Let taRecord be ? ValidateTypedArray(O, seq-cst). + 3. Let len be TypedArrayLength(taRecord). + ... + 5. Let n be ? ToIntegerOrInfinity(fromIndex). + ... + 9. If n ≥ 0, then + a. Let k be n. + ... + 11. Repeat, while k < len, + ... + +features: [TypedArray, resizable-arraybuffer] +---*/ + +let rab = new ArrayBuffer(4, {maxByteLength: 20}); +let ta = new Int8Array(rab); + +let index = { + valueOf() { + // Shrink buffer to zero. + rab.resize(0); + + // Index is larger than the initial length. + return 10; + } +}; + +// Auto-length is correctly tracked. +assert.sameValue(ta.length, 4); + +let result = ta.includes(undefined, index); + +// Auto-length is correctly set to zero. +assert.sameValue(ta.length, 0); + +assert.sameValue(result, false); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/invoked-as-func.js index d90cc7b111..bd792357bb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/invoked-as-func.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/TypedArray/prototype/includes/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/invoked-as-method.js index 0d138bfa6c..892a20eae3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/invoked-as-method.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/TypedArray/prototype/includes/length-zero-returns-false.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/length-zero-returns-false.js index ab59a078d7..505b41f60b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/length-zero-returns-false.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/length-zero-returns-false.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/TypedArray/prototype/includes/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/length.js index 33e7547d6c..bf18d9a8b9 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/length.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. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.includes.length, 1); - -verifyNotEnumerable(TypedArray.prototype.includes, "length"); -verifyNotWritable(TypedArray.prototype.includes, "length"); -verifyConfigurable(TypedArray.prototype.includes, "length"); +verifyProperty(TypedArray.prototype.includes, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/name.js index a76942e846..4876464dc4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/name.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. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.includes.name, "includes"); - -verifyNotEnumerable(TypedArray.prototype.includes, "name"); -verifyNotWritable(TypedArray.prototype.includes, "name"); -verifyConfigurable(TypedArray.prototype.includes, "name"); +verifyProperty(TypedArray.prototype.includes, "name", { + value: "includes", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/not-a-constructor.js index 726d7ec28f..7793b8f45c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.includes(1); -}, '`let u8 = new Uint8Array(1); new u8.includes(1)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/prop-desc.js index 3931bd6be2..7435acc534 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/prop-desc.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/TypedArray/prototype/includes/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/return-abrupt-from-this-out-of-bounds.js index 13200e4c27..f495195719 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/includes/return-abrupt-tointeger-fromindex-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/return-abrupt-tointeger-fromindex-symbol.js index 495c48b1a1..2ae78b4366 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/return-abrupt-tointeger-fromindex-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/return-abrupt-tointeger-fromindex-symbol.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/TypedArray/prototype/includes/return-abrupt-tointeger-fromindex.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/return-abrupt-tointeger-fromindex.js index ee5c08f7df..aeff01f614 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/return-abrupt-tointeger-fromindex.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/return-abrupt-tointeger-fromindex.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/TypedArray/prototype/includes/samevaluezero.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/samevaluezero.js index a7bfc4042d..cde21311ba 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/samevaluezero.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/samevaluezero.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/TypedArray/prototype/includes/search-found-returns-true.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/search-found-returns-true.js index 7d2cf925b7..fcaa097e9c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/search-found-returns-true.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/search-found-returns-true.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/TypedArray/prototype/includes/search-not-found-returns-false.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/search-not-found-returns-false.js index f647deebf9..16111c4ea2 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/search-not-found-returns-false.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/search-not-found-returns-false.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/TypedArray/prototype/includes/searchelement-not-integer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/searchelement-not-integer.js index 22d65b5c0b..8288c44960 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/searchelement-not-integer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/searchelement-not-integer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Google. 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/TypedArray/prototype/includes/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/this-is-not-object.js index ffaadb48fc..c58b4656d6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/this-is-not-object.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/TypedArray/prototype/includes/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/this-is-not-typedarray-instance.js index 3a7d86dcd3..7c5085f9d9 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/this-is-not-typedarray-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/TypedArray/prototype/includes/tointeger-fromindex.js b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/tointeger-fromindex.js index ad25ab47d7..56987497c9 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/includes/tointeger-fromindex.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/includes/tointeger-fromindex.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/TypedArray/prototype/indexOf/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js index 7081b55ed5..647bd47a30 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArray/prototype/indexOf/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js index 8fff2cbb75..00a9ba2b2e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArray/prototype/indexOf/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/detached-buffer.js index 60c374ad87..eedd365925 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/detached-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/TypedArray/prototype/indexOf/fromIndex-equal-or-greater-length-returns-minus-one.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/fromIndex-equal-or-greater-length-returns-minus-one.js index de345d49a2..ed92338e66 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/fromIndex-equal-or-greater-length-returns-minus-one.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/fromIndex-equal-or-greater-length-returns-minus-one.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/TypedArray/prototype/indexOf/fromIndex-infinity.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/fromIndex-infinity.js index 1f75f72769..2c6aba95ee 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/fromIndex-infinity.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/fromIndex-infinity.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/TypedArray/prototype/indexOf/fromIndex-minus-zero.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/fromIndex-minus-zero.js index 6bd0d4b447..33235375c3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/fromIndex-minus-zero.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/fromIndex-minus-zero.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/TypedArray/prototype/indexOf/get-length-uses-internal-arraylength.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/get-length-uses-internal-arraylength.js index 04738cec2b..763b6d6497 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/get-length-uses-internal-arraylength.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/get-length-uses-internal-arraylength.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/TypedArray/prototype/indexOf/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/invoked-as-func.js index 84ca275587..d66918e7d5 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/invoked-as-func.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/TypedArray/prototype/indexOf/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/invoked-as-method.js index a0617fd2a2..39b73471d1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/invoked-as-method.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/TypedArray/prototype/indexOf/length-zero-returns-minus-one.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/length-zero-returns-minus-one.js index 37163cf2aa..09d1d8ec3e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/length-zero-returns-minus-one.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/length-zero-returns-minus-one.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/TypedArray/prototype/indexOf/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/length.js index 5c866bebad..3f848204d7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.indexOf.length, 1); - -verifyNotEnumerable(TypedArray.prototype.indexOf, "length"); -verifyNotWritable(TypedArray.prototype.indexOf, "length"); -verifyConfigurable(TypedArray.prototype.indexOf, "length"); +verifyProperty(TypedArray.prototype.indexOf, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/name.js index 54aea8a605..749cd046ba 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.indexOf.name, "indexOf"); - -verifyNotEnumerable(TypedArray.prototype.indexOf, "name"); -verifyNotWritable(TypedArray.prototype.indexOf, "name"); -verifyConfigurable(TypedArray.prototype.indexOf, "name"); +verifyProperty(TypedArray.prototype.indexOf, "name", { + value: "indexOf", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/no-arg.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/no-arg.js index 57015f26c9..6854532e9a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/no-arg.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/no-arg.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Alexey Shvayka. 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/TypedArray/prototype/indexOf/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/not-a-constructor.js index 7ada33c348..ae692b54b7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.indexOf(); -}, '`let u8 = new Uint8Array(1); new u8.indexOf()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/prop-desc.js index be05ced431..3af758de03 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/prop-desc.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/TypedArray/prototype/indexOf/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/return-abrupt-from-this-out-of-bounds.js index b77a1e11c1..295844058c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/indexOf/return-abrupt-tointeger-fromindex-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/return-abrupt-tointeger-fromindex-symbol.js index 21820e40ae..6f2de66f84 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/return-abrupt-tointeger-fromindex-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/return-abrupt-tointeger-fromindex-symbol.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/TypedArray/prototype/indexOf/return-abrupt-tointeger-fromindex.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/return-abrupt-tointeger-fromindex.js index 7789414bdc..9fdb0a8b81 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/return-abrupt-tointeger-fromindex.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/return-abrupt-tointeger-fromindex.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/TypedArray/prototype/indexOf/search-found-returns-index.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/search-found-returns-index.js index 810caadd88..a9bcd5a195 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/search-found-returns-index.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/search-found-returns-index.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/TypedArray/prototype/indexOf/search-not-found-returns-minus-one.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/search-not-found-returns-minus-one.js index e270f87c37..c313b3baf0 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/search-not-found-returns-minus-one.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/search-not-found-returns-minus-one.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/TypedArray/prototype/indexOf/strict-comparison.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/strict-comparison.js index 64e9e774e5..ee0e29633f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/strict-comparison.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/strict-comparison.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/TypedArray/prototype/indexOf/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/this-is-not-object.js index 9bb19be858..845f485645 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/this-is-not-object.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/TypedArray/prototype/indexOf/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/this-is-not-typedarray-instance.js index 22fff52e60..33016599cf 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/this-is-not-typedarray-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/TypedArray/prototype/indexOf/tointeger-fromindex.js b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/tointeger-fromindex.js index 07f6808fdc..11b3a82c80 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/tointeger-fromindex.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/indexOf/tointeger-fromindex.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/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-simple-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-simple-value.js index 319f85e9c2..87bf1f9d1d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-simple-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-simple-value.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/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-value.js index 02235e1b35..1a8fb0cd45 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-value.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/TypedArray/prototype/join/detached-buffer-during-fromIndex-returns-single-comma.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/detached-buffer-during-fromIndex-returns-single-comma.js index 660c1e497d..2f58359eb8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/detached-buffer-during-fromIndex-returns-single-comma.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/detached-buffer-during-fromIndex-returns-single-comma.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArray/prototype/join/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/detached-buffer.js index a78b14a226..8f622b9ed0 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/detached-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/TypedArray/prototype/join/empty-instance-empty-string.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/empty-instance-empty-string.js index 54e40f5194..4f313db82f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/empty-instance-empty-string.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/empty-instance-empty-string.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/TypedArray/prototype/join/get-length-uses-internal-arraylength.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/get-length-uses-internal-arraylength.js index 95b4bac090..f1e537bed4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/get-length-uses-internal-arraylength.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/get-length-uses-internal-arraylength.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/TypedArray/prototype/join/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/invoked-as-func.js index 035a040719..4c94418800 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/invoked-as-func.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/TypedArray/prototype/join/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/invoked-as-method.js index d57a9cd0b3..71ccf3d9b0 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/invoked-as-method.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/TypedArray/prototype/join/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/length.js index 2ba19e6f94..e9c10e5e8d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.join.length, 1); - -verifyNotEnumerable(TypedArray.prototype.join, "length"); -verifyNotWritable(TypedArray.prototype.join, "length"); -verifyConfigurable(TypedArray.prototype.join, "length"); +verifyProperty(TypedArray.prototype.join, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/name.js index df6cec6248..b2ac1d73a3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.join.name, "join"); - -verifyNotEnumerable(TypedArray.prototype.join, "name"); -verifyNotWritable(TypedArray.prototype.join, "name"); -verifyConfigurable(TypedArray.prototype.join, "name"); +verifyProperty(TypedArray.prototype.join, "name", { + value: "join", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/not-a-constructor.js index 7ab017fbf1..338879aeb8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.join(); -}, '`let u8 = new Uint8Array(1); new u8.join()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/prop-desc.js index c42df0790b..16e0808b53 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/prop-desc.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/TypedArray/prototype/join/result-from-tostring-on-each-simple-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-simple-value.js index 9a21ff741a..8582f05ca6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-simple-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-simple-value.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/TypedArray/prototype/join/result-from-tostring-on-each-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-value.js index 082e482b9f..1e8030a9a3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-value.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/TypedArray/prototype/join/return-abrupt-from-separator-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-separator-symbol.js index ce5ad17b4b..76994aadad 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-separator-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-separator-symbol.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/TypedArray/prototype/join/return-abrupt-from-separator.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-separator.js index a530a4714b..2c3a345c96 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-separator.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-separator.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/TypedArray/prototype/join/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-this-out-of-bounds.js index 45fe1e5e23..e93b479442 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/join/separator-tostring-once-after-resized.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/separator-tostring-once-after-resized.js new file mode 100644 index 0000000000..fdae9040c5 --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/separator-tostring-once-after-resized.js @@ -0,0 +1,42 @@ +// |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-%typedarray%.prototype.join +description: > + ToString is called once when the array is resized. +info: | + %TypedArray%.prototype.join ( separator ) + + ... + 2. Let taRecord be ? ValidateTypedArray(O, seq-cst). + 3. Let len be TypedArrayLength(taRecord). + ... + 5. Else, let sep be ? ToString(separator). + ... + +features: [TypedArray, resizable-arraybuffer] +---*/ + +let rab = new ArrayBuffer(3, {maxByteLength: 5}); +let ta = new Int8Array(rab); + +let callCount = 0; + +let index = { + toString() { + callCount++; + rab.resize(0); + return "-"; + } +}; + +assert.sameValue(callCount, 0); + +let r = ta.join(index); + +assert.sameValue(callCount, 1); +assert.sameValue(r, "--"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/join/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/this-is-not-object.js index ff4ef67fd1..10bae4ba82 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/this-is-not-object.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/TypedArray/prototype/join/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/join/this-is-not-typedarray-instance.js index 926c39a97e..16925a33a1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/join/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/join/this-is-not-typedarray-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/TypedArray/prototype/keys/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/detached-buffer.js index 3221123031..a34f87dbbb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/keys/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/detached-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/TypedArray/prototype/keys/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/invoked-as-func.js index 130d3c9220..51d4b6973b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/keys/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/invoked-as-func.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/TypedArray/prototype/keys/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/invoked-as-method.js index 15ac944e05..f196c54dd8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/keys/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/invoked-as-method.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/TypedArray/prototype/keys/iter-prototype.js b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/iter-prototype.js index 427367bb4e..12c3177602 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/keys/iter-prototype.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/iter-prototype.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/TypedArray/prototype/keys/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/length.js index 73abbf3fb9..ad16aab4d0 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/keys/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.keys.length, 0); - -verifyNotEnumerable(TypedArray.prototype.keys, "length"); -verifyNotWritable(TypedArray.prototype.keys, "length"); -verifyConfigurable(TypedArray.prototype.keys, "length"); +verifyProperty(TypedArray.prototype.keys, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/keys/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/name.js index f0f097382f..3a281d9db9 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/keys/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.keys.name, "keys"); - -verifyNotEnumerable(TypedArray.prototype.keys, "name"); -verifyNotWritable(TypedArray.prototype.keys, "name"); -verifyConfigurable(TypedArray.prototype.keys, "name"); +verifyProperty(TypedArray.prototype.keys, "name", { + value: "keys", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/keys/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/not-a-constructor.js index a5475acf51..bd739ca6dc 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/keys/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.keys(); -}, '`let u8 = new Uint8Array(1); new u8.keys()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/keys/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/prop-desc.js index 8e2f483c11..b64107a7c2 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/keys/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/prop-desc.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/TypedArray/prototype/keys/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/return-abrupt-from-this-out-of-bounds.js index e0fc4129ce..eb46c02f35 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/keys/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/keys/return-itor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/return-itor.js index 5f06a7de97..90a0fbf336 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/keys/return-itor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/return-itor.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/TypedArray/prototype/keys/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/this-is-not-object.js index 57d767940d..71109097e5 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/keys/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/this-is-not-object.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/TypedArray/prototype/keys/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/this-is-not-typedarray-instance.js index d2c1ecfea8..0027859d57 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/keys/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/keys/this-is-not-typedarray-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/TypedArray/prototype/lastIndexOf/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js index d950512ac3..aa833e701e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer-during-fromIndex-returns-minus-one-for-undefined.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArray/prototype/lastIndexOf/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js index 6d4460d294..36c1764fe6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer-during-fromIndex-returns-minus-one-for-zero.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArray/prototype/lastIndexOf/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer.js index 65a6620143..d5232d412f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/detached-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/TypedArray/prototype/lastIndexOf/fromIndex-infinity.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/fromIndex-infinity.js index 0ed0db309b..8b6e3e206e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/fromIndex-infinity.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/fromIndex-infinity.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/TypedArray/prototype/lastIndexOf/fromIndex-minus-zero.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/fromIndex-minus-zero.js index 8a7658c44c..cb2fc1f2de 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/fromIndex-minus-zero.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/fromIndex-minus-zero.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/TypedArray/prototype/lastIndexOf/get-length-uses-internal-arraylength.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/get-length-uses-internal-arraylength.js index 3c20d9e937..ffa887b18c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/get-length-uses-internal-arraylength.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/get-length-uses-internal-arraylength.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/TypedArray/prototype/lastIndexOf/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/invoked-as-func.js index d5808cc179..d28669e60d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/invoked-as-func.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/TypedArray/prototype/lastIndexOf/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/invoked-as-method.js index a79f2a2de6..f3affc27aa 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/invoked-as-method.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/TypedArray/prototype/lastIndexOf/length-zero-returns-minus-one.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/length-zero-returns-minus-one.js index 722e7cb618..f2573e9b66 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/length-zero-returns-minus-one.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/length-zero-returns-minus-one.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/TypedArray/prototype/lastIndexOf/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/length.js index 4361948ea9..019317f291 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.lastIndexOf.length, 1); - -verifyNotEnumerable(TypedArray.prototype.lastIndexOf, "length"); -verifyNotWritable(TypedArray.prototype.lastIndexOf, "length"); -verifyConfigurable(TypedArray.prototype.lastIndexOf, "length"); +verifyProperty(TypedArray.prototype.lastIndexOf, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/name.js index 392c531592..1b84c2d33f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.lastIndexOf.name, "lastIndexOf"); - -verifyNotEnumerable(TypedArray.prototype.lastIndexOf, "name"); -verifyNotWritable(TypedArray.prototype.lastIndexOf, "name"); -verifyConfigurable(TypedArray.prototype.lastIndexOf, "name"); +verifyProperty(TypedArray.prototype.lastIndexOf, "name", { + value: "lastIndexOf", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/no-arg.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/no-arg.js index 850f393c60..89ca5f75f7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/no-arg.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/no-arg.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Alexey Shvayka. 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/TypedArray/prototype/lastIndexOf/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/not-a-constructor.js index 7bd22e16b3..2329b45b8d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.lastIndexOf(); -}, '`let u8 = new Uint8Array(1); new u8.lastIndexOf()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/prop-desc.js index 50422e3001..9ed38b05aa 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/prop-desc.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/TypedArray/prototype/lastIndexOf/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/return-abrupt-from-this-out-of-bounds.js index 61d9dcefdf..859dc2981d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/lastIndexOf/return-abrupt-tointeger-fromindex-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/return-abrupt-tointeger-fromindex-symbol.js index f5a7b107dc..6dfe282e21 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/return-abrupt-tointeger-fromindex-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/return-abrupt-tointeger-fromindex-symbol.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/TypedArray/prototype/lastIndexOf/return-abrupt-tointeger-fromindex.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/return-abrupt-tointeger-fromindex.js index 621460a5b8..fc36d939eb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/return-abrupt-tointeger-fromindex.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/return-abrupt-tointeger-fromindex.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/TypedArray/prototype/lastIndexOf/search-found-returns-index.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/search-found-returns-index.js index 439473494a..8af41744d3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/search-found-returns-index.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/search-found-returns-index.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/TypedArray/prototype/lastIndexOf/search-not-found-returns-minus-one.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/search-not-found-returns-minus-one.js index ea611e2f89..83e504d26b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/search-not-found-returns-minus-one.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/search-not-found-returns-minus-one.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/TypedArray/prototype/lastIndexOf/strict-comparison.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/strict-comparison.js index 09c3da772d..03ea78e35e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/strict-comparison.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/strict-comparison.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/TypedArray/prototype/lastIndexOf/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/this-is-not-object.js index b393b8925d..e508e4fba8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/this-is-not-object.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/TypedArray/prototype/lastIndexOf/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/this-is-not-typedarray-instance.js index 2972430535..388bf428c8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/this-is-not-typedarray-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/TypedArray/prototype/lastIndexOf/tointeger-fromindex.js b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/tointeger-fromindex.js index 77465b511e..12e178db84 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/tointeger-fromindex.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/lastIndexOf/tointeger-fromindex.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/TypedArray/prototype/length/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/length/detached-buffer.js index 4f34f05a30..96ce2563bf 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/length/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/length/detached-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/TypedArray/prototype/length/invoked-as-accessor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/length/invoked-as-accessor.js index b1856a3872..32b4307676 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/length/invoked-as-accessor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/length/invoked-as-accessor.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/TypedArray/prototype/length/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/length/invoked-as-func.js index 73bfed75a1..317a2e4b73 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/length/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/length/invoked-as-func.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/TypedArray/prototype/length/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/length/length.js index bb6d86ba78..63afefa088 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/length/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/length/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -25,10 +26,11 @@ features: [TypedArray] var desc = Object.getOwnPropertyDescriptor(TypedArray.prototype, "length"); -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/TypedArray/prototype/length/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/length/name.js index d5ff3cfc37..cd3d1281fb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/length/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/length/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -22,10 +23,11 @@ features: [TypedArray] var desc = Object.getOwnPropertyDescriptor(TypedArray.prototype, "length"); -assert.sameValue(desc.get.name, "get length"); - -verifyNotEnumerable(desc.get, "name"); -verifyNotWritable(desc.get, "name"); -verifyConfigurable(desc.get, "name"); +verifyProperty(desc.get, "name", { + value: "get length", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/length/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/length/prop-desc.js index 4dd62e29bc..c45dcf4172 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/length/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/length/prop-desc.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/TypedArray/prototype/length/resizable-array-buffer-auto.js b/js/src/tests/test262/built-ins/TypedArray/prototype/length/resizable-array-buffer-auto.js index 0e84da9467..ac17074953 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/length/resizable-array-buffer-auto.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/length/resizable-array-buffer-auto.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/TypedArray/prototype/length/resizable-array-buffer-fixed.js b/js/src/tests/test262/built-ins/TypedArray/prototype/length/resizable-array-buffer-fixed.js index 0616f26dc2..187bd6e513 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/length/resizable-array-buffer-fixed.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/length/resizable-array-buffer-fixed.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/TypedArray/prototype/length/return-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/length/return-length.js index 56c987fdf3..e6961f900f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/length/return-length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/length/return-length.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/TypedArray/prototype/length/this-has-no-typedarrayname-internal.js b/js/src/tests/test262/built-ins/TypedArray/prototype/length/this-has-no-typedarrayname-internal.js index 25effb5786..3d827d6049 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/length/this-has-no-typedarrayname-internal.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/length/this-has-no-typedarrayname-internal.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/TypedArray/prototype/length/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/length/this-is-not-object.js index 56d3e96207..16d5f7aa93 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/length/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/length/this-is-not-object.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/TypedArray/prototype/map/arraylength-internal.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/arraylength-internal.js index 4d50955331..7f9b40163b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/arraylength-internal.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/arraylength-internal.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/TypedArray/prototype/map/callbackfn-arguments-with-thisarg.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-arguments-with-thisarg.js index dd2f599d91..44cb4d6364 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-arguments-with-thisarg.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-arguments-with-thisarg.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/TypedArray/prototype/map/callbackfn-arguments-without-thisarg.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-arguments-without-thisarg.js index 14e593c926..bb9d1c483d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-arguments-without-thisarg.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-arguments-without-thisarg.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/TypedArray/prototype/map/callbackfn-detachbuffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-detachbuffer.js index cead041854..68b24a4831 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-detachbuffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-detachbuffer.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/TypedArray/prototype/map/callbackfn-is-not-callable.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-is-not-callable.js index c6ca42907e..8fb62b1259 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-is-not-callable.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-is-not-callable.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/TypedArray/prototype/map/callbackfn-no-interaction-over-non-integer-properties.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-no-interaction-over-non-integer-properties.js index 4bbceeac78..2b12c19f6a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-no-interaction-over-non-integer-properties.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-no-interaction-over-non-integer-properties.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/TypedArray/prototype/map/callbackfn-not-called-on-empty.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-not-called-on-empty.js index d2c14b4635..eebbbae64e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-not-called-on-empty.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-not-called-on-empty.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/TypedArray/prototype/map/callbackfn-resize.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-resize.js index ff96ec113c..cbcb364ef7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-resize.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-resize.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/TypedArray/prototype/map/callbackfn-return-affects-returned-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-return-affects-returned-object.js index 8627c187a3..3d0cd4f646 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-return-affects-returned-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-return-affects-returned-object.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/TypedArray/prototype/map/callbackfn-return-does-not-change-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-return-does-not-change-instance.js index a386d40389..d4d8072aa7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-return-does-not-change-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-return-does-not-change-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/TypedArray/prototype/map/callbackfn-return-does-not-copy-non-integer-properties.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-return-does-not-copy-non-integer-properties.js index 228d5fca0b..530ef6efff 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-return-does-not-copy-non-integer-properties.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-return-does-not-copy-non-integer-properties.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/TypedArray/prototype/map/callbackfn-returns-abrupt.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-returns-abrupt.js index 1849feee03..d455284ad0 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-returns-abrupt.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-returns-abrupt.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/TypedArray/prototype/map/callbackfn-set-value-during-interaction.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-set-value-during-interaction.js index 3367d09ed7..4d1ea405ba 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-set-value-during-interaction.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-set-value-during-interaction.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/TypedArray/prototype/map/callbackfn-this.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-this.js index f32ca0efa0..1494a6573f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-this.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/callbackfn-this.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/TypedArray/prototype/map/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/detached-buffer.js index 91ae25122b..c74d339bdd 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/detached-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/TypedArray/prototype/map/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/invoked-as-func.js index 390cc0f907..443d9589b8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/invoked-as-func.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/TypedArray/prototype/map/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/invoked-as-method.js index 412ec13842..0079e106eb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/invoked-as-method.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/TypedArray/prototype/map/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/length.js index 005f678a2a..79ebbbd7bf 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.map.length, 1); - -verifyNotEnumerable(TypedArray.prototype.map, "length"); -verifyNotWritable(TypedArray.prototype.map, "length"); -verifyConfigurable(TypedArray.prototype.map, "length"); +verifyProperty(TypedArray.prototype.map, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/map/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/name.js index 318e83fc91..8a18b0cefb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.map.name, "map"); - -verifyNotEnumerable(TypedArray.prototype.map, "name"); -verifyNotWritable(TypedArray.prototype.map, "name"); -verifyConfigurable(TypedArray.prototype.map, "name"); +verifyProperty(TypedArray.prototype.map, "name", { + value: "map", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/map/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/not-a-constructor.js index c4f000f14d..9898a6edc0 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.map(() => {}); -}, '`let u8 = new Uint8Array(1); new u8.map(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/map/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/prop-desc.js index 4aff20321f..55f46ae5ab 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/prop-desc.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/TypedArray/prototype/map/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/return-abrupt-from-this-out-of-bounds.js index 4fbbd4c34d..fecf11cd89 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/map/return-new-typedarray-conversion-operation-consistent-nan.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/return-new-typedarray-conversion-operation-consistent-nan.js index 22f12111a8..ded4b2ef29 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/return-new-typedarray-conversion-operation-consistent-nan.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/return-new-typedarray-conversion-operation-consistent-nan.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/TypedArray/prototype/map/return-new-typedarray-conversion-operation.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/return-new-typedarray-conversion-operation.js index 95607e6bf6..9ab4c3185e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/return-new-typedarray-conversion-operation.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/return-new-typedarray-conversion-operation.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/TypedArray/prototype/map/return-new-typedarray-from-empty-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/return-new-typedarray-from-empty-length.js index caf14ee0e7..ec6eafc32b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/return-new-typedarray-from-empty-length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/return-new-typedarray-from-empty-length.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/TypedArray/prototype/map/return-new-typedarray-from-positive-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/return-new-typedarray-from-positive-length.js index 781e95ed79..95e2d0a683 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/return-new-typedarray-from-positive-length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/return-new-typedarray-from-positive-length.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/TypedArray/prototype/map/speciesctor-destination-resizable.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-destination-resizable.js index 62758220ae..0b9ea40c5e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-destination-resizable.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-destination-resizable.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) 2023 Igalia, S.L. 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/TypedArray/prototype/map/speciesctor-get-ctor-abrupt.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-ctor-abrupt.js index 8cb024e74f..1477a37a30 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-ctor-abrupt.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-ctor-abrupt.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Peter Wong. 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/TypedArray/prototype/map/speciesctor-get-ctor-inherited.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-ctor-inherited.js index 69461a29bc..dd09bca26d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-ctor-inherited.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-ctor-inherited.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Peter Wong. 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/TypedArray/prototype/map/speciesctor-get-ctor-returns-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-ctor-returns-throws.js index 5f2498a20b..ccc9bf307e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-ctor-returns-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-ctor-returns-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Peter Wong. 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/TypedArray/prototype/map/speciesctor-get-ctor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-ctor.js index 867e80d95e..2b77c8d909 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-ctor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Peter Wong. 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/TypedArray/prototype/map/speciesctor-get-species-abrupt.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-abrupt.js index e13dc1fa89..2bc8ec6347 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-abrupt.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-abrupt.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Peter Wong. 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/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-invocation.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-invocation.js index 31f2b4e2c1..ffb37ec15c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-invocation.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-invocation.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Peter Wong. 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/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js index 104d2cd93e..055bd3e256 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-length-throws-resizable-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) 2023 Igalia, S.L. 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/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-length-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-length-throws.js index cfee782837..b9309ac581 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-length-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-length-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Peter Wong. 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/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-length.js index adaf755194..51c6aa21ed 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Peter Wong. 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/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-returns-another-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-returns-another-instance.js index 5891ee6291..40f27793f3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-returns-another-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-returns-another-instance.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Peter Wong. 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/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-throws.js index cc914eb35c..87ca2491a3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Peter Wong. 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/TypedArray/prototype/map/speciesctor-get-species-custom-ctor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor.js index cc5cd4a718..c35d7d8fd7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-custom-ctor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Peter Wong. 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/TypedArray/prototype/map/speciesctor-get-species-returns-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-returns-throws.js index 7c2d50f58a..0ae7c9fd94 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-returns-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-returns-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Peter Wong. 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/TypedArray/prototype/map/speciesctor-get-species-use-default-ctor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-use-default-ctor.js index 1f69a5f099..f32d898d15 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-use-default-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species-use-default-ctor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Peter Wong. 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/TypedArray/prototype/map/speciesctor-get-species.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species.js index ebb6be8c28..5bf51e9f75 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/speciesctor-get-species.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Peter Wong. 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/TypedArray/prototype/map/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/this-is-not-object.js index 5ffe12583d..ebebab845e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/this-is-not-object.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/TypedArray/prototype/map/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/this-is-not-typedarray-instance.js index 214354fa23..0ee9b0ff3e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/this-is-not-typedarray-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/TypedArray/prototype/map/values-are-not-cached.js b/js/src/tests/test262/built-ins/TypedArray/prototype/map/values-are-not-cached.js index b65af8329f..48b39cd1ff 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/map/values-are-not-cached.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/map/values-are-not-cached.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/TypedArray/prototype/reduce/callbackfn-arguments-custom-accumulator.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-arguments-custom-accumulator.js index c94056f7af..e713712489 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-arguments-custom-accumulator.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-arguments-custom-accumulator.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/TypedArray/prototype/reduce/callbackfn-arguments-default-accumulator.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-arguments-default-accumulator.js index da27455283..5d8e0b2e41 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-arguments-default-accumulator.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-arguments-default-accumulator.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/TypedArray/prototype/reduce/callbackfn-detachbuffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-detachbuffer.js index a9e4cc7cdc..cb9bf6842f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-detachbuffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-detachbuffer.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/TypedArray/prototype/reduce/callbackfn-is-not-callable-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-is-not-callable-throws.js index b604544757..ae65c9a34d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-is-not-callable-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-is-not-callable-throws.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/TypedArray/prototype/reduce/callbackfn-no-iteration-over-non-integer-properties.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-no-iteration-over-non-integer-properties.js index d7dca0aa6b..93a1af9249 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-no-iteration-over-non-integer-properties.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-no-iteration-over-non-integer-properties.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/TypedArray/prototype/reduce/callbackfn-not-called-on-empty.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-not-called-on-empty.js index 775ccc995b..3b7d848711 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-not-called-on-empty.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-not-called-on-empty.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/TypedArray/prototype/reduce/callbackfn-resize.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-resize.js index e304b7bb12..30ef850ece 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-resize.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-resize.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/TypedArray/prototype/reduce/callbackfn-return-does-not-change-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-return-does-not-change-instance.js index 6c08f0cb18..b8f2490d8e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-return-does-not-change-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-return-does-not-change-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/TypedArray/prototype/reduce/callbackfn-returns-abrupt.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-returns-abrupt.js index 5999871cca..a020b0b3f8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-returns-abrupt.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-returns-abrupt.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/TypedArray/prototype/reduce/callbackfn-set-value-during-iteration.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-set-value-during-iteration.js index 8fd43bad16..8e473eca13 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-set-value-during-iteration.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-set-value-during-iteration.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/TypedArray/prototype/reduce/callbackfn-this.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-this.js index 9bec756c34..166db799d9 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-this.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/callbackfn-this.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/TypedArray/prototype/reduce/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/detached-buffer.js index 77ef5a447f..dd8cc05ab7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/detached-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/TypedArray/prototype/reduce/empty-instance-return-initialvalue.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/empty-instance-return-initialvalue.js index 49863aad95..dfc19e1064 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/empty-instance-return-initialvalue.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/empty-instance-return-initialvalue.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/TypedArray/prototype/reduce/empty-instance-with-no-initialvalue-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/empty-instance-with-no-initialvalue-throws.js index 9924f89ae2..0298b7eff2 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/empty-instance-with-no-initialvalue-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/empty-instance-with-no-initialvalue-throws.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/TypedArray/prototype/reduce/get-length-uses-internal-arraylength.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/get-length-uses-internal-arraylength.js index 301955fc2d..d05a0b7730 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/get-length-uses-internal-arraylength.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/get-length-uses-internal-arraylength.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/TypedArray/prototype/reduce/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/invoked-as-func.js index fd0a92b827..f135afe2eb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/invoked-as-func.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/TypedArray/prototype/reduce/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/invoked-as-method.js index cb355bdbbc..3f2cd1af74 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/invoked-as-method.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/TypedArray/prototype/reduce/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/length.js index 8c3e198e11..01c44e5d2c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.reduce.length, 1); - -verifyNotEnumerable(TypedArray.prototype.reduce, "length"); -verifyNotWritable(TypedArray.prototype.reduce, "length"); -verifyConfigurable(TypedArray.prototype.reduce, "length"); +verifyProperty(TypedArray.prototype.reduce, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/name.js index 0daed85804..a013352ef3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.reduce.name, "reduce"); - -verifyNotEnumerable(TypedArray.prototype.reduce, "name"); -verifyNotWritable(TypedArray.prototype.reduce, "name"); -verifyConfigurable(TypedArray.prototype.reduce, "name"); +verifyProperty(TypedArray.prototype.reduce, "name", { + value: "reduce", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/not-a-constructor.js index 4cc53d856d..d71c7f7004 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.reduce(() => {}, []); -}, '`let u8 = new Uint8Array(1); new u8.reduce(() => {}, [])` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/prop-desc.js index ace3661a03..174516fcf3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/prop-desc.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/TypedArray/prototype/reduce/result-is-last-callbackfn-return.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/result-is-last-callbackfn-return.js index 12b86326a6..2723495a89 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/result-is-last-callbackfn-return.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/result-is-last-callbackfn-return.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/TypedArray/prototype/reduce/result-of-any-type.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/result-of-any-type.js index 2950251b61..45e746818e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/result-of-any-type.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/result-of-any-type.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/TypedArray/prototype/reduce/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/return-abrupt-from-this-out-of-bounds.js index a2d9eaf1f8..7e58dcdfbb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/reduce/return-first-value-without-callbackfn.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/return-first-value-without-callbackfn.js index 2b591cfd84..370ef10b0d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/return-first-value-without-callbackfn.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/return-first-value-without-callbackfn.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/TypedArray/prototype/reduce/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/this-is-not-object.js index baee34b2c7..2506ecabe1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/this-is-not-object.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/TypedArray/prototype/reduce/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/this-is-not-typedarray-instance.js index a1d606915e..031c1f816a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/this-is-not-typedarray-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/TypedArray/prototype/reduce/values-are-not-cached.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/values-are-not-cached.js index dcc9f8567a..ba8339edb0 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/values-are-not-cached.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduce/values-are-not-cached.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/TypedArray/prototype/reduceRight/callbackfn-arguments-custom-accumulator.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-arguments-custom-accumulator.js index 4d4bc07f7b..43b869e144 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-arguments-custom-accumulator.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-arguments-custom-accumulator.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/TypedArray/prototype/reduceRight/callbackfn-arguments-default-accumulator.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-arguments-default-accumulator.js index 980cac7ae0..542442f7a7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-arguments-default-accumulator.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-arguments-default-accumulator.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/TypedArray/prototype/reduceRight/callbackfn-detachbuffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-detachbuffer.js index 48cc0be33c..90423d0a1e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-detachbuffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-detachbuffer.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/TypedArray/prototype/reduceRight/callbackfn-is-not-callable-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-is-not-callable-throws.js index 8de1268a44..0272f021ae 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-is-not-callable-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-is-not-callable-throws.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/TypedArray/prototype/reduceRight/callbackfn-no-iteration-over-non-integer-properties.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-no-iteration-over-non-integer-properties.js index dcf8d628e8..b297cfa77e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-no-iteration-over-non-integer-properties.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-no-iteration-over-non-integer-properties.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/TypedArray/prototype/reduceRight/callbackfn-not-called-on-empty.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-not-called-on-empty.js index cd881b9b72..939b4b9105 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-not-called-on-empty.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-not-called-on-empty.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/TypedArray/prototype/reduceRight/callbackfn-resize.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-resize.js index 74ae23ee61..c8fe0f62c5 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-resize.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-resize.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/TypedArray/prototype/reduceRight/callbackfn-return-does-not-change-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-return-does-not-change-instance.js index 7a9e8244d3..e42b59cba7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-return-does-not-change-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-return-does-not-change-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/TypedArray/prototype/reduceRight/callbackfn-returns-abrupt.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-returns-abrupt.js index e37d426ce8..aac2d110ef 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-returns-abrupt.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-returns-abrupt.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/TypedArray/prototype/reduceRight/callbackfn-set-value-during-iteration.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-set-value-during-iteration.js index 3381fc34e1..21838fbb41 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-set-value-during-iteration.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-set-value-during-iteration.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/TypedArray/prototype/reduceRight/callbackfn-this.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-this.js index bc62313fbe..c7a659a020 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-this.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/callbackfn-this.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/TypedArray/prototype/reduceRight/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/detached-buffer.js index 703125d148..345c1ffdd1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/detached-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/TypedArray/prototype/reduceRight/empty-instance-return-initialvalue.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/empty-instance-return-initialvalue.js index eb3a4f12bb..119f4bb7ce 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/empty-instance-return-initialvalue.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/empty-instance-return-initialvalue.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/TypedArray/prototype/reduceRight/empty-instance-with-no-initialvalue-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/empty-instance-with-no-initialvalue-throws.js index e65a06ee40..09c3134bb1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/empty-instance-with-no-initialvalue-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/empty-instance-with-no-initialvalue-throws.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/TypedArray/prototype/reduceRight/get-length-uses-internal-arraylength.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/get-length-uses-internal-arraylength.js index 63d2ba2c75..16fde19f30 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/get-length-uses-internal-arraylength.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/get-length-uses-internal-arraylength.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/TypedArray/prototype/reduceRight/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/invoked-as-func.js index 0dd4b313ee..407d5f5118 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/invoked-as-func.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/TypedArray/prototype/reduceRight/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/invoked-as-method.js index 74f48b50d6..a057b7eec5 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/invoked-as-method.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/TypedArray/prototype/reduceRight/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/length.js index 075fdf1d6a..cacb72bec9 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.reduceRight.length, 1); - -verifyNotEnumerable(TypedArray.prototype.reduceRight, "length"); -verifyNotWritable(TypedArray.prototype.reduceRight, "length"); -verifyConfigurable(TypedArray.prototype.reduceRight, "length"); +verifyProperty(TypedArray.prototype.reduceRight, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/name.js index 46b5b553bc..b63e7b5623 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.reduceRight.name, "reduceRight"); - -verifyNotEnumerable(TypedArray.prototype.reduceRight, "name"); -verifyNotWritable(TypedArray.prototype.reduceRight, "name"); -verifyConfigurable(TypedArray.prototype.reduceRight, "name"); +verifyProperty(TypedArray.prototype.reduceRight, "name", { + value: "reduceRight", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/not-a-constructor.js index a208f6e644..6437833a36 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.reduceRight(() => {}, []); -}, '`let u8 = new Uint8Array(1); new u8.reduceRight(() => {}, [])` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/prop-desc.js index b3e98bf99d..97c1ac450d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/prop-desc.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/TypedArray/prototype/reduceRight/result-is-last-callbackfn-return.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/result-is-last-callbackfn-return.js index cdac8406de..ef58f68bcb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/result-is-last-callbackfn-return.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/result-is-last-callbackfn-return.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/TypedArray/prototype/reduceRight/result-of-any-type.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/result-of-any-type.js index 24e3da9059..fca21923f1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/result-of-any-type.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/result-of-any-type.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/TypedArray/prototype/reduceRight/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/return-abrupt-from-this-out-of-bounds.js index 0a842133bf..39c9ed455e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/reduceRight/return-first-value-without-callbackfn.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/return-first-value-without-callbackfn.js index ec61d34c4d..ba275a1e6a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/return-first-value-without-callbackfn.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/return-first-value-without-callbackfn.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/TypedArray/prototype/reduceRight/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/this-is-not-object.js index 64730d4df4..e8f2b9fd96 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/this-is-not-object.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/TypedArray/prototype/reduceRight/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/this-is-not-typedarray-instance.js index f55fd60dc2..3d6778c0e9 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/this-is-not-typedarray-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/TypedArray/prototype/reduceRight/values-are-not-cached.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/values-are-not-cached.js index 55afeef5d1..fc6c5b53da 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/values-are-not-cached.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reduceRight/values-are-not-cached.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/TypedArray/prototype/reverse/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/detached-buffer.js index 896082d81c..46650fc6e8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/detached-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/TypedArray/prototype/reverse/get-length-uses-internal-arraylength.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/get-length-uses-internal-arraylength.js index 5cead93847..908e458beb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/get-length-uses-internal-arraylength.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/get-length-uses-internal-arraylength.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/TypedArray/prototype/reverse/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/invoked-as-func.js index 370572c694..ede66061bc 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/invoked-as-func.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/TypedArray/prototype/reverse/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/invoked-as-method.js index 90f2791edd..33749b4ebe 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/invoked-as-method.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/TypedArray/prototype/reverse/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/length.js index b0387a8bc5..d223455250 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.reverse.length, 0); - -verifyNotEnumerable(TypedArray.prototype.reverse, "length"); -verifyNotWritable(TypedArray.prototype.reverse, "length"); -verifyConfigurable(TypedArray.prototype.reverse, "length"); +verifyProperty(TypedArray.prototype.reverse, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/name.js index 0d39739566..25397ad00e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.reverse.name, "reverse"); - -verifyNotEnumerable(TypedArray.prototype.reverse, "name"); -verifyNotWritable(TypedArray.prototype.reverse, "name"); -verifyConfigurable(TypedArray.prototype.reverse, "name"); +verifyProperty(TypedArray.prototype.reverse, "name", { + value: "reverse", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/not-a-constructor.js index 0a0bd3b968..0d05171789 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.reverse(); -}, '`let u8 = new Uint8Array(1); new u8.reverse()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/preserves-non-numeric-properties.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/preserves-non-numeric-properties.js index 3d04d8a0ac..73b64497ab 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/preserves-non-numeric-properties.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/preserves-non-numeric-properties.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/TypedArray/prototype/reverse/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/prop-desc.js index caba22fd33..a15e3f18b1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/prop-desc.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/TypedArray/prototype/reverse/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/return-abrupt-from-this-out-of-bounds.js index 5b9396d94a..3e8fa96124 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/reverse/returns-original-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/returns-original-object.js index 732dd0d193..fd7674a414 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/returns-original-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/returns-original-object.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/TypedArray/prototype/reverse/reverts.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/reverts.js index 8f476a8201..3cd9a7701e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/reverts.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/reverts.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/TypedArray/prototype/reverse/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/this-is-not-object.js index aed6161e54..c2d3e3c605 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/this-is-not-object.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/TypedArray/prototype/reverse/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/this-is-not-typedarray-instance.js index f5e662b567..fbdabdab08 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/reverse/this-is-not-typedarray-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/TypedArray/prototype/set/BigInt/src-typedarray-not-big-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/BigInt/src-typedarray-not-big-throws.js index 9250e0d7fc..6ce4b45e62 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/BigInt/src-typedarray-not-big-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/BigInt/src-typedarray-not-big-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Valerie Young. 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/TypedArray/prototype/set/array-arg-negative-integer-offset-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-negative-integer-offset-throws.js index a181191cc9..27a1447599 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-negative-integer-offset-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-negative-integer-offset-throws.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/TypedArray/prototype/set/array-arg-offset-tointeger.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-offset-tointeger.js index dbf9ca1d3f..0f2dcdbeee 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-offset-tointeger.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-offset-tointeger.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/TypedArray/prototype/set/array-arg-primitive-toobject.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-primitive-toobject.js index ed577e2012..5df469270f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-primitive-toobject.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-primitive-toobject.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Alexey Shvayka. 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/TypedArray/prototype/set/array-arg-return-abrupt-from-src-get-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-get-length.js index cfbf10dbea..dbc0539d0c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-get-length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-get-length.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/TypedArray/prototype/set/array-arg-return-abrupt-from-src-get-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-get-value.js index bec35b327b..9eff93eea3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-get-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-get-value.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/TypedArray/prototype/set/array-arg-return-abrupt-from-src-length-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-length-symbol.js index 07c226e5b7..a7007a5bbc 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-length-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-length-symbol.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/TypedArray/prototype/set/array-arg-return-abrupt-from-src-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-length.js index c046c5c12d..7254363942 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-length.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/TypedArray/prototype/set/array-arg-return-abrupt-from-src-tonumber-value-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-tonumber-value-symbol.js index ef71d78dd0..1eb3aa9faf 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-tonumber-value-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-tonumber-value-symbol.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/TypedArray/prototype/set/array-arg-return-abrupt-from-src-tonumber-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-tonumber-value.js index 79a87c36b3..c72e58a113 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-tonumber-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-tonumber-value.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/TypedArray/prototype/set/array-arg-return-abrupt-from-tointeger-offset-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-tointeger-offset-symbol.js index ae70c2693e..1c305d6207 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-tointeger-offset-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-tointeger-offset-symbol.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/TypedArray/prototype/set/array-arg-return-abrupt-from-tointeger-offset.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-tointeger-offset.js index a2afd09f7e..d827b90c2a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-tointeger-offset.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-tointeger-offset.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/TypedArray/prototype/set/array-arg-return-abrupt-from-toobject-offset.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-toobject-offset.js index f479186b51..e8fa063ae4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-toobject-offset.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-toobject-offset.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/TypedArray/prototype/set/array-arg-set-values-in-order.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-set-values-in-order.js index e74106d4c7..47cd8200d6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-set-values-in-order.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-set-values-in-order.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/TypedArray/prototype/set/array-arg-set-values.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-set-values.js index 4a5c4acb8a..4e45f5fae6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-set-values.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-set-values.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/TypedArray/prototype/set/array-arg-src-tonumber-value-conversions.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-src-tonumber-value-conversions.js index fe4bef4fe0..470feb0023 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-src-tonumber-value-conversions.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-src-tonumber-value-conversions.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/TypedArray/prototype/set/array-arg-src-tonumber-value-type-conversions.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-src-tonumber-value-type-conversions.js index 135588343b..a6f0960989 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-src-tonumber-value-type-conversions.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-src-tonumber-value-type-conversions.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/TypedArray/prototype/set/array-arg-src-values-are-not-cached.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-src-values-are-not-cached.js index b2440a89db..77c0db808f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-src-values-are-not-cached.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-src-values-are-not-cached.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/TypedArray/prototype/set/array-arg-target-arraylength-internal.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-target-arraylength-internal.js index 8992c3eb34..6f9fad2406 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-target-arraylength-internal.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-target-arraylength-internal.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/TypedArray/prototype/set/array-arg-targetbuffer-detached-on-get-src-value-no-throw.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-targetbuffer-detached-on-get-src-value-no-throw.js index e67af3acb5..7b6f4b26e4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-targetbuffer-detached-on-get-src-value-no-throw.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-targetbuffer-detached-on-get-src-value-no-throw.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2022 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/TypedArray/prototype/set/array-arg-targetbuffer-detached-on-tointeger-offset-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-targetbuffer-detached-on-tointeger-offset-throws.js index 8cf8a6ffb2..f50a44cad7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-targetbuffer-detached-on-tointeger-offset-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-targetbuffer-detached-on-tointeger-offset-throws.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/TypedArray/prototype/set/array-arg-targetbuffer-detached-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-targetbuffer-detached-throws.js index aaf0b2ef01..65aa725309 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-targetbuffer-detached-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/array-arg-targetbuffer-detached-throws.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/TypedArray/prototype/set/bit-precision.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/bit-precision.js index dd56f5e98a..4a9f581845 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/bit-precision.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/bit-precision.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/TypedArray/prototype/set/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/invoked-as-func.js index 3201477ce0..becdb75f8f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/invoked-as-func.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/TypedArray/prototype/set/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/invoked-as-method.js index 9636b4a1de..934436b77e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/invoked-as-method.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/TypedArray/prototype/set/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/length.js index 83ece00244..63ec5e80f3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.set.length, 1); - -verifyNotEnumerable(TypedArray.prototype.set, "length"); -verifyNotWritable(TypedArray.prototype.set, "length"); -verifyConfigurable(TypedArray.prototype.set, "length"); +verifyProperty(TypedArray.prototype.set, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/set/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/name.js index cdaf0d8382..d5ba537807 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.set.name, "set"); - -verifyNotEnumerable(TypedArray.prototype.set, "name"); -verifyNotWritable(TypedArray.prototype.set, "name"); -verifyConfigurable(TypedArray.prototype.set, "name"); +verifyProperty(TypedArray.prototype.set, "name", { + value: "set", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/set/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/not-a-constructor.js index 818ea73dbd..2c4c819538 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.set([0], 0); -}, '`let u8 = new Uint8Array(1); new u8.set([0], 0)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/set/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/prop-desc.js index 6c78673324..45a356c6ad 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/prop-desc.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/TypedArray/prototype/set/src-typedarray-big-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/src-typedarray-big-throws.js index bd388c9953..b445b7954b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/src-typedarray-big-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/src-typedarray-big-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Valerie Young. 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/TypedArray/prototype/set/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/this-is-not-object.js index d8b62e11a2..bbdd923131 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/this-is-not-object.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/TypedArray/prototype/set/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/this-is-not-typedarray-instance.js index fdac8e08cd..a5a3282935 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/this-is-not-typedarray-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/TypedArray/prototype/set/typedarray-arg-negative-integer-offset-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-negative-integer-offset-throws.js index 26a9ef1064..5a6d22b17a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-negative-integer-offset-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-negative-integer-offset-throws.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/TypedArray/prototype/set/typedarray-arg-offset-tointeger.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-offset-tointeger.js index e4c73580bb..c88e6a9ba2 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-offset-tointeger.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-offset-tointeger.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/TypedArray/prototype/set/typedarray-arg-return-abrupt-from-tointeger-offset-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-return-abrupt-from-tointeger-offset-symbol.js index 5672695847..7d78c38e6d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-return-abrupt-from-tointeger-offset-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-return-abrupt-from-tointeger-offset-symbol.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/TypedArray/prototype/set/typedarray-arg-return-abrupt-from-tointeger-offset.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-return-abrupt-from-tointeger-offset.js index a5f8f15186..75eecdf7cc 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-return-abrupt-from-tointeger-offset.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-return-abrupt-from-tointeger-offset.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/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type-conversions-sab.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type-conversions-sab.js index b2eb05f8af..4a9af6f239 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type-conversions-sab.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type-conversions-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type-conversions.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type-conversions.js index 8b6f0655ea..71bd008f89 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type-conversions.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type-conversions.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/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type-sab.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type-sab.js index 3e289e32ae..d4999b33ef 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type-sab.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type.js index 75dca6862e..9c90262437 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type.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/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-same-type-sab.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-same-type-sab.js index c7e109ba8d..84d8517305 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-same-type-sab.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-same-type-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-same-type.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-same-type.js index 1990f48b7d..91512af5d1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-same-type.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-same-type.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/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js index d5af3ec6ec..69d0ee1866 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.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/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-same-type-resized.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-same-type-resized.js index c50f9a9606..d671a99b94 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-same-type-resized.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-same-type-resized.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/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-same-type-sab.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-same-type-sab.js index 40cf0eecb5..606fce0b2d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-same-type-sab.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-same-type-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-same-type.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-same-type.js index 25a20358b0..ffda7dd684 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-same-type.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-same-type.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/TypedArray/prototype/set/typedarray-arg-src-arraylength-internal.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-src-arraylength-internal.js index 29e8a8ca3a..16b8d2dfd6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-src-arraylength-internal.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-src-arraylength-internal.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/TypedArray/prototype/set/typedarray-arg-src-byteoffset-internal.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-src-byteoffset-internal.js index 0d9d251568..aee12428ad 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-src-byteoffset-internal.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-src-byteoffset-internal.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2017 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/TypedArray/prototype/set/typedarray-arg-src-range-greather-than-target-throws-rangeerror.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-src-range-greather-than-target-throws-rangeerror.js index 4a4af2c71d..9c10fb34f9 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-src-range-greather-than-target-throws-rangeerror.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-src-range-greather-than-target-throws-rangeerror.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/TypedArray/prototype/set/typedarray-arg-srcbuffer-detached-during-tointeger-offset-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-srcbuffer-detached-during-tointeger-offset-throws.js index a43d522c01..64dd408966 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-srcbuffer-detached-during-tointeger-offset-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-srcbuffer-detached-during-tointeger-offset-throws.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/TypedArray/prototype/set/typedarray-arg-target-arraylength-internal.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-target-arraylength-internal.js index ae3ef5b834..e198167d2f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-target-arraylength-internal.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-target-arraylength-internal.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/TypedArray/prototype/set/typedarray-arg-target-byteoffset-internal.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-target-byteoffset-internal.js index 9e852856ec..30e36763e6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-target-byteoffset-internal.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-target-byteoffset-internal.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2017 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/TypedArray/prototype/set/typedarray-arg-target-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-target-out-of-bounds.js index bb7cbe0ad2..29f6975cfa 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-target-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-target-out-of-bounds.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/TypedArray/prototype/set/typedarray-arg-targetbuffer-detached-during-tointeger-offset-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-targetbuffer-detached-during-tointeger-offset-throws.js index 521772dfff..dcbb6d2802 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-targetbuffer-detached-during-tointeger-offset-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/set/typedarray-arg-targetbuffer-detached-during-tointeger-offset-throws.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/TypedArray/prototype/slice/arraylength-internal.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/arraylength-internal.js index 6a7431fdd4..3e840736bd 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/arraylength-internal.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/arraylength-internal.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/TypedArray/prototype/slice/bit-precision.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/bit-precision.js index e68a251a91..69b7388c13 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/bit-precision.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/bit-precision.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/TypedArray/prototype/slice/detached-buffer-custom-ctor-other-targettype.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-other-targettype.js index 98e67832dd..23a88fe065 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-other-targettype.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-other-targettype.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/TypedArray/prototype/slice/detached-buffer-custom-ctor-same-targettype.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-same-targettype.js index cff4bdfe80..760d806878 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-same-targettype.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-custom-ctor-same-targettype.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/TypedArray/prototype/slice/detached-buffer-get-ctor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-get-ctor.js index def685a2d6..82816b136e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-get-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-get-ctor.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/TypedArray/prototype/slice/detached-buffer-speciesctor-get-species-custom-ctor-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-speciesctor-get-species-custom-ctor-throws.js index bc4ddecd6e..299eecc959 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-speciesctor-get-species-custom-ctor-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-speciesctor-get-species-custom-ctor-throws.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/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-other-targettype.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-other-targettype.js index df223edad8..1c40898844 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-other-targettype.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-other-targettype.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/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-same-targettype.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-same-targettype.js index d6e018010a..a1d1dad8f5 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-same-targettype.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer-zero-count-custom-ctor-same-targettype.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/TypedArray/prototype/slice/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer.js index f89105dfce..909bb02529 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/detached-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/TypedArray/prototype/slice/infinity.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/infinity.js index 4d4e53a76f..0bfa40656b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/infinity.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/infinity.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/TypedArray/prototype/slice/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/invoked-as-func.js index c41db512d4..1f62b2ba24 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/invoked-as-func.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/TypedArray/prototype/slice/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/invoked-as-method.js index abbf41b1bb..538b2c7917 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/invoked-as-method.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/TypedArray/prototype/slice/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/length.js index b4dc6292c2..90f5209830 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.slice.length, 2); - -verifyNotEnumerable(TypedArray.prototype.slice, "length"); -verifyNotWritable(TypedArray.prototype.slice, "length"); -verifyConfigurable(TypedArray.prototype.slice, "length"); +verifyProperty(TypedArray.prototype.slice, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/minus-zero.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/minus-zero.js index cec3ea1260..206449af2a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/minus-zero.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/minus-zero.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/TypedArray/prototype/slice/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/name.js index 0065064c4f..1378804fb3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.slice.name, "slice"); - -verifyNotEnumerable(TypedArray.prototype.slice, "name"); -verifyNotWritable(TypedArray.prototype.slice, "name"); -verifyConfigurable(TypedArray.prototype.slice, "name"); +verifyProperty(TypedArray.prototype.slice, "name", { + value: "slice", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/not-a-constructor.js index c22277eea3..6b9bdc917e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.slice(); -}, '`let u8 = new Uint8Array(1); new u8.slice()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/prop-desc.js index 7866448d95..8e43962613 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/prop-desc.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/TypedArray/prototype/slice/result-does-not-copy-ordinary-properties.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/result-does-not-copy-ordinary-properties.js index ca5360e87e..8d3f888705 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/result-does-not-copy-ordinary-properties.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/result-does-not-copy-ordinary-properties.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/TypedArray/prototype/slice/results-with-different-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/results-with-different-length.js index 21507d93fd..8a8ccbd0c1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/results-with-different-length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/results-with-different-length.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/TypedArray/prototype/slice/results-with-empty-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/results-with-empty-length.js index 2b0610a11e..e88fbe122c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/results-with-empty-length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/results-with-empty-length.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/TypedArray/prototype/slice/results-with-same-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/results-with-same-length.js index 2d9cb4ac26..42580f4acd 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/results-with-same-length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/results-with-same-length.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/TypedArray/prototype/slice/return-abrupt-from-end-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/return-abrupt-from-end-symbol.js index 2d73a65949..39e89edaff 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/return-abrupt-from-end-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/return-abrupt-from-end-symbol.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/TypedArray/prototype/slice/return-abrupt-from-end.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/return-abrupt-from-end.js index a0c21bf198..97e953b951 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/return-abrupt-from-end.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/return-abrupt-from-end.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/TypedArray/prototype/slice/return-abrupt-from-start-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/return-abrupt-from-start-symbol.js index 5e87198742..796d4c7ebc 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/return-abrupt-from-start-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/return-abrupt-from-start-symbol.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/TypedArray/prototype/slice/return-abrupt-from-start.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/return-abrupt-from-start.js index 5c9aa7c2d4..b0ae21e426 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/return-abrupt-from-start.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/return-abrupt-from-start.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/TypedArray/prototype/slice/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/return-abrupt-from-this-out-of-bounds.js index 84d4e25bcf..7f3d216b3d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/slice/set-values-from-different-ctor-type.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/set-values-from-different-ctor-type.js index f9ad9584bd..24fd3ff83a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/set-values-from-different-ctor-type.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/set-values-from-different-ctor-type.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/TypedArray/prototype/slice/speciesctor-destination-resizable.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-destination-resizable.js index 8b2674b9f8..9e44870815 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-destination-resizable.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-destination-resizable.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) 2023 Igalia, S.L. 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/TypedArray/prototype/slice/speciesctor-get-ctor-abrupt.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-abrupt.js index dcf690fb8f..c673ed7021 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-abrupt.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-abrupt.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/TypedArray/prototype/slice/speciesctor-get-ctor-inherited.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-inherited.js index 66551be445..04c1f7dbca 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-inherited.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-inherited.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/TypedArray/prototype/slice/speciesctor-get-ctor-returns-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-returns-throws.js index 6bb0dec7be..a4e5da18bd 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-returns-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-returns-throws.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/TypedArray/prototype/slice/speciesctor-get-ctor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor.js index 91abb251a5..a750ade08e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor.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/TypedArray/prototype/slice/speciesctor-get-species-abrupt.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-abrupt.js index c5e87d9908..34b90cd52e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-abrupt.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-abrupt.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/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-invocation.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-invocation.js index ec10f87cec..80a961a3f4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-invocation.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-invocation.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/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js index f76bc4dbad..dc235605f3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-length-throws-resizable-arraybuffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-length-throws-resizable-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) 2023 Igalia, S.L. 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/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-length-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-length-throws.js index c8544e8c00..627482dc82 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-length-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-length-throws.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/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-length.js index 8b8f45205c..604bd75b30 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-length.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/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-returns-another-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-returns-another-instance.js index fb5bf37410..cecd96365d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-returns-another-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-returns-another-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/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-throws.js index 840a42a507..98d9d5082c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-throws.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/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor.js index 653a5aa24a..5b8c3c6097 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor.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/TypedArray/prototype/slice/speciesctor-get-species-returns-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-returns-throws.js index c7a8bba242..f98827b433 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-returns-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-returns-throws.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/TypedArray/prototype/slice/speciesctor-get-species-use-default-ctor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-use-default-ctor.js index b50e582639..d80df4a0e1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-use-default-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species-use-default-ctor.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/TypedArray/prototype/slice/speciesctor-get-species.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species.js index 0fd855cefd..1377135990 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/speciesctor-get-species.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/TypedArray/prototype/slice/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/this-is-not-object.js index f47390fd8a..effe081914 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/this-is-not-object.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/TypedArray/prototype/slice/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/this-is-not-typedarray-instance.js index 8844744c09..c9a146572f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/this-is-not-typedarray-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/TypedArray/prototype/slice/tointeger-end.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/tointeger-end.js index ef3e1975d8..3651207b73 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/tointeger-end.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/tointeger-end.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/TypedArray/prototype/slice/tointeger-start.js b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/tointeger-start.js index 3ebf4087aa..4e82a93114 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/slice/tointeger-start.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/slice/tointeger-start.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/TypedArray/prototype/some/callbackfn-arguments-with-thisarg.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-arguments-with-thisarg.js index d33d176b86..cede559699 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-arguments-with-thisarg.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-arguments-with-thisarg.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/TypedArray/prototype/some/callbackfn-arguments-without-thisarg.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-arguments-without-thisarg.js index ee882504fa..323daa434d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-arguments-without-thisarg.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-arguments-without-thisarg.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/TypedArray/prototype/some/callbackfn-detachbuffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-detachbuffer.js index 101a1b8f27..fc2c84a8cd 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-detachbuffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-detachbuffer.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/TypedArray/prototype/some/callbackfn-no-interaction-over-non-integer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-no-interaction-over-non-integer.js index 2b72c24ac2..4db26c7f35 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-no-interaction-over-non-integer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-no-interaction-over-non-integer.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/TypedArray/prototype/some/callbackfn-not-callable-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-not-callable-throws.js index 550476faf9..566d7502a8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-not-callable-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-not-callable-throws.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/TypedArray/prototype/some/callbackfn-not-called-on-empty.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-not-called-on-empty.js index 912e8bb1de..a00f82b7e4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-not-called-on-empty.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-not-called-on-empty.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/TypedArray/prototype/some/callbackfn-resize.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-resize.js index 1affd3f4b2..d678030267 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-resize.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-resize.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/TypedArray/prototype/some/callbackfn-return-does-not-change-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-return-does-not-change-instance.js index 3b63658139..a76efd1366 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-return-does-not-change-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-return-does-not-change-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/TypedArray/prototype/some/callbackfn-returns-abrupt.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-returns-abrupt.js index 5aea9d38df..8034e83b10 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-returns-abrupt.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-returns-abrupt.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/TypedArray/prototype/some/callbackfn-set-value-during-interaction.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-set-value-during-interaction.js index 74935314b5..80dfca903b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-set-value-during-interaction.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-set-value-during-interaction.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/TypedArray/prototype/some/callbackfn-this.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-this.js index fa1d572adb..028ce99f2b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-this.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/callbackfn-this.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/TypedArray/prototype/some/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/detached-buffer.js index 45765bd6d2..a582eb2d28 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/detached-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/TypedArray/prototype/some/get-length-uses-internal-arraylength.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/get-length-uses-internal-arraylength.js index 28f970779f..d81174babf 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/get-length-uses-internal-arraylength.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/get-length-uses-internal-arraylength.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/TypedArray/prototype/some/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/invoked-as-func.js index 9041ac22aa..1cc7d9ab46 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/invoked-as-func.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/TypedArray/prototype/some/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/invoked-as-method.js index ae1b089198..b5ad9a2ead 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/invoked-as-method.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/TypedArray/prototype/some/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/length.js index c610a9f8a8..c80d6bb556 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.some.length, 1); - -verifyNotEnumerable(TypedArray.prototype.some, "length"); -verifyNotWritable(TypedArray.prototype.some, "length"); -verifyConfigurable(TypedArray.prototype.some, "length"); +verifyProperty(TypedArray.prototype.some, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/some/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/name.js index 93e47d5de1..e1b549dcca 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.some.name, "some"); - -verifyNotEnumerable(TypedArray.prototype.some, "name"); -verifyNotWritable(TypedArray.prototype.some, "name"); -verifyConfigurable(TypedArray.prototype.some, "name"); +verifyProperty(TypedArray.prototype.some, "name", { + value: "some", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/some/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/not-a-constructor.js index 99efaa7776..1834bf0554 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.some(() => {}); -}, '`let u8 = new Uint8Array(1); new u8.some(() => {})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/some/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/prop-desc.js index 41d68a78bc..4211e0adfe 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/prop-desc.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/TypedArray/prototype/some/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/return-abrupt-from-this-out-of-bounds.js index e18d7020e8..9da1d57834 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/some/returns-false-if-every-cb-returns-false.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/returns-false-if-every-cb-returns-false.js index 1cd998f2b5..bb5bad5965 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/returns-false-if-every-cb-returns-false.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/returns-false-if-every-cb-returns-false.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/TypedArray/prototype/some/returns-true-if-any-cb-returns-true.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/returns-true-if-any-cb-returns-true.js index 7a8c8100b2..0927c497db 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/returns-true-if-any-cb-returns-true.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/returns-true-if-any-cb-returns-true.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/TypedArray/prototype/some/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/this-is-not-object.js index 408ac5ff28..6e5c7b5eb4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/this-is-not-object.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/TypedArray/prototype/some/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/this-is-not-typedarray-instance.js index 08b3c3b6ed..640b38b504 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/this-is-not-typedarray-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/TypedArray/prototype/some/values-are-not-cached.js b/js/src/tests/test262/built-ins/TypedArray/prototype/some/values-are-not-cached.js index 068ba9f1a1..23551a549b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/some/values-are-not-cached.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/some/values-are-not-cached.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/TypedArray/prototype/sort/arraylength-internal.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/arraylength-internal.js index b11284fb67..bedc736b95 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/arraylength-internal.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/arraylength-internal.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/TypedArray/prototype/sort/comparefn-call-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/comparefn-call-throws.js index 4ec5160af3..abd5025428 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/comparefn-call-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/comparefn-call-throws.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/TypedArray/prototype/sort/comparefn-calls.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/comparefn-calls.js index 53c60777d9..9d79cd1891 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/comparefn-calls.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/comparefn-calls.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/TypedArray/prototype/sort/comparefn-is-undefined.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/comparefn-is-undefined.js index f63e734f2d..029528b6db 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/comparefn-is-undefined.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/comparefn-is-undefined.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArray/prototype/sort/comparefn-nonfunction-call-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/comparefn-nonfunction-call-throws.js index 8bbdd3bce0..cc87ace424 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/comparefn-nonfunction-call-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/comparefn-nonfunction-call-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2017 Jordan Harband. 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/TypedArray/prototype/sort/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/detached-buffer.js index cb25eab0dd..2ff62a3bdf 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/detached-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/TypedArray/prototype/sort/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/invoked-as-func.js index 582fe56c42..ca07ff6784 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/invoked-as-func.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/TypedArray/prototype/sort/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/invoked-as-method.js index 50f84f46dd..7f13209cbd 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/invoked-as-method.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/TypedArray/prototype/sort/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/length.js index bb8480eaa4..51b5c0b1dc 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.sort.length, 1); - -verifyNotEnumerable(TypedArray.prototype.sort, "length"); -verifyNotWritable(TypedArray.prototype.sort, "length"); -verifyConfigurable(TypedArray.prototype.sort, "length"); +verifyProperty(TypedArray.prototype.sort, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/name.js index 347586ddce..c1d68121d9 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.sort.name, "sort"); - -verifyNotEnumerable(TypedArray.prototype.sort, "name"); -verifyNotWritable(TypedArray.prototype.sort, "name"); -verifyConfigurable(TypedArray.prototype.sort, "name"); +verifyProperty(TypedArray.prototype.sort, "name", { + value: "sort", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/not-a-constructor.js index 4814d4a7df..fb5196097a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.sort(); -}, '`let u8 = new Uint8Array(1); new u8.sort()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/prop-desc.js index 8d0d2d273b..80c539ac16 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/prop-desc.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/TypedArray/prototype/sort/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/return-abrupt-from-this-out-of-bounds.js index acd949c90d..89615c6722 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/sort/return-same-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/return-same-instance.js index ad1283c0f5..108d166c19 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/return-same-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/return-same-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/TypedArray/prototype/sort/sort-tonumber.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/sort-tonumber.js index dcc99bc87c..b24bfc96e4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/sort-tonumber.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/sort-tonumber.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Mozilla Corporation. 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/TypedArray/prototype/sort/sortcompare-with-no-tostring.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/sortcompare-with-no-tostring.js index 82c8d16ad2..53b60393cc 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/sortcompare-with-no-tostring.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/sortcompare-with-no-tostring.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/TypedArray/prototype/sort/sorted-values-nan.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/sorted-values-nan.js index 2a6ff72aab..a74c18e592 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/sorted-values-nan.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/sorted-values-nan.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/TypedArray/prototype/sort/sorted-values.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/sorted-values.js index 459c40a13d..4303d47897 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/sorted-values.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/sorted-values.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/TypedArray/prototype/sort/stability.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/stability.js index 3a904f9f02..5c000d3953 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/stability.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/stability.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2019 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/TypedArray/prototype/sort/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/this-is-not-object.js index 0331551ca8..f0e7be7a9a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/this-is-not-object.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/TypedArray/prototype/sort/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/this-is-not-typedarray-instance.js index 8dfac62ce6..26c7513eca 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/sort/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/sort/this-is-not-typedarray-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/TypedArray/prototype/subarray/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/detached-buffer.js index c65f6efff6..1d2dc2c484 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/detached-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/TypedArray/prototype/subarray/infinity.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/infinity.js index 283689ecea..1bef2b4196 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/infinity.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/infinity.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/TypedArray/prototype/subarray/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/invoked-as-func.js index 7bd0688838..bb5d1c4ed7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/invoked-as-func.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/TypedArray/prototype/subarray/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/invoked-as-method.js index c5c39eb9e3..9496616c45 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/invoked-as-method.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/TypedArray/prototype/subarray/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/length.js index 7c29e2ff6b..dc5fe0bcfc 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.subarray.length, 2); - -verifyNotEnumerable(TypedArray.prototype.subarray, "length"); -verifyNotWritable(TypedArray.prototype.subarray, "length"); -verifyConfigurable(TypedArray.prototype.subarray, "length"); +verifyProperty(TypedArray.prototype.subarray, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/minus-zero.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/minus-zero.js index 8c77ef6dd2..444d9a204d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/minus-zero.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/minus-zero.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/TypedArray/prototype/subarray/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/name.js index 890fd6c7ce..d68577f8c7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.subarray.name, "subarray"); - -verifyNotEnumerable(TypedArray.prototype.subarray, "name"); -verifyNotWritable(TypedArray.prototype.subarray, "name"); -verifyConfigurable(TypedArray.prototype.subarray, "name"); +verifyProperty(TypedArray.prototype.subarray, "name", { + value: "subarray", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/not-a-constructor.js index 1714a12b2a..db549cbc9d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.subarray(); -}, '`let u8 = new Uint8Array(1); new u8.subarray()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/prop-desc.js index e21769abed..b774846318 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/prop-desc.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/TypedArray/prototype/subarray/result-byteOffset-from-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/result-byteOffset-from-out-of-bounds.js new file mode 100644 index 0000000000..f7d1214d8f --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/result-byteOffset-from-out-of-bounds.js @@ -0,0 +1,52 @@ +// |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-%typedarray%.prototype.subarray +description: > + Result has the correct byteOffset when input is initially out-of-bounds. +info: | + %TypedArray%.prototype.subarray ( start, end ) + + ... + 13. Let srcByteOffset be O.[[ByteOffset]]. + 14. Let beginByteOffset be srcByteOffset + (startIndex × elementSize). + 15. If O.[[ArrayLength]] is auto and end is undefined, then + a. Let argumentsList be « buffer, 𝔽(beginByteOffset) ». + 16. + ... + e. Let newLength be max(endIndex - startIndex, 0). + f. Let argumentsList be « buffer, 𝔽(beginByteOffset), 𝔽(newLength) ». + 17. Return ? TypedArraySpeciesCreate(O, argumentsList). +features: [TypedArray, resizable-arraybuffer] +---*/ + +let rab = new ArrayBuffer(10, {maxByteLength: 10}); + +let autoLength = new Int8Array(rab, 4); +let withLength = new Int8Array(rab, 4, 2); + +let start = { + valueOf() { + // Make |autoLength| and |withLength| in-bounds again. + rab.resize(10); + return 1; + } +}; + +// Make |autoLength| out-of-bounds. +rab.resize(0); + +let resultAutoLength = autoLength.subarray(start); +assert.sameValue(resultAutoLength.byteOffset, 4); +assert.sameValue(resultAutoLength.length, 6); + +// Make |withLength| out-of-bounds. +rab.resize(0); + +let resultWithLength = withLength.subarray(start); +assert.sameValue(resultWithLength.byteOffset, 4); +assert.sameValue(resultWithLength.length, 0); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/result-does-not-copy-ordinary-properties.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/result-does-not-copy-ordinary-properties.js index 6bd16f4c9b..dff7641edd 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/result-does-not-copy-ordinary-properties.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/result-does-not-copy-ordinary-properties.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/TypedArray/prototype/subarray/result-is-new-instance-from-same-ctor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/result-is-new-instance-from-same-ctor.js index 48d9a3b490..ea68f2309d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/result-is-new-instance-from-same-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/result-is-new-instance-from-same-ctor.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/TypedArray/prototype/subarray/result-is-new-instance-with-shared-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/result-is-new-instance-with-shared-buffer.js index 223703aaa4..8596786801 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/result-is-new-instance-with-shared-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/result-is-new-instance-with-shared-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/TypedArray/prototype/subarray/results-with-different-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/results-with-different-length.js index 3445ae36be..d16251bd26 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/results-with-different-length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/results-with-different-length.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/TypedArray/prototype/subarray/results-with-empty-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/results-with-empty-length.js index 204effe618..d26583ee0a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/results-with-empty-length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/results-with-empty-length.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/TypedArray/prototype/subarray/results-with-same-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/results-with-same-length.js index 614ad244ed..520adfc6b9 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/results-with-same-length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/results-with-same-length.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/TypedArray/prototype/subarray/return-abrupt-from-begin-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/return-abrupt-from-begin-symbol.js index 650627c289..4644cf09d6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/return-abrupt-from-begin-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/return-abrupt-from-begin-symbol.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/TypedArray/prototype/subarray/return-abrupt-from-begin.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/return-abrupt-from-begin.js index 9f8f28630b..6ad924f229 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/return-abrupt-from-begin.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/return-abrupt-from-begin.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/TypedArray/prototype/subarray/return-abrupt-from-end-symbol.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/return-abrupt-from-end-symbol.js index 0e64f4ed39..d90ab8a2ef 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/return-abrupt-from-end-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/return-abrupt-from-end-symbol.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/TypedArray/prototype/subarray/return-abrupt-from-end.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/return-abrupt-from-end.js index 3ab6a1c68c..f53845eebc 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/return-abrupt-from-end.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/return-abrupt-from-end.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/TypedArray/prototype/subarray/speciesctor-get-ctor-abrupt.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-abrupt.js index c141c84747..832141e2bd 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-abrupt.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-abrupt.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/TypedArray/prototype/subarray/speciesctor-get-ctor-inherited.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-inherited.js index b09d8759c5..771d7a1f9f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-inherited.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-inherited.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/TypedArray/prototype/subarray/speciesctor-get-ctor-returns-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-returns-throws.js index 7b96f3041c..f64303eeb8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-returns-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-returns-throws.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/TypedArray/prototype/subarray/speciesctor-get-ctor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor.js index a14d069528..07f5995040 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor.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/TypedArray/prototype/subarray/speciesctor-get-species-abrupt.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-abrupt.js index 7e40dbe686..1a4e4e5f72 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-abrupt.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-abrupt.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/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-invocation.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-invocation.js index 1590a0c45b..77dc50a3bf 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-invocation.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-invocation.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/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-returns-another-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-returns-another-instance.js index f86ed913db..7193e2ef82 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-returns-another-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-returns-another-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/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-throws.js index 5e3d0d7be7..9a93ebc9e9 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-throws.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/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor.js index 46e69712ee..6d490ad24e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor.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/TypedArray/prototype/subarray/speciesctor-get-species-returns-throws.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-returns-throws.js index 01411d313c..1d756ebe46 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-returns-throws.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-returns-throws.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/TypedArray/prototype/subarray/speciesctor-get-species-use-default-ctor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-use-default-ctor.js index cb21cd8f3c..97994233bb 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-use-default-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-use-default-ctor.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/TypedArray/prototype/subarray/speciesctor-get-species.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species.js index 26bae75f03..295e2f51ca 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/speciesctor-get-species.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/TypedArray/prototype/subarray/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/this-is-not-object.js index e8aca60f7b..0a314533e8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/this-is-not-object.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/TypedArray/prototype/subarray/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/this-is-not-typedarray-instance.js index da35e935f1..698b07da72 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/this-is-not-typedarray-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/TypedArray/prototype/subarray/tointeger-begin.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/tointeger-begin.js index de48a3d1a6..445a7daa7c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/tointeger-begin.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/tointeger-begin.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/TypedArray/prototype/subarray/tointeger-end.js b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/tointeger-end.js index a45c5258da..31c6d2d04a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/tointeger-end.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/subarray/tointeger-end.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/TypedArray/prototype/toLocaleString/calls-tolocalestring-from-each-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/calls-tolocalestring-from-each-value.js index 7cbb2cb39a..e8ad0a1010 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/calls-tolocalestring-from-each-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/calls-tolocalestring-from-each-value.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/TypedArray/prototype/toLocaleString/calls-tostring-from-each-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/calls-tostring-from-each-value.js index 585035169e..5075e32d17 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/calls-tostring-from-each-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/calls-tostring-from-each-value.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/TypedArray/prototype/toLocaleString/calls-valueof-from-each-value.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/calls-valueof-from-each-value.js index 379470d105..3e8a0aee6c 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/calls-valueof-from-each-value.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/calls-valueof-from-each-value.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/TypedArray/prototype/toLocaleString/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/detached-buffer.js index df5d1a5a8c..bfb1552154 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/detached-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/TypedArray/prototype/toLocaleString/empty-instance-returns-empty-string.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/empty-instance-returns-empty-string.js index fb9690e4eb..08321c7ebd 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/empty-instance-returns-empty-string.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/empty-instance-returns-empty-string.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/TypedArray/prototype/toLocaleString/get-length-uses-internal-arraylength.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/get-length-uses-internal-arraylength.js index 910b72a391..1e8ac66692 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/get-length-uses-internal-arraylength.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/get-length-uses-internal-arraylength.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/TypedArray/prototype/toLocaleString/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/invoked-as-func.js index 50b138d41b..aa91b99950 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/invoked-as-func.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/TypedArray/prototype/toLocaleString/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/invoked-as-method.js index da9ce62df8..27cad0672f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/invoked-as-method.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/TypedArray/prototype/toLocaleString/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/length.js index fcd30d3ec8..1769ea0b70 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.toLocaleString.length, 0); - -verifyNotEnumerable(TypedArray.prototype.toLocaleString, "length"); -verifyNotWritable(TypedArray.prototype.toLocaleString, "length"); -verifyConfigurable(TypedArray.prototype.toLocaleString, "length"); +verifyProperty(TypedArray.prototype.toLocaleString, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/name.js index b793dd388b..fcace09fbe 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.toLocaleString.name, "toLocaleString"); - -verifyNotEnumerable(TypedArray.prototype.toLocaleString, "name"); -verifyNotWritable(TypedArray.prototype.toLocaleString, "name"); -verifyConfigurable(TypedArray.prototype.toLocaleString, "name"); +verifyProperty(TypedArray.prototype.toLocaleString, "name", { + value: "toLocaleString", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/not-a-constructor.js index 3366ceacde..43f6f01e8e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.toLocaleString(); -}, '`let u8 = new Uint8Array(1); new u8.toLocaleString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/prop-desc.js index e4d7516476..b2047d7b2d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/prop-desc.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/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tolocalestring.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tolocalestring.js index 9114df1a13..5be853baa4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tolocalestring.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tolocalestring.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/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tostring.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tostring.js index 05095bd645..73ff05af24 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tostring.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tostring.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/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-valueof.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-valueof.js index 690e9c32e6..26091b52ca 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-valueof.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-valueof.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/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tolocalestring.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tolocalestring.js index f46d410a13..2c53e6a04d 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tolocalestring.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tolocalestring.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/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tostring.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tostring.js index 7b3f2d68ba..3cc0c245a6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tostring.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tostring.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/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-valueof.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-valueof.js index acc8eca436..325707fec0 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-valueof.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-valueof.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/TypedArray/prototype/toLocaleString/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-this-out-of-bounds.js index bb1e1efc42..0fcab21960 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/toLocaleString/return-result.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-result.js index 60cd013f90..e597817d5e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-result.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/return-result.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/TypedArray/prototype/toLocaleString/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/this-is-not-object.js index 2c471f761e..2c7b869124 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/this-is-not-object.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/TypedArray/prototype/toLocaleString/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/this-is-not-typedarray-instance.js index b3c33fc0c2..4393449b20 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toLocaleString/this-is-not-typedarray-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/TypedArray/prototype/toReversed/ignores-species.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/ignores-species.js index 9534b8b924..050df4a650 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/ignores-species.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/ignores-species.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/toReversed/immutable.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/immutable.js index 929f4fb310..195388b573 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/immutable.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/immutable.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/toReversed/length-property-ignored.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/length-property-ignored.js index 15b32a1d70..49d11c8176 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/length-property-ignored.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/length-property-ignored.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/toReversed/metadata/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/metadata/length.js index 07c690084a..7619516c27 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/metadata/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/metadata/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/toReversed/metadata/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/metadata/name.js index 803d016bf2..2593288cca 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/metadata/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/metadata/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/toReversed/metadata/property-descriptor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/metadata/property-descriptor.js index f3fd60c4f6..e79f58dc33 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/metadata/property-descriptor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/metadata/property-descriptor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/toReversed/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/not-a-constructor.js index 96220d36bd..1d424d39b6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { new TypedArray.prototype.toReversed(); -}, '`new TypedArray.prototype.toReversed()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/this-value-invalid.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/this-value-invalid.js index 119df147a5..5122e2a068 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/this-value-invalid.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toReversed/this-value-invalid.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/toSorted/comparefn-not-a-function.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/comparefn-not-a-function.js index 1ff4bbfe9c..836a621e4a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/comparefn-not-a-function.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/comparefn-not-a-function.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/toSorted/comparefn-stop-after-error.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/comparefn-stop-after-error.js index 61894ca9fe..32a6636ca3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/comparefn-stop-after-error.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/comparefn-stop-after-error.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/toSorted/ignores-species.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/ignores-species.js index bdd4fa92e8..d46211ef26 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/ignores-species.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/ignores-species.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/toSorted/immutable.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/immutable.js index 7fb76e65f5..560ce2f6f1 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/immutable.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/immutable.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/toSorted/length-property-ignored.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/length-property-ignored.js index 977e74b9c5..2bf10fd5a8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/length-property-ignored.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/length-property-ignored.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/toSorted/metadata/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/metadata/length.js index 20e9f3d35b..aa5b3370ee 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/metadata/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/metadata/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/toSorted/metadata/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/metadata/name.js index 644f27593f..b0f701e4c5 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/metadata/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/metadata/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/toSorted/metadata/property-descriptor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/metadata/property-descriptor.js index 54588af0d5..c9b3ce78f2 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/metadata/property-descriptor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/metadata/property-descriptor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/toSorted/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/not-a-constructor.js index be40246fa1..a8ae472d34 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { new TypedArray.prototype.toSorted(); -}, '`new TypedArray.prototype.toSorted()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/this-value-invalid.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/this-value-invalid.js index 47cdf3627a..78e4ef4558 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/this-value-invalid.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toSorted/this-value-invalid.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/toString.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toString.js index 5b19a806fc..162aa90e50 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toString.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toString.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/TypedArray/prototype/toString/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toString/detached-buffer.js index 427bf7fcf6..b63f504117 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toString/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toString/detached-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/TypedArray/prototype/toString/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/toString/not-a-constructor.js index 745ac903df..f7c2008fd0 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/toString/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/toString/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.toString(); -}, '`let u8 = new Uint8Array(1); new u8.toString()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/values/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArray/prototype/values/detached-buffer.js index 732b108995..765b75eb7e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/values/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/values/detached-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/TypedArray/prototype/values/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArray/prototype/values/invoked-as-func.js index 6baf62480c..397d109a75 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/values/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/values/invoked-as-func.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/TypedArray/prototype/values/invoked-as-method.js b/js/src/tests/test262/built-ins/TypedArray/prototype/values/invoked-as-method.js index 9b2e7689f7..29dbcaf63b 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/values/invoked-as-method.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/values/invoked-as-method.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/TypedArray/prototype/values/iter-prototype.js b/js/src/tests/test262/built-ins/TypedArray/prototype/values/iter-prototype.js index 2ebe86343d..93a4e31383 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/values/iter-prototype.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/values/iter-prototype.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/TypedArray/prototype/values/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/values/length.js index 11e022a134..a3a03837b3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/values/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/values/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -23,10 +24,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.values.length, 0); - -verifyNotEnumerable(TypedArray.prototype.values, "length"); -verifyNotWritable(TypedArray.prototype.values, "length"); -verifyConfigurable(TypedArray.prototype.values, "length"); +verifyProperty(TypedArray.prototype.values, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/values/make-in-bounds-after-exhausted.js b/js/src/tests/test262/built-ins/TypedArray/prototype/values/make-in-bounds-after-exhausted.js new file mode 100644 index 0000000000..c567885f18 --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/values/make-in-bounds-after-exhausted.js @@ -0,0 +1,58 @@ +// |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-%typedarray%.prototype.values +description: > + Iterator is still exhausted when typedarray is changed to in-bounds. +features: [TypedArray, resizable-arraybuffer] +---*/ + +let rab = new ArrayBuffer(3, {maxByteLength: 5}); +let ta = new Int8Array(rab); + +// Ensure the TypedArray is correctly initialised. +assert.sameValue(ta.length, 3); +assert.sameValue(ta.byteOffset, 0); + +ta[0] = 11; +ta[1] = 22; +ta[2] = 33; + +let it = ta.values(); +let r; + +// Fetch the first value. +r = it.next(); +assert.sameValue(r.done, false); +assert.sameValue(r.value, 11); + +// Resize buffer to zero. +rab.resize(0); + +// TypedArray is now out-of-bounds. +assert.sameValue(ta.length, 0); +assert.sameValue(ta.byteOffset, 0); + +// Resize buffer to zero. +rab.resize(0); + +// Attempt to fetch the next value. This exhausts the iterator. +r = it.next(); +assert.sameValue(r.done, true); +assert.sameValue(r.value, undefined); + +// Resize buffer so the typed array is again in-bounds. +rab.resize(5); + +// TypedArray is now in-bounds. +assert.sameValue(ta.length, 5); +assert.sameValue(ta.byteOffset, 0); + +// Attempt to fetch another value from an already exhausted iterator. +r = it.next(); +assert.sameValue(r.done, true); +assert.sameValue(r.value, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/values/make-out-of-bounds-after-exhausted.js b/js/src/tests/test262/built-ins/TypedArray/prototype/values/make-out-of-bounds-after-exhausted.js new file mode 100644 index 0000000000..8baa1c0920 --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/values/make-out-of-bounds-after-exhausted.js @@ -0,0 +1,52 @@ +// |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-%typedarray%.prototype.values +description: > + Calling next on an out-of-bounds typedarray throws no error when iterator exhausted. +features: [TypedArray, resizable-arraybuffer] +---*/ + +let rab = new ArrayBuffer(3, {maxByteLength: 5}); +let ta = new Int8Array(rab, 1); + +// Ensure the TypedArray is correctly initialised. +assert.sameValue(ta.length, 2); +assert.sameValue(ta.byteOffset, 1); + +ta[0] = 11; +ta[1] = 22; + +let it = ta.values(); +let r; + +// Fetch the first value. +r = it.next(); +assert.sameValue(r.done, false); +assert.sameValue(r.value, 11); + +// Fetch the second value. +r = it.next(); +assert.sameValue(r.done, false); +assert.sameValue(r.value, 22); + +// Iterator is now exhausted. +r = it.next(); +assert.sameValue(r.done, true); +assert.sameValue(r.value, undefined); + +// Resize buffer to zero. +rab.resize(0); + +// TypedArray is now out-of-bounds. +assert.sameValue(ta.length, 0); +assert.sameValue(ta.byteOffset, 0); + +// Calling next doesn't throw an error. +r = it.next(); +assert.sameValue(r.done, true); +assert.sameValue(r.value, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/values/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/values/name.js index eacaf7f45e..9db35f6120 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/values/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/values/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -20,10 +21,11 @@ includes: [propertyHelper.js, testTypedArray.js] features: [TypedArray] ---*/ -assert.sameValue(TypedArray.prototype.values.name, "values"); - -verifyNotEnumerable(TypedArray.prototype.values, "name"); -verifyNotWritable(TypedArray.prototype.values, "name"); -verifyConfigurable(TypedArray.prototype.values, "name"); +verifyProperty(TypedArray.prototype.values, "name", { + value: "values", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/values/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/values/not-a-constructor.js index 21b26b428f..ba8595192e 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/values/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/values/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -29,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let u8 = new Uint8Array(1); new u8.values(); -}, '`let u8 = new Uint8Array(1); new u8.values()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/values/prop-desc.js b/js/src/tests/test262/built-ins/TypedArray/prototype/values/prop-desc.js index 3317588756..2d54e08a81 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/values/prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/values/prop-desc.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/TypedArray/prototype/values/return-abrupt-from-this-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArray/prototype/values/return-abrupt-from-this-out-of-bounds.js index 1049477287..07dccc377a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/values/return-abrupt-from-this-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/values/return-abrupt-from-this-out-of-bounds.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/TypedArray/prototype/values/return-itor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/values/return-itor.js index 5ebdfa17d5..a75bd6003f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/values/return-itor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/values/return-itor.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/TypedArray/prototype/values/this-is-not-object.js b/js/src/tests/test262/built-ins/TypedArray/prototype/values/this-is-not-object.js index 0169af4e91..bd057bf9e2 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/values/this-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/values/this-is-not-object.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/TypedArray/prototype/values/this-is-not-typedarray-instance.js b/js/src/tests/test262/built-ins/TypedArray/prototype/values/this-is-not-typedarray-instance.js index 7afa67e4a5..57e7ba66b8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/values/this-is-not-typedarray-instance.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/values/this-is-not-typedarray-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/TypedArray/prototype/with/early-type-coercion.js b/js/src/tests/test262/built-ins/TypedArray/prototype/with/early-type-coercion.js index bf38eb2556..c08f33a890 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/with/early-type-coercion.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/with/early-type-coercion.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/with/ignores-species.js b/js/src/tests/test262/built-ins/TypedArray/prototype/with/ignores-species.js index 044707a6f0..46cfb0d9f4 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/with/ignores-species.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/with/ignores-species.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/with/immutable.js b/js/src/tests/test262/built-ins/TypedArray/prototype/with/immutable.js index 0b46dfd28a..61c10de916 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/with/immutable.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/with/immutable.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/with/index-bigger-or-eq-than-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/with/index-bigger-or-eq-than-length.js index c96c2e2005..2e5e069a0f 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/with/index-bigger-or-eq-than-length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/with/index-bigger-or-eq-than-length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/with/index-casted-to-number.js b/js/src/tests/test262/built-ins/TypedArray/prototype/with/index-casted-to-number.js index 19e0a1625d..7d28553524 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/with/index-casted-to-number.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/with/index-casted-to-number.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/with/index-negative.js b/js/src/tests/test262/built-ins/TypedArray/prototype/with/index-negative.js index 640a49736c..a8335d2bd7 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/with/index-negative.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/with/index-negative.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/with/index-smaller-than-minus-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/with/index-smaller-than-minus-length.js index f5481fff1e..2ebb4e5fe6 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/with/index-smaller-than-minus-length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/with/index-smaller-than-minus-length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/with/index-validated-against-current-length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/with/index-validated-against-current-length.js new file mode 100644 index 0000000000..db6c1b534e --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/with/index-validated-against-current-length.js @@ -0,0 +1,61 @@ +// |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-%typedarray%.prototype.with +description: > + The index is validated against the current length. +info: | + %TypedArray%.prototype.with ( index, value ) + + 1. Let O be the this value. + 2. Let taRecord be ? ValidateTypedArray(O, SEQ-CST). + 3. Let len be TypedArrayLength(taRecord). + ... + 8. Else, let numericValue be ? ToNumber(value). + ... + 10. Let A be ? TypedArrayCreateSameType(O, « 𝔽(len) »). + ... + 13. Return A. + +features: [TypedArray, resizable-arraybuffer] +---*/ + +let rab = new ArrayBuffer(2, {maxByteLength: 5}); +let ta = new Int8Array(rab); + +ta[0] = 11; +ta[1] = 22; + +// Ensure typed array is correctly initialised. +assert.sameValue(ta.length, 2); +assert.sameValue(ta[0], 11); +assert.sameValue(ta[1], 22); + +// Index is initially out-of-bounds. +let index = 4; + +let value = { + valueOf() { + rab.resize(5); + return 123; + } +}; + +let result = ta.with(index, value); + +// Typed array has been resized. +assert.sameValue(ta.length, 5); +assert.sameValue(ta[0], 11); +assert.sameValue(ta[1], 22); +assert.sameValue(ta[2], 0); +assert.sameValue(ta[3], 0); +assert.sameValue(ta[4], 0); + +// Result is correctly initialised. +assert.sameValue(result.length, 2); +assert.sameValue(result[0], 11); +assert.sameValue(result[1], 22); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArray/prototype/with/length-property-ignored.js b/js/src/tests/test262/built-ins/TypedArray/prototype/with/length-property-ignored.js index 1a81148015..4d3040bb42 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/with/length-property-ignored.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/with/length-property-ignored.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/with/metadata/length.js b/js/src/tests/test262/built-ins/TypedArray/prototype/with/metadata/length.js index 3fddf24a14..7cbad184b5 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/with/metadata/length.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/with/metadata/length.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/with/metadata/name.js b/js/src/tests/test262/built-ins/TypedArray/prototype/with/metadata/name.js index 095d7161a9..f99f833bf8 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/with/metadata/name.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/with/metadata/name.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/with/metadata/property-descriptor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/with/metadata/property-descriptor.js index 8d8c1368a8..d024db6aa0 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/with/metadata/property-descriptor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/with/metadata/property-descriptor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/with/not-a-constructor.js b/js/src/tests/test262/built-ins/TypedArray/prototype/with/not-a-constructor.js index 09f4c4b144..d498709d0a 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/with/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/with/not-a-constructor.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/prototype/with/this-value-invalid.js b/js/src/tests/test262/built-ins/TypedArray/prototype/with/this-value-invalid.js index 92bb51bb46..bc27053107 100644 --- a/js/src/tests/test262/built-ins/TypedArray/prototype/with/this-value-invalid.js +++ b/js/src/tests/test262/built-ins/TypedArray/prototype/with/this-value-invalid.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Igalia, S.L. 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/TypedArray/shell.js b/js/src/tests/test262/built-ins/TypedArray/shell.js index c32f046213..c888512cb3 100644 --- a/js/src/tests/test262/built-ins/TypedArray/shell.js +++ b/js/src/tests/test262/built-ins/TypedArray/shell.js @@ -53,7 +53,22 @@ var byteConversionValues = { -4294967296, // - ( 2 ** 32 ) Infinity, -Infinity, - 0 + 0, + 2049, // an integer which rounds down under ties-to-even when cast to float16 + 2051, // an integer which rounds up under ties-to-even when cast to float16 + 0.00006103515625, // smallest normal float16 + 0.00006097555160522461, // largest subnormal float16 + 5.960464477539063e-8, // smallest float16 + 2.9802322387695312e-8, // largest double which rounds to 0 when cast to float16 + 2.980232238769532e-8, // smallest double which does not round to 0 when cast to float16 + 8.940696716308594e-8, // a double which rounds up to a subnormal under ties-to-even when cast to float16 + 1.4901161193847656e-7, // a double which rounds down to a subnormal under ties-to-even when cast to float16 + 1.490116119384766e-7, // the next double above the one on the previous line one + 65504, // max finite float16 + 65520, // smallest double which rounds to infinity when cast to float16 + 65519.99999999999, // largest double which does not round to infinity when cast to float16 + 0.000061005353927612305, // smallest double which rounds to a non-subnormal when cast to float16 + 0.0000610053539276123 // largest double which rounds to a subnormal when cast to float16 ], expected: { @@ -98,7 +113,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 1, // 2049 + 3, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + -32, // 65504 + -16, // 65520 + -17, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint8: [ 127, // 127 @@ -141,7 +171,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 1, // 2049 + 3, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 224, // 65504 + 240, // 65520 + 239, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint8Clamped: [ 127, // 127 @@ -184,7 +229,22 @@ var byteConversionValues = { 0, // -4294967296 255, // Infinity 0, // -Infinity - 0 + 0, // 0 + 255, // 2049 + 255, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 255, // 65504 + 255, // 65520 + 255, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Int16: [ 127, // 127 @@ -227,7 +287,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + -32, // 65504 + -16, // 65520 + -17, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint16: [ 127, // 127 @@ -270,7 +345,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Int32: [ 127, // 127 @@ -313,7 +403,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint32: [ 127, // 127 @@ -356,93 +461,138 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Float16: [ - 127, // 127 - 128, // 128 - 32768, // 32767 - 32768, // 32768 - Infinity, // 2147483647 - Infinity, // 2147483648 - 255, // 255 - 256, // 256 - Infinity, // 65535 - Infinity, // 65536 - Infinity, // 4294967295 - Infinity, // 4294967296 - Infinity, // 9007199254740991 - Infinity, // 9007199254740992 - 1.099609375, // 1.1 - 0.0999755859375, // 0.1 - 0.5, // 0.5 - 0.5, // 0.50000001, - 0.60009765625, // 0.6 - 0.7001953125, // 0.7 - NaN, // undefined - -1, // -1 - -0, // -0 - -0.0999755859375, // -0.1 - -1.099609375, // -1.1 - NaN, // NaN - -127, // -127 - -128, // -128 - -32768, // -32767 - -32768, // -32768 - -Infinity, // -2147483647 - -Infinity, // -2147483648 - -255, // -255 - -256, // -256 - -Infinity, // -65535 - -Infinity, // -65536 - -Infinity, // -4294967295 - -Infinity, // -4294967296 - Infinity, // Infinity - -Infinity, // -Infinity - 0 + 127, // 127 + 128, // 128 + 32768, // 32767 + 32768, // 32768 + Infinity, // 2147483647 + Infinity, // 2147483648 + 255, // 255 + 256, // 256 + Infinity, // 65535 + Infinity, // 65536 + Infinity, // 4294967295 + Infinity, // 4294967296 + Infinity, // 9007199254740991 + Infinity, // 9007199254740992 + 1.099609375, // 1.1 + 0.0999755859375, // 0.1 + 0.5, // 0.5 + 0.5, // 0.50000001, + 0.60009765625, // 0.6 + 0.7001953125, // 0.7 + NaN, // undefined + -1, // -1 + -0, // -0 + -0.0999755859375, // -0.1 + -1.099609375, // -1.1 + NaN, // NaN + -127, // -127 + -128, // -128 + -32768, // -32767 + -32768, // -32768 + -Infinity, // -2147483647 + -Infinity, // -2147483648 + -255, // -255 + -256, // -256 + -Infinity, // -65535 + -Infinity, // -65536 + -Infinity, // -4294967295 + -Infinity, // -4294967296 + Infinity, // Infinity + -Infinity, // -Infinity + 0, // 0 + 2048, // 2049 + 2052, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 5.960464477539063e-8, // 2.980232238769532e-8 + 1.1920928955078125e-7, // 8.940696716308594e-8 + 1.1920928955078125e-7, // 1.4901161193847656e-7 + 1.7881393432617188e-7, // 1.490116119384766e-7 + 65504, // 65504 + Infinity, // 65520 + 65504, // 65519.99999999999 + 0.00006103515625, // 0.000061005353927612305 + 0.00006097555160522461 // 0.0000610053539276123 ], Float32: [ - 127, // 127 - 128, // 128 - 32767, // 32767 - 32768, // 32768 - 2147483648, // 2147483647 - 2147483648, // 2147483648 - 255, // 255 - 256, // 256 - 65535, // 65535 - 65536, // 65536 - 4294967296, // 4294967295 - 4294967296, // 4294967296 - 9007199254740992, // 9007199254740991 - 9007199254740992, // 9007199254740992 - 1.100000023841858, // 1.1 - 0.10000000149011612, // 0.1 - 0.5, // 0.5 - 0.5, // 0.50000001, - 0.6000000238418579, // 0.6 - 0.699999988079071, // 0.7 - NaN, // undefined - -1, // -1 - -0, // -0 - -0.10000000149011612, // -0.1 - -1.100000023841858, // -1.1 - NaN, // NaN - -127, // -127 - -128, // -128 - -32767, // -32767 - -32768, // -32768 - -2147483648, // -2147483647 - -2147483648, // -2147483648 - -255, // -255 - -256, // -256 - -65535, // -65535 - -65536, // -65536 - -4294967296, // -4294967295 - -4294967296, // -4294967296 - Infinity, // Infinity - -Infinity, // -Infinity - 0 + 127, // 127 + 128, // 128 + 32767, // 32767 + 32768, // 32768 + 2147483648, // 2147483647 + 2147483648, // 2147483648 + 255, // 255 + 256, // 256 + 65535, // 65535 + 65536, // 65536 + 4294967296, // 4294967295 + 4294967296, // 4294967296 + 9007199254740992, // 9007199254740991 + 9007199254740992, // 9007199254740992 + 1.100000023841858, // 1.1 + 0.10000000149011612, // 0.1 + 0.5, // 0.5 + 0.5, // 0.50000001, + 0.6000000238418579, // 0.6 + 0.699999988079071, // 0.7 + NaN, // undefined + -1, // -1 + -0, // -0 + -0.10000000149011612, // -0.1 + -1.100000023841858, // -1.1 + NaN, // NaN + -127, // -127 + -128, // -128 + -32767, // -32767 + -32768, // -32768 + -2147483648, // -2147483647 + -2147483648, // -2147483648 + -255, // -255 + -256, // -256 + -65535, // -65535 + -65536, // -65536 + -4294967296, // -4294967295 + -4294967296, // -4294967296 + Infinity, // Infinity + -Infinity, // -Infinity + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 2.9802322387695312e-8, // 2.9802322387695312e-8 + 2.9802322387695312e-8, // 2.980232238769532e-8 + 8.940696716308594e-8, // 8.940696716308594e-8 + 1.4901161193847656e-7, // 1.4901161193847656e-7 + 1.4901161193847656e-7, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65520, // 65519.99999999999 + 0.000061005353927612305, // 0.000061005353927612305 + 0.000061005353927612305 // 0.0000610053539276123 ], Float64: [ 127, // 127 @@ -485,7 +635,22 @@ var byteConversionValues = { -4294967296, // -4294967296 Infinity, // Infinity -Infinity, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 2.9802322387695312e-8, // 2.9802322387695312e-8 + 2.980232238769532e-8, // 2.980232238769532e-8 + 8.940696716308594e-8, // 8.940696716308594e-8 + 1.4901161193847656e-7, // 1.4901161193847656e-7 + 1.490116119384766e-7, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519.99999999999, // 65519.99999999999 + 0.000061005353927612305, // 0.000061005353927612305 + 0.0000610053539276123 // 0.0000610053539276123 ] } }; diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/BigInt64Array/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/BigInt64Array/proto.js index 23e5d1da1d..bb97de324e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/BigInt64Array/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/BigInt64Array/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2017 Igalia, S.L. 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/TypedArrayConstructors/BigInt64Array/prototype/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/BigInt64Array/prototype/proto.js index 460aaca932..a71ac041ff 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/BigInt64Array/prototype/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/BigInt64Array/prototype/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2017 Igalia, S.L. 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/TypedArrayConstructors/BigUint64Array/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/BigUint64Array/proto.js index 6af1546744..c33a1ca001 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/BigUint64Array/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/BigUint64Array/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2017 Igalia, S.L. 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/TypedArrayConstructors/BigUint64Array/prototype/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/BigUint64Array/prototype/proto.js index b114d3ae20..1f5db62f59 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/BigUint64Array/prototype/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/BigUint64Array/prototype/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2017 Igalia, S.L. 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/TypedArrayConstructors/Float32Array/name.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Float32Array/name.js index e7e141d975..f0b4aba701 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Float32Array/name.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Float32Array/name.js @@ -21,10 +21,11 @@ includes: [propertyHelper.js] features: [TypedArray] ---*/ -assert.sameValue(Float32Array.name, "Float32Array"); - -verifyNotEnumerable(Float32Array, "name"); -verifyNotWritable(Float32Array, "name"); -verifyConfigurable(Float32Array, "name"); +verifyProperty(Float32Array, "name", { + value: "Float32Array", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/Float32Array/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Float32Array/proto.js index 82f214ed30..b185a9ff4f 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Float32Array/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Float32Array/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/Float32Array/prototype/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Float32Array/prototype/proto.js index 1db64d3074..1be010e387 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Float32Array/prototype/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Float32Array/prototype/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/Float64Array/name.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Float64Array/name.js index e9e559c9ee..64954bfcba 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Float64Array/name.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Float64Array/name.js @@ -21,10 +21,11 @@ includes: [propertyHelper.js] features: [TypedArray] ---*/ -assert.sameValue(Float64Array.name, "Float64Array"); - -verifyNotEnumerable(Float64Array, "name"); -verifyNotWritable(Float64Array, "name"); -verifyConfigurable(Float64Array, "name"); +verifyProperty(Float64Array, "name", { + value: "Float64Array", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/Float64Array/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Float64Array/proto.js index 1f9a6dbdb0..a302c596b7 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Float64Array/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Float64Array/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/Float64Array/prototype/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Float64Array/prototype/proto.js index ec35277dbd..b5a34cc786 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Float64Array/prototype/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Float64Array/prototype/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/Int16Array/name.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int16Array/name.js index 188718a488..d7e0bff6ab 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Int16Array/name.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int16Array/name.js @@ -21,10 +21,11 @@ includes: [propertyHelper.js] features: [TypedArray] ---*/ -assert.sameValue(Int16Array.name, "Int16Array"); - -verifyNotEnumerable(Int16Array, "name"); -verifyNotWritable(Int16Array, "name"); -verifyConfigurable(Int16Array, "name"); +verifyProperty(Int16Array, "name", { + value: "Int16Array", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/Int16Array/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int16Array/proto.js index cd1a83901c..8cf0d45b6a 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Int16Array/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int16Array/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/Int16Array/prototype/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int16Array/prototype/proto.js index 99a478232b..6e7dbe73b1 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Int16Array/prototype/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int16Array/prototype/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/Int32Array/name.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int32Array/name.js index d7e639093b..d7e0e2c51f 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Int32Array/name.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int32Array/name.js @@ -21,10 +21,11 @@ includes: [propertyHelper.js] features: [TypedArray] ---*/ -assert.sameValue(Int32Array.name, "Int32Array"); - -verifyNotEnumerable(Int32Array, "name"); -verifyNotWritable(Int32Array, "name"); -verifyConfigurable(Int32Array, "name"); +verifyProperty(Int32Array, "name", { + value: "Int32Array", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/Int32Array/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int32Array/proto.js index 24f99cf935..cc08cfceec 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Int32Array/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int32Array/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/Int32Array/prototype/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int32Array/prototype/proto.js index cdec27c587..e5a1ade7b1 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Int32Array/prototype/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int32Array/prototype/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/Int8Array/name.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int8Array/name.js index e4a12de7e7..3f0ea41b60 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Int8Array/name.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int8Array/name.js @@ -21,10 +21,11 @@ includes: [propertyHelper.js] features: [TypedArray] ---*/ -assert.sameValue(Int8Array.name, "Int8Array"); - -verifyNotEnumerable(Int8Array, "name"); -verifyNotWritable(Int8Array, "name"); -verifyConfigurable(Int8Array, "name"); +verifyProperty(Int8Array, "name", { + value: "Int8Array", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/Int8Array/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int8Array/proto.js index 615d4f90ad..20272d5a78 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Int8Array/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int8Array/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/Int8Array/prototype/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int8Array/prototype/proto.js index 6886e56cff..726f786a9e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Int8Array/prototype/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Int8Array/prototype/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/Uint16Array/name.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint16Array/name.js index 35e59e9927..2614815c6b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint16Array/name.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint16Array/name.js @@ -21,10 +21,11 @@ includes: [propertyHelper.js] features: [TypedArray] ---*/ -assert.sameValue(Uint16Array.name, "Uint16Array"); - -verifyNotEnumerable(Uint16Array, "name"); -verifyNotWritable(Uint16Array, "name"); -verifyConfigurable(Uint16Array, "name"); +verifyProperty(Uint16Array, "name", { + value: "Uint16Array", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint16Array/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint16Array/proto.js index 1926d6eefe..58e501192e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint16Array/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint16Array/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/Uint16Array/prototype/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint16Array/prototype/proto.js index b28264d2f9..76ce25bdc1 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint16Array/prototype/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint16Array/prototype/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/Uint32Array/name.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint32Array/name.js index 231782fbf9..6cedd9b2ec 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint32Array/name.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint32Array/name.js @@ -21,10 +21,11 @@ includes: [propertyHelper.js] features: [TypedArray] ---*/ -assert.sameValue(Uint32Array.name, "Uint32Array"); - -verifyNotEnumerable(Uint32Array, "name"); -verifyNotWritable(Uint32Array, "name"); -verifyConfigurable(Uint32Array, "name"); +verifyProperty(Uint32Array, "name", { + value: "Uint32Array", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint32Array/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint32Array/proto.js index 23afd396b5..ac377e7086 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint32Array/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint32Array/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/Uint32Array/prototype/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint32Array/prototype/proto.js index db175cdf0f..b41b44fde5 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint32Array/prototype/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint32Array/prototype/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/Uint8Array/name.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8Array/name.js index c3b17bdc55..7a40029267 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8Array/name.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8Array/name.js @@ -21,10 +21,11 @@ includes: [propertyHelper.js] features: [TypedArray] ---*/ -assert.sameValue(Uint8Array.name, "Uint8Array"); - -verifyNotEnumerable(Uint8Array, "name"); -verifyNotWritable(Uint8Array, "name"); -verifyConfigurable(Uint8Array, "name"); +verifyProperty(Uint8Array, "name", { + value: "Uint8Array", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8Array/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8Array/proto.js index 4549c9c5c4..2fa2b3f5f3 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8Array/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8Array/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/Uint8Array/prototype/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8Array/prototype/proto.js index 780a41c80d..8e48ff4a01 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8Array/prototype/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8Array/prototype/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/Uint8ClampedArray/name.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8ClampedArray/name.js index 263014c653..0b1f205c7f 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8ClampedArray/name.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8ClampedArray/name.js @@ -21,10 +21,11 @@ includes: [propertyHelper.js] features: [TypedArray] ---*/ -assert.sameValue(Uint8ClampedArray.name, "Uint8ClampedArray"); - -verifyNotEnumerable(Uint8ClampedArray, "name"); -verifyNotWritable(Uint8ClampedArray, "name"); -verifyConfigurable(Uint8ClampedArray, "name"); +verifyProperty(Uint8ClampedArray, "name", { + value: "Uint8ClampedArray", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8ClampedArray/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8ClampedArray/proto.js index 42cf2b2121..fb48296cd9 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8ClampedArray/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8ClampedArray/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/Uint8ClampedArray/prototype/proto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8ClampedArray/prototype/proto.js index 59620ea596..f5e2492076 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8ClampedArray/prototype/proto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/Uint8ClampedArray/prototype/proto.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/ctors-bigint/typedarray-arg/src-typedarray-not-big-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/src-typedarray-not-big-throws.js index 385307c130..dcd8377ccb 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/src-typedarray-not-big-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors-bigint/typedarray-arg/src-typedarray-not-big-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Valerie Young. 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/TypedArrayConstructors/ctors/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size-sab.js index 6cd11a7883..09b261fbc4 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size.js index 0b1f59d0b1..0b66e1a912 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size.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/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-negative-throws-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-negative-throws-sab.js index 70d62315c1..7054786da3 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-negative-throws-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-negative-throws-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-negative-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-negative-throws.js index 996976385e..5c93556f2f 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-negative-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-negative-throws.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/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-negative-zero-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-negative-zero-sab.js index ecb8b39000..80b41bd1c2 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-negative-zero-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-negative-zero-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-negative-zero.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-negative-zero.js index cd8b786ccc..d38df17c8b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-negative-zero.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-negative-zero.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2015 André Bargull. 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/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-symbol-throws-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-symbol-throws-sab.js index b7a509cb98..25db8b4745 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-symbol-throws-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-symbol-throws-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-symbol-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-symbol-throws.js index 9423fc4d6c..9aaea65abe 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-symbol-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-is-symbol-throws.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/TypedArrayConstructors/ctors/buffer-arg/byteoffset-throws-from-modulo-element-size-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-throws-from-modulo-element-size-sab.js index 148be420dd..78dfd2e06f 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-throws-from-modulo-element-size-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-throws-from-modulo-element-size-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/byteoffset-throws-from-modulo-element-size.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-throws-from-modulo-element-size.js index bd3005f74a..6fd2303d25 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-throws-from-modulo-element-size.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-throws-from-modulo-element-size.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/TypedArrayConstructors/ctors/buffer-arg/byteoffset-to-number-detachbuffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-to-number-detachbuffer.js index 627c8778ad..6c581a55d7 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-to-number-detachbuffer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-to-number-detachbuffer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2017 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/TypedArrayConstructors/ctors/buffer-arg/byteoffset-to-number-throws-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-to-number-throws-sab.js index 5b3ec7591d..2a1a9e41f3 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-to-number-throws-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-to-number-throws-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/byteoffset-to-number-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-to-number-throws.js index 47ff7ea095..2414b5cdd1 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-to-number-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/byteoffset-to-number-throws.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/TypedArrayConstructors/ctors/buffer-arg/custom-proto-access-throws-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/custom-proto-access-throws-sab.js index bccf102235..9976158eb7 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/custom-proto-access-throws-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/custom-proto-access-throws-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/custom-proto-access-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/custom-proto-access-throws.js index 3f43b72932..0c55f1b7d6 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/custom-proto-access-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/custom-proto-access-throws.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/TypedArrayConstructors/ctors/buffer-arg/defined-length-and-offset-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-length-and-offset-sab.js index 56ecd2f44a..082d63a8a4 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-length-and-offset-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-length-and-offset-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/defined-length-and-offset.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-length-and-offset.js index 80e815cf61..6c795df976 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-length-and-offset.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-length-and-offset.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/TypedArrayConstructors/ctors/buffer-arg/defined-length-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-length-sab.js index a729a9a231..259d3d9320 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-length-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-length-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/defined-length.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-length.js index 52abb61850..9845a827ce 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-length.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-length.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/TypedArrayConstructors/ctors/buffer-arg/defined-negative-length-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-negative-length-sab.js index 3e7a33df8a..98cd8597bc 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-negative-length-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-negative-length-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/defined-negative-length.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-negative-length.js index f795adabeb..2c00b69737 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-negative-length.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-negative-length.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/TypedArrayConstructors/ctors/buffer-arg/defined-offset-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-offset-sab.js index 3ad0730ddb..4d5879643f 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-offset-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-offset-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/defined-offset.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-offset.js index 1c416c4a45..fa73963e38 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-offset.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/defined-offset.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/TypedArrayConstructors/ctors/buffer-arg/detachedbuffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/detachedbuffer.js index 15f2abe5e3..33f45327c3 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/detachedbuffer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/detachedbuffer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2017 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/TypedArrayConstructors/ctors/buffer-arg/excessive-length-throws-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/excessive-length-throws-sab.js index ee0b54e943..71d193af6c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/excessive-length-throws-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/excessive-length-throws-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/excessive-length-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/excessive-length-throws.js index ab5836e944..63801af8b7 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/excessive-length-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/excessive-length-throws.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/TypedArrayConstructors/ctors/buffer-arg/excessive-offset-throws-resizable-ab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/excessive-offset-throws-resizable-ab.js index 0095a54485..45dd413421 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/excessive-offset-throws-resizable-ab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/excessive-offset-throws-resizable-ab.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/TypedArrayConstructors/ctors/buffer-arg/excessive-offset-throws-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/excessive-offset-throws-sab.js index bba14855bf..28c58e063e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/excessive-offset-throws-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/excessive-offset-throws-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/excessive-offset-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/excessive-offset-throws.js index 17d39e4ea5..f66d7a400e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/excessive-offset-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/excessive-offset-throws.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/TypedArrayConstructors/ctors/buffer-arg/invoked-with-undefined-newtarget-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/invoked-with-undefined-newtarget-sab.js index d08a6e8f7f..8916c2ac5e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/invoked-with-undefined-newtarget-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/invoked-with-undefined-newtarget-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/invoked-with-undefined-newtarget.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/invoked-with-undefined-newtarget.js index 7b8abeb3aa..6a897453d3 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/invoked-with-undefined-newtarget.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/invoked-with-undefined-newtarget.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/TypedArrayConstructors/ctors/buffer-arg/is-referenced-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/is-referenced-sab.js index a7c268a073..637f0a751e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/is-referenced-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/is-referenced-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/is-referenced.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/is-referenced.js index 9a7ad5ac4e..40d91ef9a6 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/is-referenced.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/is-referenced.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/TypedArrayConstructors/ctors/buffer-arg/length-access-throws-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/length-access-throws-sab.js index e22085c72a..979c422f45 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/length-access-throws-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/length-access-throws-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/length-access-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/length-access-throws.js index c05d709abc..a20dbfd51d 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/length-access-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/length-access-throws.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/TypedArrayConstructors/ctors/buffer-arg/length-is-symbol-throws-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/length-is-symbol-throws-sab.js index 61cc16a0cb..8f62bbece4 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/length-is-symbol-throws-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/length-is-symbol-throws-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/length-is-symbol-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/length-is-symbol-throws.js index f04940f4ee..6bf3208e91 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/length-is-symbol-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/length-is-symbol-throws.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/TypedArrayConstructors/ctors/buffer-arg/length-to-number-detachbuffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/length-to-number-detachbuffer.js index 47ff17be0e..d9d01af299 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/length-to-number-detachbuffer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/length-to-number-detachbuffer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2017 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/TypedArrayConstructors/ctors/buffer-arg/new-instance-extensibility-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/new-instance-extensibility-sab.js index be15fb3873..3fee45674a 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/new-instance-extensibility-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/new-instance-extensibility-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/new-instance-extensibility.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/new-instance-extensibility.js index 14be0cdec5..3bf4b39094 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/new-instance-extensibility.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/new-instance-extensibility.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/TypedArrayConstructors/ctors/buffer-arg/proto-from-ctor-realm-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/proto-from-ctor-realm-sab.js index 1da9bed6a2..228d90d808 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/proto-from-ctor-realm-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/proto-from-ctor-realm-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/proto-from-ctor-realm.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/proto-from-ctor-realm.js index 300629cadc..a0a8b5b575 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/proto-from-ctor-realm.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/proto-from-ctor-realm.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/TypedArrayConstructors/ctors/buffer-arg/returns-new-instance-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/returns-new-instance-sab.js index 17ea189089..feb96f9cd8 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/returns-new-instance-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/returns-new-instance-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/returns-new-instance.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/returns-new-instance.js index 46bb08e0ec..4e0e9542d8 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/returns-new-instance.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/returns-new-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/TypedArrayConstructors/ctors/buffer-arg/toindex-bytelength-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/toindex-bytelength-sab.js index f95a6366a1..c1d20fe6be 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/toindex-bytelength-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/toindex-bytelength-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/toindex-bytelength.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/toindex-bytelength.js index 062330df84..3f7ee16dcd 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/toindex-bytelength.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/toindex-bytelength.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/TypedArrayConstructors/ctors/buffer-arg/toindex-byteoffset-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/toindex-byteoffset-sab.js index 8ba2f41b9c..18bac82b01 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/toindex-byteoffset-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/toindex-byteoffset-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/toindex-byteoffset.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/toindex-byteoffset.js index 66a3629446..b8aa9340c2 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/toindex-byteoffset.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/toindex-byteoffset.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/TypedArrayConstructors/ctors/buffer-arg/typedarray-backed-by-sharedarraybuffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/typedarray-backed-by-sharedarraybuffer.js index 2ba3df217a..8fe01c563b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/typedarray-backed-by-sharedarraybuffer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/typedarray-backed-by-sharedarraybuffer.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/use-custom-proto-if-object-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/use-custom-proto-if-object-sab.js index 1b67197f02..bf6947d70c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/use-custom-proto-if-object-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/use-custom-proto-if-object-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/use-custom-proto-if-object.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/use-custom-proto-if-object.js index aad34833ca..3b0977c01c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/use-custom-proto-if-object.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/use-custom-proto-if-object.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/TypedArrayConstructors/ctors/buffer-arg/use-default-proto-if-custom-proto-is-not-object-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/use-default-proto-if-custom-proto-is-not-object-sab.js index 21086e7a26..1099370d8e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/use-default-proto-if-custom-proto-is-not-object-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/use-default-proto-if-custom-proto-is-not-object-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/ctors/buffer-arg/use-default-proto-if-custom-proto-is-not-object.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/use-default-proto-if-custom-proto-is-not-object.js index dfef9bdf32..8e35ba0b33 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/use-default-proto-if-custom-proto-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/buffer-arg/use-default-proto-if-custom-proto-is-not-object.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/TypedArrayConstructors/ctors/length-arg/custom-proto-access-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/custom-proto-access-throws.js index d8808efd52..2742751a62 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/custom-proto-access-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/custom-proto-access-throws.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/TypedArrayConstructors/ctors/length-arg/init-zeros.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/init-zeros.js index 60f2e09349..d99515e9ad 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/init-zeros.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/init-zeros.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/TypedArrayConstructors/ctors/length-arg/is-infinity-throws-rangeerror.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/is-infinity-throws-rangeerror.js index e2eee55c64..02d9bf50d9 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/is-infinity-throws-rangeerror.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/is-infinity-throws-rangeerror.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/TypedArrayConstructors/ctors/length-arg/is-negative-integer-throws-rangeerror.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/is-negative-integer-throws-rangeerror.js index b633202456..bdaec2dada 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/is-negative-integer-throws-rangeerror.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/is-negative-integer-throws-rangeerror.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/TypedArrayConstructors/ctors/length-arg/is-symbol-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/is-symbol-throws.js index a383eb453c..72f961ba9d 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/is-symbol-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/is-symbol-throws.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/TypedArrayConstructors/ctors/length-arg/new-instance-extensibility.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/new-instance-extensibility.js index 28a76944ff..86616927c7 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/new-instance-extensibility.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/new-instance-extensibility.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/TypedArrayConstructors/ctors/length-arg/proto-from-ctor-realm.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/proto-from-ctor-realm.js index 02f39b12e5..da803e4c53 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/proto-from-ctor-realm.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/proto-from-ctor-realm.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/TypedArrayConstructors/ctors/length-arg/returns-object.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/returns-object.js index 25f90a4a1d..63313cb769 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/returns-object.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/returns-object.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/TypedArrayConstructors/ctors/length-arg/toindex-length.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/toindex-length.js index d84897dfa8..78469b68f1 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/toindex-length.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/toindex-length.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/TypedArrayConstructors/ctors/length-arg/undefined-newtarget-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/undefined-newtarget-throws.js index 8c43e87b2d..d9cd7cdb15 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/undefined-newtarget-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/undefined-newtarget-throws.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/TypedArrayConstructors/ctors/length-arg/use-custom-proto-if-object.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/use-custom-proto-if-object.js index 59f7b7f0f0..affc9cb34e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/use-custom-proto-if-object.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/use-custom-proto-if-object.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/TypedArrayConstructors/ctors/length-arg/use-default-proto-if-custom-proto-is-not-object.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/use-default-proto-if-custom-proto-is-not-object.js index 6617e5c899..0e14a91595 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/use-default-proto-if-custom-proto-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/length-arg/use-default-proto-if-custom-proto-is-not-object.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/TypedArrayConstructors/ctors/no-args/custom-proto-access-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/custom-proto-access-throws.js index 5c3a24bd54..10f576962c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/custom-proto-access-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/custom-proto-access-throws.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/TypedArrayConstructors/ctors/no-args/new-instance-extensibility.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/new-instance-extensibility.js index e72a6b7e38..555eb2d95b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/new-instance-extensibility.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/new-instance-extensibility.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/TypedArrayConstructors/ctors/no-args/proto-from-ctor-realm.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/proto-from-ctor-realm.js index 533d41736f..f5ff2b376a 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/proto-from-ctor-realm.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/proto-from-ctor-realm.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/TypedArrayConstructors/ctors/no-args/returns-object.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/returns-object.js index 2538dbc5f8..3bc999eb6c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/returns-object.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/returns-object.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/TypedArrayConstructors/ctors/no-args/undefined-newtarget-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/undefined-newtarget-throws.js index f238450d16..95384239c9 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/undefined-newtarget-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/undefined-newtarget-throws.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/TypedArrayConstructors/ctors/no-args/use-custom-proto-if-object.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/use-custom-proto-if-object.js index 420e56e088..1a6627f2fa 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/use-custom-proto-if-object.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/use-custom-proto-if-object.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/TypedArrayConstructors/ctors/no-args/use-default-proto-if-custom-proto-is-not-object.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/use-default-proto-if-custom-proto-is-not-object.js index ca9f018f0d..f13ec9f692 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/use-default-proto-if-custom-proto-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/no-args/use-default-proto-if-custom-proto-is-not-object.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/TypedArrayConstructors/ctors/object-arg/as-array-returns.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/as-array-returns.js index abbc8b5979..11303c95be 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/as-array-returns.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/as-array-returns.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/TypedArrayConstructors/ctors/object-arg/as-generator-iterable-returns.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/as-generator-iterable-returns.js index a86d9ef1a5..5d6a865645 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/as-generator-iterable-returns.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/as-generator-iterable-returns.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/TypedArrayConstructors/ctors/object-arg/conversion-operation-consistent-nan.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/conversion-operation-consistent-nan.js index f71f68003f..f3103232ca 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/conversion-operation-consistent-nan.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/conversion-operation-consistent-nan.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/TypedArrayConstructors/ctors/object-arg/conversion-operation.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/conversion-operation.js index b8c41f1de1..168036bf59 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/conversion-operation.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/conversion-operation.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/TypedArrayConstructors/ctors/object-arg/custom-proto-access-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/custom-proto-access-throws.js index c34af4e31b..71b04f1f03 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/custom-proto-access-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/custom-proto-access-throws.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/TypedArrayConstructors/ctors/object-arg/iterated-array-changed-by-tonumber.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterated-array-changed-by-tonumber.js new file mode 100644 index 0000000000..6251655196 --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterated-array-changed-by-tonumber.js @@ -0,0 +1,46 @@ +// |reftest| shell-option(--enable-float16array) +// Copyright (C) 2024 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-typedarray +description: > + Modifications to input array after iteration are handled correctly. +info: | + TypedArray ( ...args ) + + ... + 6. Else, + ... + b. If firstArgument is an Object, then + ... + iv. Else, + ... + 2. Let usingIterator be ? GetMethod(firstArgument, @@iterator). + 3. If usingIterator is not undefined, then + a. Let values be ? IteratorToList(? GetIteratorFromMethod(firstArgument, usingIterator)). + b. Perform ? InitializeTypedArrayFromList(O, values). + ... +includes: [testTypedArray.js] +features: [TypedArray] +---*/ + +testWithTypedArrayConstructors(function(TypedArray) { + let values = [0, { + valueOf() { + // Removes all array elements. Caller must have saved all elements. + values.length = 0; + return 100; + } + }, 2]; + + // Constructor called with array which uses the built-in array iterator. + var ta = new TypedArray(values); + + assert.sameValue(ta.length, 3); + assert.sameValue(ta[0], 0); + assert.sameValue(ta[1], 100); + assert.sameValue(ta[2], 2); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterated-array-with-modified-array-iterator.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterated-array-with-modified-array-iterator.js new file mode 100644 index 0000000000..fe1f672adb --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterated-array-with-modified-array-iterator.js @@ -0,0 +1,52 @@ +// |reftest| shell-option(--enable-float16array) +// Copyright (C) 2024 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-typedarray +description: > + Modifications to input array after iteration are handled correctly. +info: | + TypedArray ( ...args ) + + ... + 6. Else, + ... + b. If firstArgument is an Object, then + ... + iv. Else, + ... + 2. Let usingIterator be ? GetMethod(firstArgument, @@iterator). + 3. If usingIterator is not undefined, then + a. Let values be ? IteratorToList(? GetIteratorFromMethod(firstArgument, usingIterator)). + b. Perform ? InitializeTypedArrayFromList(O, values). + ... +includes: [testTypedArray.js] +features: [TypedArray] +---*/ + +let ArrayIteratorPrototype = Object.getPrototypeOf([].values()); +let values; + +// Modify the built-in ArrayIteratorPrototype `next` method. +ArrayIteratorPrototype.next = function() { + let done = values.length === 0; + let value = values.pop(); + return {value, done}; +}; + +testWithTypedArrayConstructors(function(TypedArray) { + // Reset `values` array. + values = [1, 2, 3, 4]; + + // Constructor called with array which uses the modified array iterator. + var ta = new TypedArray([0]); + + assert.sameValue(ta.length, 4); + assert.sameValue(ta[0], 4); + assert.sameValue(ta[1], 3); + assert.sameValue(ta[2], 2); + assert.sameValue(ta[3], 1); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterating-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterating-throws.js index 7867b4a3a1..4327297746 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterating-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterating-throws.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/TypedArrayConstructors/ctors/object-arg/iterator-is-null-as-array-like.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterator-is-null-as-array-like.js index de906f06b4..b1854e4dbe 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterator-is-null-as-array-like.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterator-is-null-as-array-like.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Alexey Shvayka. 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/TypedArrayConstructors/ctors/object-arg/iterator-not-callable-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterator-not-callable-throws.js index 500437a3ed..d3d9f7c608 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterator-not-callable-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterator-not-callable-throws.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/TypedArrayConstructors/ctors/object-arg/iterator-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterator-throws.js index 9b9c57a11b..4dcb325608 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterator-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/iterator-throws.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/TypedArrayConstructors/ctors/object-arg/length-excessive-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/length-excessive-throws.js index 1d681cfe61..5a18692653 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/length-excessive-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/length-excessive-throws.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/TypedArrayConstructors/ctors/object-arg/length-is-symbol-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/length-is-symbol-throws.js index 1e2f7e23c9..667cbd3184 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/length-is-symbol-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/length-is-symbol-throws.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/TypedArrayConstructors/ctors/object-arg/length-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/length-throws.js index 8dccea8901..c9bb5b8de6 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/length-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/length-throws.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/TypedArrayConstructors/ctors/object-arg/new-instance-extensibility.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/new-instance-extensibility.js index 25345c0979..8508b38961 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/new-instance-extensibility.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/new-instance-extensibility.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/TypedArrayConstructors/ctors/object-arg/proto-from-ctor-realm.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/proto-from-ctor-realm.js index 213fbfbdd8..8c7a15f89b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/proto-from-ctor-realm.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/proto-from-ctor-realm.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/TypedArrayConstructors/ctors/object-arg/returns.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/returns.js index 7b795eed85..cd210c0166 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/returns.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/returns.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/TypedArrayConstructors/ctors/object-arg/shell.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/shell.js index 4d14a8634d..665ef0a961 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/shell.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/shell.js @@ -53,7 +53,22 @@ var byteConversionValues = { -4294967296, // - ( 2 ** 32 ) Infinity, -Infinity, - 0 + 0, + 2049, // an integer which rounds down under ties-to-even when cast to float16 + 2051, // an integer which rounds up under ties-to-even when cast to float16 + 0.00006103515625, // smallest normal float16 + 0.00006097555160522461, // largest subnormal float16 + 5.960464477539063e-8, // smallest float16 + 2.9802322387695312e-8, // largest double which rounds to 0 when cast to float16 + 2.980232238769532e-8, // smallest double which does not round to 0 when cast to float16 + 8.940696716308594e-8, // a double which rounds up to a subnormal under ties-to-even when cast to float16 + 1.4901161193847656e-7, // a double which rounds down to a subnormal under ties-to-even when cast to float16 + 1.490116119384766e-7, // the next double above the one on the previous line one + 65504, // max finite float16 + 65520, // smallest double which rounds to infinity when cast to float16 + 65519.99999999999, // largest double which does not round to infinity when cast to float16 + 0.000061005353927612305, // smallest double which rounds to a non-subnormal when cast to float16 + 0.0000610053539276123 // largest double which rounds to a subnormal when cast to float16 ], expected: { @@ -98,7 +113,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 1, // 2049 + 3, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + -32, // 65504 + -16, // 65520 + -17, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint8: [ 127, // 127 @@ -141,7 +171,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 1, // 2049 + 3, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 224, // 65504 + 240, // 65520 + 239, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint8Clamped: [ 127, // 127 @@ -184,7 +229,22 @@ var byteConversionValues = { 0, // -4294967296 255, // Infinity 0, // -Infinity - 0 + 0, // 0 + 255, // 2049 + 255, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 255, // 65504 + 255, // 65520 + 255, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Int16: [ 127, // 127 @@ -227,7 +287,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + -32, // 65504 + -16, // 65520 + -17, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint16: [ 127, // 127 @@ -270,7 +345,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Int32: [ 127, // 127 @@ -313,7 +403,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint32: [ 127, // 127 @@ -356,93 +461,138 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Float16: [ - 127, // 127 - 128, // 128 - 32768, // 32767 - 32768, // 32768 - Infinity, // 2147483647 - Infinity, // 2147483648 - 255, // 255 - 256, // 256 - Infinity, // 65535 - Infinity, // 65536 - Infinity, // 4294967295 - Infinity, // 4294967296 - Infinity, // 9007199254740991 - Infinity, // 9007199254740992 - 1.099609375, // 1.1 - 0.0999755859375, // 0.1 - 0.5, // 0.5 - 0.5, // 0.50000001, - 0.60009765625, // 0.6 - 0.7001953125, // 0.7 - NaN, // undefined - -1, // -1 - -0, // -0 - -0.0999755859375, // -0.1 - -1.099609375, // -1.1 - NaN, // NaN - -127, // -127 - -128, // -128 - -32768, // -32767 - -32768, // -32768 - -Infinity, // -2147483647 - -Infinity, // -2147483648 - -255, // -255 - -256, // -256 - -Infinity, // -65535 - -Infinity, // -65536 - -Infinity, // -4294967295 - -Infinity, // -4294967296 - Infinity, // Infinity - -Infinity, // -Infinity - 0 + 127, // 127 + 128, // 128 + 32768, // 32767 + 32768, // 32768 + Infinity, // 2147483647 + Infinity, // 2147483648 + 255, // 255 + 256, // 256 + Infinity, // 65535 + Infinity, // 65536 + Infinity, // 4294967295 + Infinity, // 4294967296 + Infinity, // 9007199254740991 + Infinity, // 9007199254740992 + 1.099609375, // 1.1 + 0.0999755859375, // 0.1 + 0.5, // 0.5 + 0.5, // 0.50000001, + 0.60009765625, // 0.6 + 0.7001953125, // 0.7 + NaN, // undefined + -1, // -1 + -0, // -0 + -0.0999755859375, // -0.1 + -1.099609375, // -1.1 + NaN, // NaN + -127, // -127 + -128, // -128 + -32768, // -32767 + -32768, // -32768 + -Infinity, // -2147483647 + -Infinity, // -2147483648 + -255, // -255 + -256, // -256 + -Infinity, // -65535 + -Infinity, // -65536 + -Infinity, // -4294967295 + -Infinity, // -4294967296 + Infinity, // Infinity + -Infinity, // -Infinity + 0, // 0 + 2048, // 2049 + 2052, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 5.960464477539063e-8, // 2.980232238769532e-8 + 1.1920928955078125e-7, // 8.940696716308594e-8 + 1.1920928955078125e-7, // 1.4901161193847656e-7 + 1.7881393432617188e-7, // 1.490116119384766e-7 + 65504, // 65504 + Infinity, // 65520 + 65504, // 65519.99999999999 + 0.00006103515625, // 0.000061005353927612305 + 0.00006097555160522461 // 0.0000610053539276123 ], Float32: [ - 127, // 127 - 128, // 128 - 32767, // 32767 - 32768, // 32768 - 2147483648, // 2147483647 - 2147483648, // 2147483648 - 255, // 255 - 256, // 256 - 65535, // 65535 - 65536, // 65536 - 4294967296, // 4294967295 - 4294967296, // 4294967296 - 9007199254740992, // 9007199254740991 - 9007199254740992, // 9007199254740992 - 1.100000023841858, // 1.1 - 0.10000000149011612, // 0.1 - 0.5, // 0.5 - 0.5, // 0.50000001, - 0.6000000238418579, // 0.6 - 0.699999988079071, // 0.7 - NaN, // undefined - -1, // -1 - -0, // -0 - -0.10000000149011612, // -0.1 - -1.100000023841858, // -1.1 - NaN, // NaN - -127, // -127 - -128, // -128 - -32767, // -32767 - -32768, // -32768 - -2147483648, // -2147483647 - -2147483648, // -2147483648 - -255, // -255 - -256, // -256 - -65535, // -65535 - -65536, // -65536 - -4294967296, // -4294967295 - -4294967296, // -4294967296 - Infinity, // Infinity - -Infinity, // -Infinity - 0 + 127, // 127 + 128, // 128 + 32767, // 32767 + 32768, // 32768 + 2147483648, // 2147483647 + 2147483648, // 2147483648 + 255, // 255 + 256, // 256 + 65535, // 65535 + 65536, // 65536 + 4294967296, // 4294967295 + 4294967296, // 4294967296 + 9007199254740992, // 9007199254740991 + 9007199254740992, // 9007199254740992 + 1.100000023841858, // 1.1 + 0.10000000149011612, // 0.1 + 0.5, // 0.5 + 0.5, // 0.50000001, + 0.6000000238418579, // 0.6 + 0.699999988079071, // 0.7 + NaN, // undefined + -1, // -1 + -0, // -0 + -0.10000000149011612, // -0.1 + -1.100000023841858, // -1.1 + NaN, // NaN + -127, // -127 + -128, // -128 + -32767, // -32767 + -32768, // -32768 + -2147483648, // -2147483647 + -2147483648, // -2147483648 + -255, // -255 + -256, // -256 + -65535, // -65535 + -65536, // -65536 + -4294967296, // -4294967295 + -4294967296, // -4294967296 + Infinity, // Infinity + -Infinity, // -Infinity + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 2.9802322387695312e-8, // 2.9802322387695312e-8 + 2.9802322387695312e-8, // 2.980232238769532e-8 + 8.940696716308594e-8, // 8.940696716308594e-8 + 1.4901161193847656e-7, // 1.4901161193847656e-7 + 1.4901161193847656e-7, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65520, // 65519.99999999999 + 0.000061005353927612305, // 0.000061005353927612305 + 0.000061005353927612305 // 0.0000610053539276123 ], Float64: [ 127, // 127 @@ -485,7 +635,22 @@ var byteConversionValues = { -4294967296, // -4294967296 Infinity, // Infinity -Infinity, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 2.9802322387695312e-8, // 2.9802322387695312e-8 + 2.980232238769532e-8, // 2.980232238769532e-8 + 8.940696716308594e-8, // 8.940696716308594e-8 + 1.4901161193847656e-7, // 1.4901161193847656e-7 + 1.490116119384766e-7, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519.99999999999, // 65519.99999999999 + 0.000061005353927612305, // 0.000061005353927612305 + 0.0000610053539276123 // 0.0000610053539276123 ] } }; diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-from-property.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-from-property.js index 574b628f9e..364db4a15b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-from-property.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-from-property.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/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-to-primitive-typeerror.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-to-primitive-typeerror.js index 1e0cba0b5a..ea5d804b38 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-to-primitive-typeerror.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-to-primitive-typeerror.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/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-to-primitive.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-to-primitive.js index b70a039911..79e87b69e1 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-to-primitive.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-to-primitive.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/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-tostring.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-tostring.js index 9940e1e608..4b2bbe8b8e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-tostring.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-tostring.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/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-valueof-typeerror.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-valueof-typeerror.js index 746e244537..118bed7af1 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-valueof-typeerror.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-valueof-typeerror.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/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-valueof.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-valueof.js index 7bb03318c0..96acc357f5 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-valueof.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-obj-valueof.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/TypedArrayConstructors/ctors/object-arg/throws-setting-property.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-property.js index 0e5f93d30a..ff5a754804 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-property.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-property.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/TypedArrayConstructors/ctors/object-arg/throws-setting-symbol-property.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-symbol-property.js index f30ef12f5c..3a7d48165c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-symbol-property.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/throws-setting-symbol-property.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/TypedArrayConstructors/ctors/object-arg/undefined-newtarget-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/undefined-newtarget-throws.js index b5b6b00fa1..a93f077fd1 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/undefined-newtarget-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/undefined-newtarget-throws.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/TypedArrayConstructors/ctors/object-arg/use-custom-proto-if-object.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/use-custom-proto-if-object.js index 996f9d659a..8d766e8b21 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/use-custom-proto-if-object.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/use-custom-proto-if-object.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/TypedArrayConstructors/ctors/object-arg/use-default-proto-if-custom-proto-is-not-object.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/use-default-proto-if-custom-proto-is-not-object.js index 7ae957d8a1..8a0afbb04e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/use-default-proto-if-custom-proto-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/object-arg/use-default-proto-if-custom-proto-is-not-object.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/TypedArrayConstructors/ctors/typedarray-arg/custom-proto-access-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/custom-proto-access-throws.js index 9668bd269b..a2c8c95545 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/custom-proto-access-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/custom-proto-access-throws.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/TypedArrayConstructors/ctors/typedarray-arg/new-instance-extensibility.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/new-instance-extensibility.js index 59d5efba90..789160306e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/new-instance-extensibility.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/new-instance-extensibility.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/TypedArrayConstructors/ctors/typedarray-arg/other-ctor-returns-new-typedarray.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/other-ctor-returns-new-typedarray.js index 8f6d0f51fe..916b476121 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/other-ctor-returns-new-typedarray.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/other-ctor-returns-new-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/TypedArrayConstructors/ctors/typedarray-arg/proto-from-ctor-realm.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/proto-from-ctor-realm.js index d7aae2b83f..ec99dc3bc4 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/proto-from-ctor-realm.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/proto-from-ctor-realm.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/TypedArrayConstructors/ctors/typedarray-arg/returns-new-instance.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/returns-new-instance.js index b59e86f5a2..286eb9e91c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/returns-new-instance.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/returns-new-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/TypedArrayConstructors/ctors/typedarray-arg/same-ctor-buffer-ctor-species-null.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/same-ctor-buffer-ctor-species-null.js index 2dc3b4bd0a..b20e77b00c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/same-ctor-buffer-ctor-species-null.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/same-ctor-buffer-ctor-species-null.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/TypedArrayConstructors/ctors/typedarray-arg/same-ctor-buffer-ctor-species-undefined.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/same-ctor-buffer-ctor-species-undefined.js index 53904f8aa1..48a27ae56b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/same-ctor-buffer-ctor-species-undefined.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/same-ctor-buffer-ctor-species-undefined.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/TypedArrayConstructors/ctors/typedarray-arg/same-ctor-returns-new-cloned-typedarray.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/same-ctor-returns-new-cloned-typedarray.js index 95d273cff2..f69be105c1 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/same-ctor-returns-new-cloned-typedarray.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/same-ctor-returns-new-cloned-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/TypedArrayConstructors/ctors/typedarray-arg/src-typedarray-big-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/src-typedarray-big-throws.js index d7aaead773..76a38e1cb7 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/src-typedarray-big-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/src-typedarray-big-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Valerie Young. 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/TypedArrayConstructors/ctors/typedarray-arg/undefined-newtarget-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/undefined-newtarget-throws.js index 4ea662775e..821fc3d229 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/undefined-newtarget-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/undefined-newtarget-throws.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/TypedArrayConstructors/ctors/typedarray-arg/use-custom-proto-if-object.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/use-custom-proto-if-object.js index c52ac6df1a..0d08f50b3a 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/use-custom-proto-if-object.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/use-custom-proto-if-object.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/TypedArrayConstructors/ctors/typedarray-arg/use-default-proto-if-custom-proto-is-not-object.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/use-default-proto-if-custom-proto-is-not-object.js index e82396a021..d4525a4cfc 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/use-default-proto-if-custom-proto-is-not-object.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/ctors/typedarray-arg/use-default-proto-if-custom-proto-is-not-object.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/TypedArrayConstructors/from/arylk-get-length-error.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/arylk-get-length-error.js index a81e83852d..a7f33ebd2b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/arylk-get-length-error.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/arylk-get-length-error.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/TypedArrayConstructors/from/arylk-to-length-error.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/arylk-to-length-error.js index 55eb5749ca..9ec5f7bf9f 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/arylk-to-length-error.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/arylk-to-length-error.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/TypedArrayConstructors/from/custom-ctor-does-not-instantiate-ta-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/custom-ctor-does-not-instantiate-ta-throws.js index c7e4907e32..fe0b87efe4 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/custom-ctor-does-not-instantiate-ta-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/custom-ctor-does-not-instantiate-ta-throws.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/TypedArrayConstructors/from/custom-ctor-returns-other-instance.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/custom-ctor-returns-other-instance.js index 9083ca3c08..6bf9ac83e6 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/custom-ctor-returns-other-instance.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/custom-ctor-returns-other-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/TypedArrayConstructors/from/custom-ctor-returns-smaller-instance-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/custom-ctor-returns-smaller-instance-throws.js index 044910acbf..8f005b5952 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/custom-ctor-returns-smaller-instance-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/custom-ctor-returns-smaller-instance-throws.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/TypedArrayConstructors/from/custom-ctor.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/custom-ctor.js index 292093d14d..93b40fef68 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/custom-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/custom-ctor.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/TypedArrayConstructors/from/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/inherited.js index 9577e35aab..6fc0819fbf 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/inherited.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/TypedArrayConstructors/from/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/invoked-as-func.js index b5dd5512cb..b48ab58a6b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/invoked-as-func.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/TypedArrayConstructors/from/iter-access-error.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/iter-access-error.js index e5c3737c29..7feacdadb3 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/iter-access-error.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/iter-access-error.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/TypedArrayConstructors/from/iter-invoke-error.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/iter-invoke-error.js index 5ff5bcc32e..65fb7f7d6c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/iter-invoke-error.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/iter-invoke-error.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/TypedArrayConstructors/from/iter-next-error.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/iter-next-error.js index 709c8026f5..ce3a3aa168 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/iter-next-error.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/iter-next-error.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/TypedArrayConstructors/from/iter-next-value-error.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/iter-next-value-error.js index 221433130d..e9aac7e83b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/iter-next-value-error.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/iter-next-value-error.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/TypedArrayConstructors/from/mapfn-abrupt-completion.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-abrupt-completion.js index 9d32ab9524..a0eaa7d336 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-abrupt-completion.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-abrupt-completion.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/TypedArrayConstructors/from/mapfn-arguments.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-arguments.js index 28b04f06da..4b95b05712 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-arguments.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-arguments.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/TypedArrayConstructors/from/mapfn-is-not-callable.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-is-not-callable.js index f5b9b7865b..4b31776f2e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-is-not-callable.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-is-not-callable.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/TypedArrayConstructors/from/mapfn-this-with-thisarg.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-this-with-thisarg.js index 4be11060b8..3f7088954d 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-this-with-thisarg.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-this-with-thisarg.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/TypedArrayConstructors/from/mapfn-this-without-thisarg-non-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-this-without-thisarg-non-strict.js index b6ff0005da..a912a83f74 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-this-without-thisarg-non-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-this-without-thisarg-non-strict.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/TypedArrayConstructors/from/mapfn-this-without-thisarg-strict-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-this-without-thisarg-strict-strict.js index 8a136b75bc..c66bf386cc 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-this-without-thisarg-strict-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/mapfn-this-without-thisarg-strict-strict.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) 'use strict'; // 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/TypedArrayConstructors/from/nan-conversion.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/nan-conversion.js index a35febc000..83877e2fc3 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/nan-conversion.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/nan-conversion.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/TypedArrayConstructors/from/new-instance-empty.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-empty.js index 0a276b5b58..f49d3c29d0 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-empty.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-empty.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/TypedArrayConstructors/from/new-instance-from-ordinary-object.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-from-ordinary-object.js index 6e0d9f4127..0b820af684 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-from-ordinary-object.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-from-ordinary-object.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/TypedArrayConstructors/from/new-instance-from-sparse-array.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-from-sparse-array.js index 85c9bbb5f7..c0f70dc85e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-from-sparse-array.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-from-sparse-array.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/TypedArrayConstructors/from/new-instance-from-zero.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-from-zero.js index 76eebadd49..bcd89444d3 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-from-zero.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-from-zero.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/TypedArrayConstructors/from/new-instance-using-custom-ctor.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-using-custom-ctor.js index 375458c109..27b437b774 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-using-custom-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-using-custom-ctor.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/TypedArrayConstructors/from/new-instance-with-mapfn.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-with-mapfn.js index 9a17d2db77..cee2af2ef1 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-with-mapfn.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-with-mapfn.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/TypedArrayConstructors/from/new-instance-without-mapfn.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-without-mapfn.js index f5aa405987..0e5f72a612 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-without-mapfn.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/new-instance-without-mapfn.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/TypedArrayConstructors/from/property-abrupt-completion.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/property-abrupt-completion.js index 20b1934e03..7de60a6aa5 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/property-abrupt-completion.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/property-abrupt-completion.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/TypedArrayConstructors/from/set-value-abrupt-completion.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/set-value-abrupt-completion.js index e94d807876..2b1672ff7a 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/set-value-abrupt-completion.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/set-value-abrupt-completion.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/TypedArrayConstructors/from/source-value-is-symbol-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/source-value-is-symbol-throws.js index e5a1ff264b..7ebc4e1f4f 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/source-value-is-symbol-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/source-value-is-symbol-throws.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/TypedArrayConstructors/from/this-is-not-constructor.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/this-is-not-constructor.js index 3369baef9b..48cd44966f 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/from/this-is-not-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/from/this-is-not-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/TypedArrayConstructors/internals/DefineOwnProperty/conversion-operation-consistent-nan.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/conversion-operation-consistent-nan.js index 12b8eb5042..8dd6bc7322 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/conversion-operation-consistent-nan.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/conversion-operation-consistent-nan.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/TypedArrayConstructors/internals/DefineOwnProperty/conversion-operation.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/conversion-operation.js index 9cb1a271c1..6e9d0773bd 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/conversion-operation.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/conversion-operation.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/TypedArrayConstructors/internals/DefineOwnProperty/desc-value-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/desc-value-throws.js index 987400e098..4c5588e49d 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/desc-value-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/desc-value-throws.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/TypedArrayConstructors/internals/DefineOwnProperty/detached-buffer-throws-realm.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/detached-buffer-throws-realm.js index e0bc4aa960..4febd9feb5 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/detached-buffer-throws-realm.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/detached-buffer-throws-realm.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/TypedArrayConstructors/internals/DefineOwnProperty/detached-buffer-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/detached-buffer-throws.js index 0508818e9d..d07aca032c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/detached-buffer-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/detached-buffer-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Alexey Shvayka. 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/TypedArrayConstructors/internals/DefineOwnProperty/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/detached-buffer.js index 5bca5e6893..72061fea46 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/detached-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/TypedArrayConstructors/internals/DefineOwnProperty/key-is-greater-than-last-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-greater-than-last-index.js index ad49623d94..735f0c9679 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-greater-than-last-index.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-greater-than-last-index.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/TypedArrayConstructors/internals/DefineOwnProperty/key-is-lower-than-zero.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-lower-than-zero.js index bafcc4e84f..21da5c2480 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-lower-than-zero.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-lower-than-zero.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/TypedArrayConstructors/internals/DefineOwnProperty/key-is-minus-zero.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-minus-zero.js index 970eb231eb..a74d68df05 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-minus-zero.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-minus-zero.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/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-canonical-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-canonical-index.js index c667f7ac46..5fa7ed880b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-canonical-index.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-canonical-index.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/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-integer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-integer.js index 7b1c6c9206..dc2f823b01 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-integer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-integer.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/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-numeric-index-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-numeric-index-throws.js index 5dbb162ef3..429f686806 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-numeric-index-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-numeric-index-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Alexey Shvayka. 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/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-numeric-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-numeric-index.js index 33b460ede6..b26ebb94db 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-numeric-index.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-not-numeric-index.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/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-accessor-desc-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-accessor-desc-throws.js index c794dd233d..4cf7805455 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-accessor-desc-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-accessor-desc-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Alexey Shvayka. 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/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-accessor-desc.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-accessor-desc.js index b382b1fcea..a27e8989cd 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-accessor-desc.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-accessor-desc.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/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-configurable.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-configurable.js index 3e6defb841..1197dfa091 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-configurable.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-configurable.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/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-configurable-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-configurable-throws.js index 12c0ea92de..d3f9ccc4a8 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-configurable-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-configurable-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Alexey Shvayka. 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/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable-throws.js index 3e09508c43..7fd184108c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Alexey Shvayka. 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/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable.js index 1c8ab48205..08ebd8cbb1 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable.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/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable-throws.js index 99c5579ee8..4322532753 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2021 Alexey Shvayka. 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/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable.js index 25d78bf869..e5d105b810 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable.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/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex.js index 0b45de3189..0ae1ae372c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-numericindex.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/TypedArrayConstructors/internals/DefineOwnProperty/key-is-symbol.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-symbol.js index 867f69e9d3..da9dfc1b73 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/key-is-symbol.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/TypedArrayConstructors/internals/DefineOwnProperty/non-extensible-new-key.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/non-extensible-new-key.js index 51a824d248..3fa85523aa 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/non-extensible-new-key.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/non-extensible-new-key.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/TypedArrayConstructors/internals/DefineOwnProperty/non-extensible-redefine-key.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/non-extensible-redefine-key.js index 00e67d6fd6..7831b2d803 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/non-extensible-redefine-key.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/non-extensible-redefine-key.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/TypedArrayConstructors/internals/DefineOwnProperty/set-value.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/set-value.js index 2b81f9777f..063055b318 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/set-value.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/set-value.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/TypedArrayConstructors/internals/DefineOwnProperty/shell.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/shell.js index c32f046213..c888512cb3 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/shell.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/shell.js @@ -53,7 +53,22 @@ var byteConversionValues = { -4294967296, // - ( 2 ** 32 ) Infinity, -Infinity, - 0 + 0, + 2049, // an integer which rounds down under ties-to-even when cast to float16 + 2051, // an integer which rounds up under ties-to-even when cast to float16 + 0.00006103515625, // smallest normal float16 + 0.00006097555160522461, // largest subnormal float16 + 5.960464477539063e-8, // smallest float16 + 2.9802322387695312e-8, // largest double which rounds to 0 when cast to float16 + 2.980232238769532e-8, // smallest double which does not round to 0 when cast to float16 + 8.940696716308594e-8, // a double which rounds up to a subnormal under ties-to-even when cast to float16 + 1.4901161193847656e-7, // a double which rounds down to a subnormal under ties-to-even when cast to float16 + 1.490116119384766e-7, // the next double above the one on the previous line one + 65504, // max finite float16 + 65520, // smallest double which rounds to infinity when cast to float16 + 65519.99999999999, // largest double which does not round to infinity when cast to float16 + 0.000061005353927612305, // smallest double which rounds to a non-subnormal when cast to float16 + 0.0000610053539276123 // largest double which rounds to a subnormal when cast to float16 ], expected: { @@ -98,7 +113,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 1, // 2049 + 3, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + -32, // 65504 + -16, // 65520 + -17, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint8: [ 127, // 127 @@ -141,7 +171,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 1, // 2049 + 3, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 224, // 65504 + 240, // 65520 + 239, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint8Clamped: [ 127, // 127 @@ -184,7 +229,22 @@ var byteConversionValues = { 0, // -4294967296 255, // Infinity 0, // -Infinity - 0 + 0, // 0 + 255, // 2049 + 255, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 255, // 65504 + 255, // 65520 + 255, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Int16: [ 127, // 127 @@ -227,7 +287,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + -32, // 65504 + -16, // 65520 + -17, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint16: [ 127, // 127 @@ -270,7 +345,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Int32: [ 127, // 127 @@ -313,7 +403,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint32: [ 127, // 127 @@ -356,93 +461,138 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Float16: [ - 127, // 127 - 128, // 128 - 32768, // 32767 - 32768, // 32768 - Infinity, // 2147483647 - Infinity, // 2147483648 - 255, // 255 - 256, // 256 - Infinity, // 65535 - Infinity, // 65536 - Infinity, // 4294967295 - Infinity, // 4294967296 - Infinity, // 9007199254740991 - Infinity, // 9007199254740992 - 1.099609375, // 1.1 - 0.0999755859375, // 0.1 - 0.5, // 0.5 - 0.5, // 0.50000001, - 0.60009765625, // 0.6 - 0.7001953125, // 0.7 - NaN, // undefined - -1, // -1 - -0, // -0 - -0.0999755859375, // -0.1 - -1.099609375, // -1.1 - NaN, // NaN - -127, // -127 - -128, // -128 - -32768, // -32767 - -32768, // -32768 - -Infinity, // -2147483647 - -Infinity, // -2147483648 - -255, // -255 - -256, // -256 - -Infinity, // -65535 - -Infinity, // -65536 - -Infinity, // -4294967295 - -Infinity, // -4294967296 - Infinity, // Infinity - -Infinity, // -Infinity - 0 + 127, // 127 + 128, // 128 + 32768, // 32767 + 32768, // 32768 + Infinity, // 2147483647 + Infinity, // 2147483648 + 255, // 255 + 256, // 256 + Infinity, // 65535 + Infinity, // 65536 + Infinity, // 4294967295 + Infinity, // 4294967296 + Infinity, // 9007199254740991 + Infinity, // 9007199254740992 + 1.099609375, // 1.1 + 0.0999755859375, // 0.1 + 0.5, // 0.5 + 0.5, // 0.50000001, + 0.60009765625, // 0.6 + 0.7001953125, // 0.7 + NaN, // undefined + -1, // -1 + -0, // -0 + -0.0999755859375, // -0.1 + -1.099609375, // -1.1 + NaN, // NaN + -127, // -127 + -128, // -128 + -32768, // -32767 + -32768, // -32768 + -Infinity, // -2147483647 + -Infinity, // -2147483648 + -255, // -255 + -256, // -256 + -Infinity, // -65535 + -Infinity, // -65536 + -Infinity, // -4294967295 + -Infinity, // -4294967296 + Infinity, // Infinity + -Infinity, // -Infinity + 0, // 0 + 2048, // 2049 + 2052, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 5.960464477539063e-8, // 2.980232238769532e-8 + 1.1920928955078125e-7, // 8.940696716308594e-8 + 1.1920928955078125e-7, // 1.4901161193847656e-7 + 1.7881393432617188e-7, // 1.490116119384766e-7 + 65504, // 65504 + Infinity, // 65520 + 65504, // 65519.99999999999 + 0.00006103515625, // 0.000061005353927612305 + 0.00006097555160522461 // 0.0000610053539276123 ], Float32: [ - 127, // 127 - 128, // 128 - 32767, // 32767 - 32768, // 32768 - 2147483648, // 2147483647 - 2147483648, // 2147483648 - 255, // 255 - 256, // 256 - 65535, // 65535 - 65536, // 65536 - 4294967296, // 4294967295 - 4294967296, // 4294967296 - 9007199254740992, // 9007199254740991 - 9007199254740992, // 9007199254740992 - 1.100000023841858, // 1.1 - 0.10000000149011612, // 0.1 - 0.5, // 0.5 - 0.5, // 0.50000001, - 0.6000000238418579, // 0.6 - 0.699999988079071, // 0.7 - NaN, // undefined - -1, // -1 - -0, // -0 - -0.10000000149011612, // -0.1 - -1.100000023841858, // -1.1 - NaN, // NaN - -127, // -127 - -128, // -128 - -32767, // -32767 - -32768, // -32768 - -2147483648, // -2147483647 - -2147483648, // -2147483648 - -255, // -255 - -256, // -256 - -65535, // -65535 - -65536, // -65536 - -4294967296, // -4294967295 - -4294967296, // -4294967296 - Infinity, // Infinity - -Infinity, // -Infinity - 0 + 127, // 127 + 128, // 128 + 32767, // 32767 + 32768, // 32768 + 2147483648, // 2147483647 + 2147483648, // 2147483648 + 255, // 255 + 256, // 256 + 65535, // 65535 + 65536, // 65536 + 4294967296, // 4294967295 + 4294967296, // 4294967296 + 9007199254740992, // 9007199254740991 + 9007199254740992, // 9007199254740992 + 1.100000023841858, // 1.1 + 0.10000000149011612, // 0.1 + 0.5, // 0.5 + 0.5, // 0.50000001, + 0.6000000238418579, // 0.6 + 0.699999988079071, // 0.7 + NaN, // undefined + -1, // -1 + -0, // -0 + -0.10000000149011612, // -0.1 + -1.100000023841858, // -1.1 + NaN, // NaN + -127, // -127 + -128, // -128 + -32767, // -32767 + -32768, // -32768 + -2147483648, // -2147483647 + -2147483648, // -2147483648 + -255, // -255 + -256, // -256 + -65535, // -65535 + -65536, // -65536 + -4294967296, // -4294967295 + -4294967296, // -4294967296 + Infinity, // Infinity + -Infinity, // -Infinity + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 2.9802322387695312e-8, // 2.9802322387695312e-8 + 2.9802322387695312e-8, // 2.980232238769532e-8 + 8.940696716308594e-8, // 8.940696716308594e-8 + 1.4901161193847656e-7, // 1.4901161193847656e-7 + 1.4901161193847656e-7, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65520, // 65519.99999999999 + 0.000061005353927612305, // 0.000061005353927612305 + 0.000061005353927612305 // 0.0000610053539276123 ], Float64: [ 127, // 127 @@ -485,7 +635,22 @@ var byteConversionValues = { -4294967296, // -4294967296 Infinity, // Infinity -Infinity, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 2.9802322387695312e-8, // 2.9802322387695312e-8 + 2.980232238769532e-8, // 2.980232238769532e-8 + 8.940696716308594e-8, // 8.940696716308594e-8 + 1.4901161193847656e-7, // 1.4901161193847656e-7 + 1.490116119384766e-7, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519.99999999999, // 65519.99999999999 + 0.000061005353927612305, // 0.000061005353927612305 + 0.0000610053539276123 // 0.0000610053539276123 ] } }; diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/this-is-not-extensible.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/this-is-not-extensible.js index 466959ed64..5a6ae195bf 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/this-is-not-extensible.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/this-is-not-extensible.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/TypedArrayConstructors/internals/DefineOwnProperty/tonumber-value-detached-buffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/tonumber-value-detached-buffer.js index 62b51f8945..a4f5eac988 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/tonumber-value-detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/DefineOwnProperty/tonumber-value-detached-buffer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/internals/Delete/BigInt/detached-buffer-key-is-symbol.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/detached-buffer-key-is-symbol.js index ed0dddfd7b..8d72613876 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/detached-buffer-key-is-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/detached-buffer-key-is-symbol.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArrayConstructors/internals/Delete/BigInt/detached-buffer-realm.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/detached-buffer-realm.js index 05cc9e7246..6baca7b13b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/detached-buffer-realm.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/detached-buffer-realm.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArrayConstructors/internals/Delete/BigInt/indexed-value-ab-strict-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/indexed-value-ab-strict-strict.js index b54d66cca8..61bd2918d0 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/indexed-value-ab-strict-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/indexed-value-ab-strict-strict.js @@ -40,16 +40,16 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(TypeError, () => { delete sample["0"]; - }, '`delete sample["0"]` throws TypeError'); + }); assert.throws(TypeError, () => { delete sample["1"]; - }, '`delete sample["1"]` throws TypeError'); + }); assert.throws(TypeError, () => { delete sample[0]; - }, '`delete sample[0]` throws TypeError'); + }); assert.throws(TypeError, () => { delete sample[0]; - }, '`delete sample[0]` throws TypeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/indexed-value-sab-non-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/indexed-value-sab-non-strict.js index 0f63640193..7b591a085e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/indexed-value-sab-non-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/indexed-value-sab-non-strict.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/internals/Delete/BigInt/indexed-value-sab-strict-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/indexed-value-sab-strict-strict.js index 6677f96548..cd3aaaa64e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/indexed-value-sab-strict-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/indexed-value-sab-strict-strict.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally 'use strict'; // Copyright (C) 2020 Rick Waldron. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. All rights reserved. diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-canonical-index-strict-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-canonical-index-strict-strict.js index 4435c4ac17..52a1d0c371 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-canonical-index-strict-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-canonical-index-strict-strict.js @@ -60,7 +60,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(TypeError, () => { delete sample[key]; - }, '`delete sample[key]` throws TypeError'); + }); delete TypedArray.prototype[key]; }); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-minus-zero-strict-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-minus-zero-strict-strict.js index c0e42e745e..4225c3761e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-minus-zero-strict-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-minus-zero-strict-strict.js @@ -43,7 +43,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue(delete sample["-0"], true, 'The value of `delete sample["-0"]` is true'); assert.throws(TypeError, () => { delete sample[-0]; - }, '`delete sample[-0]` throws TypeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-get-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-get-throws.js index 2cd35158c4..ba58f7e2bb 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-get-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-get-throws.js @@ -34,7 +34,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(Test262Error, () => { sample.foo; - }, '`sample.foo` throws Test262Error'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-strict-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-strict-strict.js index 2a9f7171e9..69f1052a0f 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-strict-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-not-numeric-index-strict-strict.js @@ -42,7 +42,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(TypeError, () => { delete sample.bar; - }, '`delete sample.bar` throws TypeError'); + }); assert.sameValue(delete sample.baz, true, 'The value of `delete sample.baz` is true'); }); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-out-of-bounds-strict-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-out-of-bounds-strict-strict.js index 8d67ba003f..d5b4a54f9b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-out-of-bounds-strict-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/BigInt/key-is-out-of-bounds-strict-strict.js @@ -44,11 +44,11 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(TypeError, () => { delete sample["0"]; - }, '`delete sample["0"]` throws TypeError'); + }); assert.throws(TypeError, () => { delete sample[0]; - }, '`delete sample[0]` throws TypeError'); + }); assert.sameValue(delete sample["1"], true, 'The value of `delete sample["1"]` is true'); assert.sameValue(delete sample[1], true, 'The value of `delete sample[1]` is true'); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/detached-buffer-key-is-not-numeric-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/detached-buffer-key-is-not-numeric-index.js index f204b58813..c54c35d46d 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/detached-buffer-key-is-not-numeric-index.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/detached-buffer-key-is-not-numeric-index.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArrayConstructors/internals/Delete/detached-buffer-key-is-symbol.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/detached-buffer-key-is-symbol.js index ed0dddfd7b..8d72613876 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/detached-buffer-key-is-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/detached-buffer-key-is-symbol.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArrayConstructors/internals/Delete/detached-buffer-realm.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/detached-buffer-realm.js index 05cc9e7246..6baca7b13b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/detached-buffer-realm.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/detached-buffer-realm.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArrayConstructors/internals/Delete/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/detached-buffer.js index d55e8b15ee..f79153c5b1 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/detached-buffer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArrayConstructors/internals/Delete/indexed-value-ab-non-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/indexed-value-ab-non-strict.js index ac273ff0a6..3d019ff1f6 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/indexed-value-ab-non-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/indexed-value-ab-non-strict.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArrayConstructors/internals/Delete/indexed-value-ab-strict-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/indexed-value-ab-strict-strict.js index 5ac3219bba..63f2adc265 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/indexed-value-ab-strict-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/indexed-value-ab-strict-strict.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) 'use strict'; // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -40,16 +41,16 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(TypeError, () => { delete sample["0"]; - }, '`delete sample["0"]` throws TypeError'); + }); assert.throws(TypeError, () => { delete sample["1"]; - }, '`delete sample["1"]` throws TypeError'); + }); assert.throws(TypeError, () => { delete sample[0]; - }, '`delete sample[0]` throws TypeError'); + }); assert.throws(TypeError, () => { delete sample[0]; - }, '`delete sample[0]` throws TypeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/indexed-value-sab-non-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/indexed-value-sab-non-strict.js index 0f63640193..7b591a085e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/indexed-value-sab-non-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/indexed-value-sab-non-strict.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2020 Rick Waldron. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/internals/Delete/indexed-value-sab-strict-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/indexed-value-sab-strict-strict.js index 6677f96548..cd3aaaa64e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/indexed-value-sab-strict-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/indexed-value-sab-strict-strict.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally 'use strict'; // Copyright (C) 2020 Rick Waldron. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. All rights reserved. diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/infinity-detached-buffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/infinity-detached-buffer.js index 735673dcc1..49c62e1d97 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/infinity-detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/infinity-detached-buffer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArrayConstructors/internals/Delete/key-is-not-canonical-index-non-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-canonical-index-non-strict.js index 9cd26b2c46..998ccdfcb5 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-canonical-index-non-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-canonical-index-non-strict.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArrayConstructors/internals/Delete/key-is-not-canonical-index-strict-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-canonical-index-strict-strict.js index acd52c7cce..7ec1e47040 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-canonical-index-strict-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-canonical-index-strict-strict.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) 'use strict'; // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -60,7 +61,7 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(TypeError, () => { delete sample[key]; - }, '`delete sample[key]` throws TypeError'); + }); delete TypedArray.prototype[key]; }); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-integer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-integer.js index d8862bd99b..ace2960d39 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-integer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-integer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-non-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-non-strict.js index 8a60a14c4c..55f72d6b26 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-non-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-non-strict.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-strict-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-strict-strict.js index 33bae05317..82c9f02681 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-strict-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-minus-zero-strict-strict.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) 'use strict'; // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -43,7 +44,7 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(delete sample["-0"], true, 'The value of `delete sample["-0"]` is true'); assert.throws(TypeError, () => { delete sample[-0]; - }, '`delete sample[-0]` throws TypeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-get-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-get-throws.js index 5035a5d733..ff00a8599b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-get-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-get-throws.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- @@ -34,7 +35,7 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(Test262Error, () => { sample.foo; - }, '`sample.foo` throws Test262Error'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-non-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-non-strict.js index 2b9d9a378e..f6995a7195 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-non-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-non-strict.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-strict-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-strict-strict.js index af6397a576..131e8cd229 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-strict-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-not-numeric-index-strict-strict.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) 'use strict'; // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -42,7 +43,7 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(TypeError, () => { delete sample.bar; - }, '`delete sample.bar` throws TypeError'); + }); assert.sameValue(delete sample.baz, true, 'The value of `delete sample.baz` is true'); }); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-out-of-bounds-non-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-out-of-bounds-non-strict.js index 63130f39a7..b667906a7c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-out-of-bounds-non-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-out-of-bounds-non-strict.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArrayConstructors/internals/Delete/key-is-out-of-bounds-strict-strict.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-out-of-bounds-strict-strict.js index c668f681c3..b40ccf92a7 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-out-of-bounds-strict-strict.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-out-of-bounds-strict-strict.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) 'use strict'; // Copyright (C) 2020 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -44,11 +45,11 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(TypeError, () => { delete sample["0"]; - }, '`delete sample["0"]` throws TypeError'); + }); assert.throws(TypeError, () => { delete sample[0]; - }, '`delete sample[0]` throws TypeError'); + }); assert.sameValue(delete sample["1"], true, 'The value of `delete sample["1"]` is true'); assert.sameValue(delete sample[1], true, 'The value of `delete sample[1]` is true'); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-symbol.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-symbol.js index 6e25155282..3632436587 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Delete/key-is-symbol.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2020 Rick Waldron. 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/TypedArrayConstructors/internals/Get/detached-buffer-key-is-not-numeric-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/detached-buffer-key-is-not-numeric-index.js index 85a5dd2845..bf90a5d26d 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/detached-buffer-key-is-not-numeric-index.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/detached-buffer-key-is-not-numeric-index.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/TypedArrayConstructors/internals/Get/detached-buffer-key-is-symbol.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/detached-buffer-key-is-symbol.js index 5d7d4fcb48..0ff050471b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/detached-buffer-key-is-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/detached-buffer-key-is-symbol.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/TypedArrayConstructors/internals/Get/detached-buffer-realm.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/detached-buffer-realm.js index 5c54ccfa2f..7619143e23 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/detached-buffer-realm.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/detached-buffer-realm.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/TypedArrayConstructors/internals/Get/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/detached-buffer.js index ca6783aa51..5d6f4eb3f3 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/detached-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/TypedArrayConstructors/internals/Get/indexed-value-sab.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/indexed-value-sab.js index 508254c872..84d8667464 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/indexed-value-sab.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/indexed-value-sab.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally +// |reftest| shell-option(--enable-float16array) skip-if(!this.hasOwnProperty('SharedArrayBuffer')) -- SharedArrayBuffer is not enabled unconditionally // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/internals/Get/indexed-value.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/indexed-value.js index f99235ad50..65131490a4 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/indexed-value.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/indexed-value.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/TypedArrayConstructors/internals/Get/infinity-detached-buffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/infinity-detached-buffer.js index 64cf13940d..1ddf76c524 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/infinity-detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/infinity-detached-buffer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2017 André Bargull. 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/TypedArrayConstructors/internals/Get/key-is-not-canonical-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-not-canonical-index.js index 985516626b..3c5729a93c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-not-canonical-index.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-not-canonical-index.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/TypedArrayConstructors/internals/Get/key-is-not-integer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-not-integer.js index 3059457150..7ee893d5ce 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-not-integer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-not-integer.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/TypedArrayConstructors/internals/Get/key-is-not-minus-zero.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-not-minus-zero.js index 2810260d97..2576097613 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-not-minus-zero.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-not-minus-zero.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/TypedArrayConstructors/internals/Get/key-is-not-numeric-index-get-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-not-numeric-index-get-throws.js index 12ad42d27c..b75c4bfe3e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-not-numeric-index-get-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-not-numeric-index-get-throws.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/TypedArrayConstructors/internals/Get/key-is-not-numeric-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-not-numeric-index.js index 928add152b..81c2fd60b6 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-not-numeric-index.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-not-numeric-index.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/TypedArrayConstructors/internals/Get/key-is-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-out-of-bounds.js index b8534bf612..9d1bcb7ccd 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-out-of-bounds.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/TypedArrayConstructors/internals/Get/key-is-symbol.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-symbol.js index c0dcf29c51..967a046aa1 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Get/key-is-symbol.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/TypedArrayConstructors/internals/GetOwnProperty/detached-buffer-key-is-not-number.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/detached-buffer-key-is-not-number.js index 59696d38ea..85bb5fb549 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/detached-buffer-key-is-not-number.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/detached-buffer-key-is-not-number.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/TypedArrayConstructors/internals/GetOwnProperty/detached-buffer-key-is-symbol.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/detached-buffer-key-is-symbol.js index 38d405b94b..066e2efe60 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/detached-buffer-key-is-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/detached-buffer-key-is-symbol.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/TypedArrayConstructors/internals/GetOwnProperty/detached-buffer-realm.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/detached-buffer-realm.js index dfb0d554f1..b27fdafcf2 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/detached-buffer-realm.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/detached-buffer-realm.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/TypedArrayConstructors/internals/GetOwnProperty/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/detached-buffer.js index c1a7151ae0..c5bd0ec401 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/detached-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/TypedArrayConstructors/internals/GetOwnProperty/enumerate-detached-buffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/enumerate-detached-buffer.js index 8611cfb434..2b418f6116 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/enumerate-detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/enumerate-detached-buffer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2017 André Bargull. 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/TypedArrayConstructors/internals/GetOwnProperty/index-prop-desc.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/index-prop-desc.js index 4238cd9e66..1dda5701f6 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/index-prop-desc.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/index-prop-desc.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2020 Apple Inc. 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/TypedArrayConstructors/internals/GetOwnProperty/key-is-minus-zero.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-minus-zero.js index 752f3f6204..4abec5bc24 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-minus-zero.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-minus-zero.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/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-canonical-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-canonical-index.js index c9fa3e8b54..b51524fe8d 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-canonical-index.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-canonical-index.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/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-integer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-integer.js index 297e1b14a3..88f386a22c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-integer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-integer.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/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-numeric-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-numeric-index.js index 0f78950189..c73b6ef3f5 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-numeric-index.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-not-numeric-index.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/TypedArrayConstructors/internals/GetOwnProperty/key-is-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-out-of-bounds.js index c4cda461fb..646eebd35a 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-out-of-bounds.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/TypedArrayConstructors/internals/GetOwnProperty/key-is-symbol.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-symbol.js index d686d07edb..422fb577a5 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/key-is-symbol.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/TypedArrayConstructors/internals/HasProperty/BigInt/abrupt-from-ordinary-has-parent-hasproperty.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/abrupt-from-ordinary-has-parent-hasproperty.js index fcec3e4db7..d63f2757b2 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/abrupt-from-ordinary-has-parent-hasproperty.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/BigInt/abrupt-from-ordinary-has-parent-hasproperty.js @@ -51,7 +51,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(Test262Error, function() { Reflect.has(sample, "foo"); - }, '`Reflect.has(sample, "foo")` throws Test262Error'); + }); Object.defineProperty(sample, "foo", { value: 42 }); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/abrupt-from-ordinary-has-parent-hasproperty.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/abrupt-from-ordinary-has-parent-hasproperty.js index 3513862b71..319c791173 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/abrupt-from-ordinary-has-parent-hasproperty.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/abrupt-from-ordinary-has-parent-hasproperty.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. /*--- @@ -51,7 +52,7 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(Test262Error, function() { Reflect.has(sample, "foo"); - }, '`Reflect.has(sample, "foo")` throws Test262Error'); + }); Object.defineProperty(sample, "foo", { value: 42 }); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/detached-buffer-key-is-not-number.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/detached-buffer-key-is-not-number.js index 3a8d2511e5..e84efc6ee8 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/detached-buffer-key-is-not-number.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/detached-buffer-key-is-not-number.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/TypedArrayConstructors/internals/HasProperty/detached-buffer-key-is-symbol.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/detached-buffer-key-is-symbol.js index 80810d3d8c..fd32467bd9 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/detached-buffer-key-is-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/detached-buffer-key-is-symbol.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/TypedArrayConstructors/internals/HasProperty/detached-buffer-realm.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/detached-buffer-realm.js index d9be7d2e18..d46c0ed716 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/detached-buffer-realm.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/detached-buffer-realm.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/TypedArrayConstructors/internals/HasProperty/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/detached-buffer.js index 80f3d2aaf3..70b45f1655 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/detached-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/TypedArrayConstructors/internals/HasProperty/indexed-value.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/indexed-value.js index 3cb63c33ba..d554390e0b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/indexed-value.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/indexed-value.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/TypedArrayConstructors/internals/HasProperty/infinity-with-detached-buffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/infinity-with-detached-buffer.js index b71d009764..c7ba3b64d9 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/infinity-with-detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/infinity-with-detached-buffer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2017 André Bargull. 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/TypedArrayConstructors/internals/HasProperty/inherited-property.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/inherited-property.js index eb736978dc..3e0f0ff400 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/inherited-property.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/inherited-property.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/TypedArrayConstructors/internals/HasProperty/key-is-greater-than-last-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-greater-than-last-index.js index 1c930e4005..172cef5017 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-greater-than-last-index.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-greater-than-last-index.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/TypedArrayConstructors/internals/HasProperty/key-is-lower-than-zero.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-lower-than-zero.js index 3cbe081f30..7f22872bbc 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-lower-than-zero.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-lower-than-zero.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/TypedArrayConstructors/internals/HasProperty/key-is-minus-zero.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-minus-zero.js index 870cc9a039..d06d116a6d 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-minus-zero.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-minus-zero.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/TypedArrayConstructors/internals/HasProperty/key-is-not-canonical-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-not-canonical-index.js index 4207b866e4..f14c2ca6d2 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-not-canonical-index.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-not-canonical-index.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/TypedArrayConstructors/internals/HasProperty/key-is-not-integer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-not-integer.js index 3b9b39bae2..0fb7249a70 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-not-integer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-not-integer.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/TypedArrayConstructors/internals/HasProperty/key-is-not-numeric-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-not-numeric-index.js index acb5905ae0..d596b8fb16 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-not-numeric-index.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-not-numeric-index.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/TypedArrayConstructors/internals/HasProperty/key-is-symbol.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-symbol.js index 915af90334..cdb1afacee 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/key-is-symbol.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/TypedArrayConstructors/internals/HasProperty/resizable-array-buffer-auto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/resizable-array-buffer-auto.js index 5e1a504d5e..a24a296a50 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/resizable-array-buffer-auto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/resizable-array-buffer-auto.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/TypedArrayConstructors/internals/HasProperty/resizable-array-buffer-fixed.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/resizable-array-buffer-fixed.js index 59c5b5ac4c..252cff6c2d 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/resizable-array-buffer-fixed.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/HasProperty/resizable-array-buffer-fixed.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/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-and-string-and-symbol-keys-.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-and-string-and-symbol-keys-.js index ebf707791b..541796a64c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-and-string-and-symbol-keys-.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-and-string-and-symbol-keys-.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/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-and-string-keys.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-and-string-keys.js index 00532ce8b2..cdf0fcddf4 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-and-string-keys.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-and-string-keys.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/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-resizable-array-buffer-auto.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-resizable-array-buffer-auto.js index 83995def30..2560585861 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-resizable-array-buffer-auto.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-resizable-array-buffer-auto.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/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-resizable-array-buffer-fixed.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-resizable-array-buffer-fixed.js index b6faa1f4ba..9a9d7a7ebc 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-resizable-array-buffer-fixed.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-resizable-array-buffer-fixed.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/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes.js index b731decd95..acffe3aa3b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes.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/TypedArrayConstructors/internals/OwnPropertyKeys/not-enumerable-keys.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/not-enumerable-keys.js index 9c78932877..e2a5d0b48a 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/not-enumerable-keys.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/not-enumerable-keys.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/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index-set-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index-set-throws.js index 5b8dd12f01..6e6ec71a53 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index-set-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index-set-throws.js @@ -34,7 +34,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(Test262Error, function() { sample.test262 = 1; - }, '`sample.test262 = 1` throws Test262Error'); + }); assert.sameValue(sample.test262, undefined, 'The value of sample.test262 is expected to equal `undefined`'); }); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/null-tobigint.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/null-tobigint.js index 104c5a8509..ecfdccbed8 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/null-tobigint.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/null-tobigint.js @@ -56,7 +56,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(TypeError, function() { typedArray[0] = null; - }, '`typedArray[0] = null` throws TypeError'); + }); }); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/number-tobigint.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/number-tobigint.js index b7724a0aed..93e6324a44 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/number-tobigint.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/number-tobigint.js @@ -56,31 +56,31 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(TypeError, function() { typedArray[0] = 1; - }, '`typedArray[0] = 1` throws TypeError'); + }); assert.throws(TypeError, function() { typedArray[0] = Math.pow(2, 63); - }, '`typedArray[0] = Math.pow(2, 63)` throws TypeError'); + }); assert.throws(TypeError, function() { typedArray[0] = +0; - }, '`typedArray[0] = +0` throws TypeError'); + }); assert.throws(TypeError, function() { typedArray[0] = -0; - }, '`typedArray[0] = -0` throws TypeError'); + }); assert.throws(TypeError, function() { typedArray[0] = Infinity; - }, '`typedArray[0] = Infinity` throws TypeError'); + }); assert.throws(TypeError, function() { typedArray[0] = -Infinity; - }, '`typedArray[0] = -Infinity` throws TypeError'); + }); assert.throws(TypeError, function() { typedArray[0] = NaN; - }, '`typedArray[0] = NaN` throws TypeError'); + }); }); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/string-nan-tobigint.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/string-nan-tobigint.js index f0646cc025..898edef334 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/string-nan-tobigint.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/string-nan-tobigint.js @@ -60,7 +60,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(SyntaxError, function() { typedArray[0] = "definately not a number"; - }, '`typedArray[0] = "definately not a number"` throws SyntaxError'); + }); }); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/symbol-tobigint.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/symbol-tobigint.js index 6b5618b568..76dbf5ded1 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/symbol-tobigint.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/symbol-tobigint.js @@ -58,7 +58,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(TypeError, function() { typedArray[0] = s; - }, '`typedArray[0] = s` throws TypeError'); + }); }); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/undefined-tobigint.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/undefined-tobigint.js index a2152d98f2..b0f99816e4 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/undefined-tobigint.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/undefined-tobigint.js @@ -57,7 +57,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.throws(TypeError, function() { typedArray[0] = undefined; - }, '`typedArray[0] = undefined` throws TypeError'); + }); }); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/bigint-tonumber.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/bigint-tonumber.js index d2355a13c4..5ee59a7075 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/bigint-tonumber.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/bigint-tonumber.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 Valerie Young. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- @@ -55,7 +56,7 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(TypeError, function() { typedArray[0] = 1n; - }, '`typedArray[0] = 1n` throws TypeError'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/conversion-operation-consistent-nan.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/conversion-operation-consistent-nan.js index b97ef770e1..079f249552 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/conversion-operation-consistent-nan.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/conversion-operation-consistent-nan.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/TypedArrayConstructors/internals/Set/conversion-operation.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/conversion-operation.js index 786b0c4bec..896863d4d1 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/conversion-operation.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/conversion-operation.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/TypedArrayConstructors/internals/Set/detached-buffer-key-is-not-numeric-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-key-is-not-numeric-index.js index 81a22ef437..733061e5cf 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-key-is-not-numeric-index.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-key-is-not-numeric-index.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/TypedArrayConstructors/internals/Set/detached-buffer-key-is-symbol.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-key-is-symbol.js index 183070c85b..da083b6c8b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-key-is-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-key-is-symbol.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/TypedArrayConstructors/internals/Set/detached-buffer-realm.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-realm.js index 5e6269b2e9..133f1aa0fa 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-realm.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-realm.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/TypedArrayConstructors/internals/Set/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer.js index 705b22dca5..f34756f129 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-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. /*--- @@ -51,7 +52,7 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(Test262Error, function() { sample['0'] = obj; - }, '`sample[\'0\'] = obj` throws Test262Error'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/indexed-value.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/indexed-value.js index 66cf4571ec..b530dd0da6 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/indexed-value.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/indexed-value.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/TypedArrayConstructors/internals/Set/key-is-minus-zero.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-minus-zero.js index c171aa1a3c..0b388babb5 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-minus-zero.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-minus-zero.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/TypedArrayConstructors/internals/Set/key-is-not-canonical-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-canonical-index.js index 72d1f7769a..65a8eead9c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-canonical-index.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-canonical-index.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/TypedArrayConstructors/internals/Set/key-is-not-integer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-integer.js index a13b9cfe79..2d3957b4b1 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-integer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-integer.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/TypedArrayConstructors/internals/Set/key-is-not-numeric-index-set-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index-set-throws.js index 13360bfa55..ae41a4ab80 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index-set-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index-set-throws.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. /*--- @@ -34,7 +35,7 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(Test262Error, function() { sample.test262 = 1; - }, '`sample.test262 = 1` throws Test262Error'); + }); assert.sameValue(sample.test262, undefined, 'The value of sample.test262 is expected to equal `undefined`'); }); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index.js index 9db75bd292..bb25303fc9 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index.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/TypedArrayConstructors/internals/Set/key-is-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-out-of-bounds.js index 5470398b71..9fa3d49a53 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-out-of-bounds.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-out-of-bounds.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/TypedArrayConstructors/internals/Set/key-is-symbol.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-symbol.js index fe624e4725..8f1313b9fd 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-symbol.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-symbol.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/TypedArrayConstructors/internals/Set/resized-out-of-bounds-to-in-bounds-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/resized-out-of-bounds-to-in-bounds-index.js new file mode 100644 index 0000000000..62268e26b6 --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/resized-out-of-bounds-to-in-bounds-index.js @@ -0,0 +1,40 @@ +// |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-typedarraysetelement +description: > + Index is validated after converting the right-hand side operand. +info: | + TypedArraySetElement ( O, index, value ) + ... + 2. Otherwise, let numValue be ? ToNumber(value). + 3. If IsValidIntegerIndex(O, index) is true, then + ... + +features: [TypedArray, resizable-arraybuffer] +---*/ + +let rab = new ArrayBuffer(0, {maxByteLength: 1}); +let ta = new Int8Array(rab); + +// Index is initially out-of-bounds. +let index = 0; + +let value = { + valueOf() { + // Make `index` an in-bounds access. + rab.resize(1); + return 100; + } +}; + +assert.sameValue(ta.length, 0); + +ta[index] = value; + +assert.sameValue(ta.length, 1); +assert.sameValue(ta[0], 100); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/shell.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/shell.js index c32f046213..c888512cb3 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/shell.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/shell.js @@ -53,7 +53,22 @@ var byteConversionValues = { -4294967296, // - ( 2 ** 32 ) Infinity, -Infinity, - 0 + 0, + 2049, // an integer which rounds down under ties-to-even when cast to float16 + 2051, // an integer which rounds up under ties-to-even when cast to float16 + 0.00006103515625, // smallest normal float16 + 0.00006097555160522461, // largest subnormal float16 + 5.960464477539063e-8, // smallest float16 + 2.9802322387695312e-8, // largest double which rounds to 0 when cast to float16 + 2.980232238769532e-8, // smallest double which does not round to 0 when cast to float16 + 8.940696716308594e-8, // a double which rounds up to a subnormal under ties-to-even when cast to float16 + 1.4901161193847656e-7, // a double which rounds down to a subnormal under ties-to-even when cast to float16 + 1.490116119384766e-7, // the next double above the one on the previous line one + 65504, // max finite float16 + 65520, // smallest double which rounds to infinity when cast to float16 + 65519.99999999999, // largest double which does not round to infinity when cast to float16 + 0.000061005353927612305, // smallest double which rounds to a non-subnormal when cast to float16 + 0.0000610053539276123 // largest double which rounds to a subnormal when cast to float16 ], expected: { @@ -98,7 +113,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 1, // 2049 + 3, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + -32, // 65504 + -16, // 65520 + -17, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint8: [ 127, // 127 @@ -141,7 +171,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 1, // 2049 + 3, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 224, // 65504 + 240, // 65520 + 239, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint8Clamped: [ 127, // 127 @@ -184,7 +229,22 @@ var byteConversionValues = { 0, // -4294967296 255, // Infinity 0, // -Infinity - 0 + 0, // 0 + 255, // 2049 + 255, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 255, // 65504 + 255, // 65520 + 255, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Int16: [ 127, // 127 @@ -227,7 +287,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + -32, // 65504 + -16, // 65520 + -17, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint16: [ 127, // 127 @@ -270,7 +345,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Int32: [ 127, // 127 @@ -313,7 +403,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint32: [ 127, // 127 @@ -356,93 +461,138 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Float16: [ - 127, // 127 - 128, // 128 - 32768, // 32767 - 32768, // 32768 - Infinity, // 2147483647 - Infinity, // 2147483648 - 255, // 255 - 256, // 256 - Infinity, // 65535 - Infinity, // 65536 - Infinity, // 4294967295 - Infinity, // 4294967296 - Infinity, // 9007199254740991 - Infinity, // 9007199254740992 - 1.099609375, // 1.1 - 0.0999755859375, // 0.1 - 0.5, // 0.5 - 0.5, // 0.50000001, - 0.60009765625, // 0.6 - 0.7001953125, // 0.7 - NaN, // undefined - -1, // -1 - -0, // -0 - -0.0999755859375, // -0.1 - -1.099609375, // -1.1 - NaN, // NaN - -127, // -127 - -128, // -128 - -32768, // -32767 - -32768, // -32768 - -Infinity, // -2147483647 - -Infinity, // -2147483648 - -255, // -255 - -256, // -256 - -Infinity, // -65535 - -Infinity, // -65536 - -Infinity, // -4294967295 - -Infinity, // -4294967296 - Infinity, // Infinity - -Infinity, // -Infinity - 0 + 127, // 127 + 128, // 128 + 32768, // 32767 + 32768, // 32768 + Infinity, // 2147483647 + Infinity, // 2147483648 + 255, // 255 + 256, // 256 + Infinity, // 65535 + Infinity, // 65536 + Infinity, // 4294967295 + Infinity, // 4294967296 + Infinity, // 9007199254740991 + Infinity, // 9007199254740992 + 1.099609375, // 1.1 + 0.0999755859375, // 0.1 + 0.5, // 0.5 + 0.5, // 0.50000001, + 0.60009765625, // 0.6 + 0.7001953125, // 0.7 + NaN, // undefined + -1, // -1 + -0, // -0 + -0.0999755859375, // -0.1 + -1.099609375, // -1.1 + NaN, // NaN + -127, // -127 + -128, // -128 + -32768, // -32767 + -32768, // -32768 + -Infinity, // -2147483647 + -Infinity, // -2147483648 + -255, // -255 + -256, // -256 + -Infinity, // -65535 + -Infinity, // -65536 + -Infinity, // -4294967295 + -Infinity, // -4294967296 + Infinity, // Infinity + -Infinity, // -Infinity + 0, // 0 + 2048, // 2049 + 2052, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 5.960464477539063e-8, // 2.980232238769532e-8 + 1.1920928955078125e-7, // 8.940696716308594e-8 + 1.1920928955078125e-7, // 1.4901161193847656e-7 + 1.7881393432617188e-7, // 1.490116119384766e-7 + 65504, // 65504 + Infinity, // 65520 + 65504, // 65519.99999999999 + 0.00006103515625, // 0.000061005353927612305 + 0.00006097555160522461 // 0.0000610053539276123 ], Float32: [ - 127, // 127 - 128, // 128 - 32767, // 32767 - 32768, // 32768 - 2147483648, // 2147483647 - 2147483648, // 2147483648 - 255, // 255 - 256, // 256 - 65535, // 65535 - 65536, // 65536 - 4294967296, // 4294967295 - 4294967296, // 4294967296 - 9007199254740992, // 9007199254740991 - 9007199254740992, // 9007199254740992 - 1.100000023841858, // 1.1 - 0.10000000149011612, // 0.1 - 0.5, // 0.5 - 0.5, // 0.50000001, - 0.6000000238418579, // 0.6 - 0.699999988079071, // 0.7 - NaN, // undefined - -1, // -1 - -0, // -0 - -0.10000000149011612, // -0.1 - -1.100000023841858, // -1.1 - NaN, // NaN - -127, // -127 - -128, // -128 - -32767, // -32767 - -32768, // -32768 - -2147483648, // -2147483647 - -2147483648, // -2147483648 - -255, // -255 - -256, // -256 - -65535, // -65535 - -65536, // -65536 - -4294967296, // -4294967295 - -4294967296, // -4294967296 - Infinity, // Infinity - -Infinity, // -Infinity - 0 + 127, // 127 + 128, // 128 + 32767, // 32767 + 32768, // 32768 + 2147483648, // 2147483647 + 2147483648, // 2147483648 + 255, // 255 + 256, // 256 + 65535, // 65535 + 65536, // 65536 + 4294967296, // 4294967295 + 4294967296, // 4294967296 + 9007199254740992, // 9007199254740991 + 9007199254740992, // 9007199254740992 + 1.100000023841858, // 1.1 + 0.10000000149011612, // 0.1 + 0.5, // 0.5 + 0.5, // 0.50000001, + 0.6000000238418579, // 0.6 + 0.699999988079071, // 0.7 + NaN, // undefined + -1, // -1 + -0, // -0 + -0.10000000149011612, // -0.1 + -1.100000023841858, // -1.1 + NaN, // NaN + -127, // -127 + -128, // -128 + -32767, // -32767 + -32768, // -32768 + -2147483648, // -2147483647 + -2147483648, // -2147483648 + -255, // -255 + -256, // -256 + -65535, // -65535 + -65536, // -65536 + -4294967296, // -4294967295 + -4294967296, // -4294967296 + Infinity, // Infinity + -Infinity, // -Infinity + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 2.9802322387695312e-8, // 2.9802322387695312e-8 + 2.9802322387695312e-8, // 2.980232238769532e-8 + 8.940696716308594e-8, // 8.940696716308594e-8 + 1.4901161193847656e-7, // 1.4901161193847656e-7 + 1.4901161193847656e-7, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65520, // 65519.99999999999 + 0.000061005353927612305, // 0.000061005353927612305 + 0.000061005353927612305 // 0.0000610053539276123 ], Float64: [ 127, // 127 @@ -485,7 +635,22 @@ var byteConversionValues = { -4294967296, // -4294967296 Infinity, // Infinity -Infinity, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 2.9802322387695312e-8, // 2.9802322387695312e-8 + 2.980232238769532e-8, // 2.980232238769532e-8 + 8.940696716308594e-8, // 8.940696716308594e-8 + 1.4901161193847656e-7, // 1.4901161193847656e-7 + 1.490116119384766e-7, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519.99999999999, // 65519.99999999999 + 0.000061005353927612305, // 0.000061005353927612305 + 0.0000610053539276123 // 0.0000610053539276123 ] } }; diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-detached-buffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-detached-buffer.js index bdb3a74ae9..b1e0131ab5 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-detached-buffer.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-detached-buffer.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2017 Mozilla Corporation. 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/TypedArrayConstructors/internals/Set/tonumber-value-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-throws.js index 08f17de272..5991c52715 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-throws.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. /*--- @@ -37,27 +38,27 @@ testWithTypedArrayConstructors(function(TA) { assert.throws(Test262Error, function() { sample["0"] = obj; - }, '`sample["0"] = obj` throws Test262Error'); + }); assert.throws(Test262Error, function() { sample["1.1"] = obj; - }, '`sample["1.1"] = obj` throws Test262Error'); + }); assert.throws(Test262Error, function() { sample["-0"] = obj; - }, '`sample["-0"] = obj` throws Test262Error'); + }); assert.throws(Test262Error, function() { sample["-1"] = obj; - }, '`sample["-1"] = obj` throws Test262Error'); + }); assert.throws(Test262Error, function() { sample["1"] = obj; - }, '`sample["1"] = obj` throws Test262Error'); + }); assert.throws(Test262Error, function() { sample["2"] = obj; - }, '`sample["2"] = obj` throws Test262Error'); + }); }); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/of/argument-is-symbol-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/argument-is-symbol-throws.js index ced8ecb0c0..9dd99ec337 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/of/argument-is-symbol-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/argument-is-symbol-throws.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/TypedArrayConstructors/of/argument-number-value-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/argument-number-value-throws.js index 620165d5bb..0ab68585e8 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/of/argument-number-value-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/argument-number-value-throws.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/TypedArrayConstructors/of/custom-ctor-does-not-instantiate-ta-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/custom-ctor-does-not-instantiate-ta-throws.js index 8e6695a8ec..a754ab0d71 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/of/custom-ctor-does-not-instantiate-ta-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/custom-ctor-does-not-instantiate-ta-throws.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/TypedArrayConstructors/of/custom-ctor-returns-other-instance.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/custom-ctor-returns-other-instance.js index 965a569166..6520c8e33c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/of/custom-ctor-returns-other-instance.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/custom-ctor-returns-other-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/TypedArrayConstructors/of/custom-ctor-returns-smaller-instance-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/custom-ctor-returns-smaller-instance-throws.js index 28f5cda441..25e854b154 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/of/custom-ctor-returns-smaller-instance-throws.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/custom-ctor-returns-smaller-instance-throws.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/TypedArrayConstructors/of/custom-ctor.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/custom-ctor.js index 7599583a84..5b390b9a39 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/of/custom-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/custom-ctor.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/TypedArrayConstructors/of/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/inherited.js index 99f528b8a8..f96b15993e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/of/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/inherited.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/TypedArrayConstructors/of/invoked-as-func.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/invoked-as-func.js index ed3b8c02e9..c32c99c58d 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/of/invoked-as-func.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/invoked-as-func.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/TypedArrayConstructors/of/nan-conversion.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/nan-conversion.js index 9c897d862e..c09ef9288c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/of/nan-conversion.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/nan-conversion.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/TypedArrayConstructors/of/new-instance-empty.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/new-instance-empty.js index d6ee42b662..35f7924cfa 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/of/new-instance-empty.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/new-instance-empty.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/TypedArrayConstructors/of/new-instance-from-zero.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/new-instance-from-zero.js index b5f5a0f933..2918d776c2 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/of/new-instance-from-zero.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/new-instance-from-zero.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/TypedArrayConstructors/of/new-instance-using-custom-ctor.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/new-instance-using-custom-ctor.js index f806a5b711..f926f92984 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/of/new-instance-using-custom-ctor.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/new-instance-using-custom-ctor.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/TypedArrayConstructors/of/new-instance.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/new-instance.js index 3ae4eed98a..7d96be8f69 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/of/new-instance.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/new-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/TypedArrayConstructors/of/this-is-not-constructor.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/this-is-not-constructor.js index 16e1765df3..03ad2de279 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/of/this-is-not-constructor.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/of/this-is-not-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/TypedArrayConstructors/prototype/Symbol.iterator.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/Symbol.iterator.js index 6e2f2b41e3..315c53fb91 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/Symbol.iterator.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/Symbol.iterator.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/TypedArrayConstructors/prototype/Symbol.toStringTag/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/Symbol.toStringTag/inherited.js index d60d3c4b7d..65c4c92174 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/Symbol.toStringTag/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/Symbol.toStringTag/inherited.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/TypedArrayConstructors/prototype/buffer/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/buffer/inherited.js index 00fdd19d1b..0c8d5af8fa 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/buffer/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/buffer/inherited.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/TypedArrayConstructors/prototype/byteLength/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/byteLength/inherited.js index 67aa9848a0..82b3228e56 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/byteLength/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/byteLength/inherited.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/TypedArrayConstructors/prototype/byteOffset/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/byteOffset/inherited.js index 874d4abd88..44276ab6f9 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/byteOffset/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/byteOffset/inherited.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/TypedArrayConstructors/prototype/copyWithin/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/copyWithin/inherited.js index e831c04e99..8fc3dd290f 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/copyWithin/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/copyWithin/inherited.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/TypedArrayConstructors/prototype/entries/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/entries/inherited.js index 217462a687..bfda9c1389 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/entries/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/entries/inherited.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/TypedArrayConstructors/prototype/every/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/every/inherited.js index b61168bd9e..cf97c1c576 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/every/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/every/inherited.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/TypedArrayConstructors/prototype/fill/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/fill/inherited.js index 0a01168f76..a7cd2bda73 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/fill/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/fill/inherited.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/TypedArrayConstructors/prototype/filter/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/filter/inherited.js index 42c177812e..30adb66b63 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/filter/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/filter/inherited.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/TypedArrayConstructors/prototype/find/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/find/inherited.js index 1895450c9a..13ca9c7717 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/find/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/find/inherited.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/TypedArrayConstructors/prototype/findIndex/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/findIndex/inherited.js index 902a419db4..96fbfb2fae 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/findIndex/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/findIndex/inherited.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/TypedArrayConstructors/prototype/forEach/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/forEach/inherited.js index bead9ffae5..fb262d80de 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/forEach/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/forEach/inherited.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/TypedArrayConstructors/prototype/indexOf/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/indexOf/inherited.js index 398ba4e107..c8088e1f5a 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/indexOf/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/indexOf/inherited.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/TypedArrayConstructors/prototype/join/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/join/inherited.js index 37badbec58..813704926a 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/join/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/join/inherited.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/TypedArrayConstructors/prototype/keys/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/keys/inherited.js index a2c0289d1b..6f9b9cb196 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/keys/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/keys/inherited.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/TypedArrayConstructors/prototype/lastIndexOf/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/lastIndexOf/inherited.js index f9d7dd8626..57a0c14e0e 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/lastIndexOf/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/lastIndexOf/inherited.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/TypedArrayConstructors/prototype/length/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/length/inherited.js index e2b9ea33c3..3416fa6318 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/length/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/length/inherited.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/TypedArrayConstructors/prototype/map/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/map/inherited.js index 591322dfe3..c2561db8ce 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/map/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/map/inherited.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/TypedArrayConstructors/prototype/reduce/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/reduce/inherited.js index 758118a5d0..41236775b6 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/reduce/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/reduce/inherited.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/TypedArrayConstructors/prototype/reduceRight/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/reduceRight/inherited.js index 334b156c1e..9c9350e9a2 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/reduceRight/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/reduceRight/inherited.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/TypedArrayConstructors/prototype/reverse/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/reverse/inherited.js index e6758c7916..b1c65bd86b 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/reverse/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/reverse/inherited.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/TypedArrayConstructors/prototype/set/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/set/inherited.js index 90822be1b2..343587d6df 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/set/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/set/inherited.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/TypedArrayConstructors/prototype/slice/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/slice/inherited.js index 0c4578ee12..e17bf94f1f 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/slice/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/slice/inherited.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/TypedArrayConstructors/prototype/some/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/some/inherited.js index 74aefc5a0f..d593d6092c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/some/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/some/inherited.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/TypedArrayConstructors/prototype/sort/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/sort/inherited.js index e42774b2be..1fe3e87773 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/sort/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/sort/inherited.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/TypedArrayConstructors/prototype/subarray/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/subarray/inherited.js index 63609b2124..cf4190e361 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/subarray/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/subarray/inherited.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/TypedArrayConstructors/prototype/toLocaleString/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/toLocaleString/inherited.js index bd2d3caaf5..576e184ec7 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/toLocaleString/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/toLocaleString/inherited.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/TypedArrayConstructors/prototype/toString/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/toString/inherited.js index b79a9b7b20..77372394a1 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/toString/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/toString/inherited.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/TypedArrayConstructors/prototype/values/inherited.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/values/inherited.js index 0283231b6b..b3ea9119c3 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/values/inherited.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/prototype/values/inherited.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/WeakMap/length.js b/js/src/tests/test262/built-ins/WeakMap/length.js index e5bf7043e3..d398cfa909 100644 --- a/js/src/tests/test262/built-ins/WeakMap/length.js +++ b/js/src/tests/test262/built-ins/WeakMap/length.js @@ -7,10 +7,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(WeakMap.length, 0, 'The value of `WeakMap.length` is `0`'); - -verifyNotEnumerable(WeakMap, 'length'); -verifyNotWritable(WeakMap, 'length'); -verifyConfigurable(WeakMap, 'length'); +verifyProperty(WeakMap, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakMap/name.js b/js/src/tests/test262/built-ins/WeakMap/name.js index d7d4457efe..03bf8dc858 100644 --- a/js/src/tests/test262/built-ins/WeakMap/name.js +++ b/js/src/tests/test262/built-ins/WeakMap/name.js @@ -10,13 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue( - WeakMap.name, 'WeakMap', - 'The value of `WeakMap.name` is "WeakMap"' -); - -verifyNotEnumerable(WeakMap, 'name'); -verifyNotWritable(WeakMap, 'name'); -verifyConfigurable(WeakMap, 'name'); +verifyProperty(WeakMap, "name", { + value: "WeakMap", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakMap/prototype/delete/length.js b/js/src/tests/test262/built-ins/WeakMap/prototype/delete/length.js index bfdcaff706..768a17db21 100644 --- a/js/src/tests/test262/built-ins/WeakMap/prototype/delete/length.js +++ b/js/src/tests/test262/built-ins/WeakMap/prototype/delete/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - WeakMap.prototype.delete.length, 1, - 'The value of WeakMap.prototype.delete.length is 1' -); - -verifyNotEnumerable(WeakMap.prototype.delete, 'length'); -verifyNotWritable(WeakMap.prototype.delete, 'length'); -verifyConfigurable(WeakMap.prototype.delete, 'length'); +verifyProperty(WeakMap.prototype.delete, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakMap/prototype/delete/name.js b/js/src/tests/test262/built-ins/WeakMap/prototype/delete/name.js index 67bc4d2ee4..129943adcf 100644 --- a/js/src/tests/test262/built-ins/WeakMap/prototype/delete/name.js +++ b/js/src/tests/test262/built-ins/WeakMap/prototype/delete/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - WeakMap.prototype.delete.name, 'delete', - 'The value of WeakMap.prototype.delete.name is "delete"' -); - -verifyNotEnumerable(WeakMap.prototype.delete, 'name'); -verifyNotWritable(WeakMap.prototype.delete, 'name'); -verifyConfigurable(WeakMap.prototype.delete, 'name'); +verifyProperty(WeakMap.prototype.delete, "name", { + value: "delete", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakMap/prototype/delete/not-a-constructor.js b/js/src/tests/test262/built-ins/WeakMap/prototype/delete/not-a-constructor.js index 59136bd1ef..eb219ebd2f 100644 --- a/js/src/tests/test262/built-ins/WeakMap/prototype/delete/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/WeakMap/prototype/delete/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let wm = new WeakMap(); new wm.delete(); -}, '`let wm = new WeakMap(); new wm.delete()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakMap/prototype/get/length.js b/js/src/tests/test262/built-ins/WeakMap/prototype/get/length.js index eb8f7d546e..5b1f046fb7 100644 --- a/js/src/tests/test262/built-ins/WeakMap/prototype/get/length.js +++ b/js/src/tests/test262/built-ins/WeakMap/prototype/get/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - WeakMap.prototype.get.length, 1, - 'The value of `WeakMap.prototype.get.length` is `1`' -); - -verifyNotEnumerable(WeakMap.prototype.get, 'length'); -verifyNotWritable(WeakMap.prototype.get, 'length'); -verifyConfigurable(WeakMap.prototype.get, 'length'); +verifyProperty(WeakMap.prototype.get, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakMap/prototype/get/name.js b/js/src/tests/test262/built-ins/WeakMap/prototype/get/name.js index ce82cdb4e4..cd457ec7db 100644 --- a/js/src/tests/test262/built-ins/WeakMap/prototype/get/name.js +++ b/js/src/tests/test262/built-ins/WeakMap/prototype/get/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - WeakMap.prototype.get.name, 'get', - 'The value of `WeakMap.prototype.get.name` is `"get"`' -); - -verifyNotEnumerable(WeakMap.prototype.get, 'name'); -verifyNotWritable(WeakMap.prototype.get, 'name'); -verifyConfigurable(WeakMap.prototype.get, 'name'); +verifyProperty(WeakMap.prototype.get, "name", { + value: "get", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakMap/prototype/get/not-a-constructor.js b/js/src/tests/test262/built-ins/WeakMap/prototype/get/not-a-constructor.js index ec8be07522..5d4e7e6adc 100644 --- a/js/src/tests/test262/built-ins/WeakMap/prototype/get/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/WeakMap/prototype/get/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let wm = new WeakMap(); new wm.get(); -}, '`let wm = new WeakMap(); new wm.get()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakMap/prototype/has/length.js b/js/src/tests/test262/built-ins/WeakMap/prototype/has/length.js index a68fa8ecec..fab022f055 100644 --- a/js/src/tests/test262/built-ins/WeakMap/prototype/has/length.js +++ b/js/src/tests/test262/built-ins/WeakMap/prototype/has/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - WeakMap.prototype.has.length, 1, - 'The value of WeakMap.prototype.has.length is 1' -); - -verifyNotEnumerable(WeakMap.prototype.has, 'length'); -verifyNotWritable(WeakMap.prototype.has, 'length'); -verifyConfigurable(WeakMap.prototype.has, 'length'); +verifyProperty(WeakMap.prototype.has, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakMap/prototype/has/name.js b/js/src/tests/test262/built-ins/WeakMap/prototype/has/name.js index 558f24335d..15595af753 100644 --- a/js/src/tests/test262/built-ins/WeakMap/prototype/has/name.js +++ b/js/src/tests/test262/built-ins/WeakMap/prototype/has/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - WeakMap.prototype.has.name, 'has', - 'The value of WeakMap.prototype.has.name is "has"' -); - -verifyNotEnumerable(WeakMap.prototype.has, 'name'); -verifyNotWritable(WeakMap.prototype.has, 'name'); -verifyConfigurable(WeakMap.prototype.has, 'name'); +verifyProperty(WeakMap.prototype.has, "name", { + value: "has", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakMap/prototype/has/not-a-constructor.js b/js/src/tests/test262/built-ins/WeakMap/prototype/has/not-a-constructor.js index 83df17bbf5..ecdc3c7702 100644 --- a/js/src/tests/test262/built-ins/WeakMap/prototype/has/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/WeakMap/prototype/has/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let wm = new WeakMap(); new wm.has(); -}, '`let wm = new WeakMap(); new wm.has()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakMap/prototype/set/length.js b/js/src/tests/test262/built-ins/WeakMap/prototype/set/length.js index 052f181e53..1e5665313e 100644 --- a/js/src/tests/test262/built-ins/WeakMap/prototype/set/length.js +++ b/js/src/tests/test262/built-ins/WeakMap/prototype/set/length.js @@ -11,13 +11,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - WeakMap.prototype.set.length, 2, - 'The value of `WeakMap.prototype.set.length` is `2`' -); - -verifyNotEnumerable(WeakMap.prototype.set, 'length'); -verifyNotWritable(WeakMap.prototype.set, 'length'); -verifyConfigurable(WeakMap.prototype.set, 'length'); +verifyProperty(WeakMap.prototype.set, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakMap/prototype/set/name.js b/js/src/tests/test262/built-ins/WeakMap/prototype/set/name.js index f1d62ffef5..b30a386faa 100644 --- a/js/src/tests/test262/built-ins/WeakMap/prototype/set/name.js +++ b/js/src/tests/test262/built-ins/WeakMap/prototype/set/name.js @@ -11,13 +11,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - WeakMap.prototype.set.name, 'set', - 'The value of WeakMap.prototype.set.name is "set"' -); - -verifyNotEnumerable(WeakMap.prototype.set, 'name'); -verifyNotWritable(WeakMap.prototype.set, 'name'); -verifyConfigurable(WeakMap.prototype.set, 'name'); +verifyProperty(WeakMap.prototype.set, "name", { + value: "set", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakMap/prototype/set/not-a-constructor.js b/js/src/tests/test262/built-ins/WeakMap/prototype/set/not-a-constructor.js index c8d6272217..b3e89c04d1 100644 --- a/js/src/tests/test262/built-ins/WeakMap/prototype/set/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/WeakMap/prototype/set/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let wm = new WeakMap(); new wm.set({}, 1); -}, '`let wm = new WeakMap(); new wm.set({}, 1)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakRef/prototype/deref/not-a-constructor.js b/js/src/tests/test262/built-ins/WeakRef/prototype/deref/not-a-constructor.js index 9a97911843..0e5e245076 100644 --- a/js/src/tests/test262/built-ins/WeakRef/prototype/deref/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/WeakRef/prototype/deref/not-a-constructor.js @@ -30,7 +30,7 @@ assert.sameValue( assert.throws(TypeError, () => { let wr = new WeakRef({}); new wr.deref(); -}, '`let wr = new WeakRef({}); new wr.deref()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakSet/length.js b/js/src/tests/test262/built-ins/WeakSet/length.js index a34c33236d..606922e0de 100644 --- a/js/src/tests/test262/built-ins/WeakSet/length.js +++ b/js/src/tests/test262/built-ins/WeakSet/length.js @@ -7,10 +7,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(WeakSet.length, 0, 'The value of `WeakSet.length` is `0`'); - -verifyNotEnumerable(WeakSet, 'length'); -verifyNotWritable(WeakSet, 'length'); -verifyConfigurable(WeakSet, 'length'); +verifyProperty(WeakSet, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakSet/name.js b/js/src/tests/test262/built-ins/WeakSet/name.js index dedd6f4fd0..331b94e501 100644 --- a/js/src/tests/test262/built-ins/WeakSet/name.js +++ b/js/src/tests/test262/built-ins/WeakSet/name.js @@ -10,13 +10,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue( - WeakSet.name, 'WeakSet', - 'The value of `WeakSet.name` is "WeakSet"' -); - -verifyNotEnumerable(WeakSet, 'name'); -verifyNotWritable(WeakSet, 'name'); -verifyConfigurable(WeakSet, 'name'); +verifyProperty(WeakSet, "name", { + value: "WeakSet", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakSet/prototype/add/length.js b/js/src/tests/test262/built-ins/WeakSet/prototype/add/length.js index 7112319f12..f6b1312673 100644 --- a/js/src/tests/test262/built-ins/WeakSet/prototype/add/length.js +++ b/js/src/tests/test262/built-ins/WeakSet/prototype/add/length.js @@ -11,13 +11,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - WeakSet.prototype.add.length, 1, - 'The value of `WeakSet.prototype.add.length` is `1`' -); - -verifyNotEnumerable(WeakSet.prototype.add, 'length'); -verifyNotWritable(WeakSet.prototype.add, 'length'); -verifyConfigurable(WeakSet.prototype.add, 'length'); +verifyProperty(WeakSet.prototype.add, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakSet/prototype/add/name.js b/js/src/tests/test262/built-ins/WeakSet/prototype/add/name.js index e81470dc1c..5383bbd19a 100644 --- a/js/src/tests/test262/built-ins/WeakSet/prototype/add/name.js +++ b/js/src/tests/test262/built-ins/WeakSet/prototype/add/name.js @@ -11,13 +11,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - WeakSet.prototype.add.name, 'add', - 'The value of WeakSet.prototype.add.name is "add"' -); - -verifyNotEnumerable(WeakSet.prototype.add, 'name'); -verifyNotWritable(WeakSet.prototype.add, 'name'); -verifyConfigurable(WeakSet.prototype.add, 'name'); +verifyProperty(WeakSet.prototype.add, "name", { + value: "add", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakSet/prototype/add/not-a-constructor.js b/js/src/tests/test262/built-ins/WeakSet/prototype/add/not-a-constructor.js index df2a033c51..3024ce6299 100644 --- a/js/src/tests/test262/built-ins/WeakSet/prototype/add/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/WeakSet/prototype/add/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let ws = new WeakSet(); new ws.add({}); -}, '`let ws = new WeakSet(); new ws.add({})` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakSet/prototype/delete/length.js b/js/src/tests/test262/built-ins/WeakSet/prototype/delete/length.js index 516b074855..63d20118fd 100644 --- a/js/src/tests/test262/built-ins/WeakSet/prototype/delete/length.js +++ b/js/src/tests/test262/built-ins/WeakSet/prototype/delete/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - WeakSet.prototype.delete.length, 1, - 'The value of WeakSet.prototype.delete.length is 1' -); - -verifyNotEnumerable(WeakSet.prototype.delete, 'length'); -verifyNotWritable(WeakSet.prototype.delete, 'length'); -verifyConfigurable(WeakSet.prototype.delete, 'length'); +verifyProperty(WeakSet.prototype.delete, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakSet/prototype/delete/name.js b/js/src/tests/test262/built-ins/WeakSet/prototype/delete/name.js index b759002e7c..da0d4f7fa3 100644 --- a/js/src/tests/test262/built-ins/WeakSet/prototype/delete/name.js +++ b/js/src/tests/test262/built-ins/WeakSet/prototype/delete/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - WeakSet.prototype.delete.name, 'delete', - 'The value of WeakSet.prototype.delete.name is "delete"' -); - -verifyNotEnumerable(WeakSet.prototype.delete, 'name'); -verifyNotWritable(WeakSet.prototype.delete, 'name'); -verifyConfigurable(WeakSet.prototype.delete, 'name'); +verifyProperty(WeakSet.prototype.delete, "name", { + value: "delete", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakSet/prototype/delete/not-a-constructor.js b/js/src/tests/test262/built-ins/WeakSet/prototype/delete/not-a-constructor.js index 3f5c5605d0..b12b0c07f9 100644 --- a/js/src/tests/test262/built-ins/WeakSet/prototype/delete/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/WeakSet/prototype/delete/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let ws = new WeakSet(); new ws.delete(); -}, '`let ws = new WeakSet(); new ws.delete()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakSet/prototype/has/length.js b/js/src/tests/test262/built-ins/WeakSet/prototype/has/length.js index 5e4176a5cc..cec3d5e3f0 100644 --- a/js/src/tests/test262/built-ins/WeakSet/prototype/has/length.js +++ b/js/src/tests/test262/built-ins/WeakSet/prototype/has/length.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - WeakSet.prototype.has.length, 1, - 'The value of WeakSet.prototype.has.length is 1' -); - -verifyNotEnumerable(WeakSet.prototype.has, 'length'); -verifyNotWritable(WeakSet.prototype.has, 'length'); -verifyConfigurable(WeakSet.prototype.has, 'length'); +verifyProperty(WeakSet.prototype.has, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakSet/prototype/has/name.js b/js/src/tests/test262/built-ins/WeakSet/prototype/has/name.js index 6fca676585..11c364e160 100644 --- a/js/src/tests/test262/built-ins/WeakSet/prototype/has/name.js +++ b/js/src/tests/test262/built-ins/WeakSet/prototype/has/name.js @@ -12,13 +12,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue( - WeakSet.prototype.has.name, 'has', - 'The value of WeakSet.prototype.has.name is "has"' -); - -verifyNotEnumerable(WeakSet.prototype.has, 'name'); -verifyNotWritable(WeakSet.prototype.has, 'name'); -verifyConfigurable(WeakSet.prototype.has, 'name'); +verifyProperty(WeakSet.prototype.has, "name", { + value: "has", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/WeakSet/prototype/has/not-a-constructor.js b/js/src/tests/test262/built-ins/WeakSet/prototype/has/not-a-constructor.js index b21d7cb36f..caff7da47f 100644 --- a/js/src/tests/test262/built-ins/WeakSet/prototype/has/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/WeakSet/prototype/has/not-a-constructor.js @@ -29,7 +29,7 @@ assert.sameValue( assert.throws(TypeError, () => { let ws = new WeakSet(); new ws.has(); -}, '`let ws = new WeakSet(); new ws.has()` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/decodeURI/name.js b/js/src/tests/test262/built-ins/decodeURI/name.js index 49e92af77d..c6b7c66784 100644 --- a/js/src/tests/test262/built-ins/decodeURI/name.js +++ b/js/src/tests/test262/built-ins/decodeURI/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(decodeURI.name, "decodeURI"); - -verifyNotEnumerable(decodeURI, "name"); -verifyNotWritable(decodeURI, "name"); -verifyConfigurable(decodeURI, "name"); +verifyProperty(decodeURI, "name", { + value: "decodeURI", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/decodeURI/not-a-constructor.js b/js/src/tests/test262/built-ins/decodeURI/not-a-constructor.js index 00a1e05e4c..8fb5c04771 100644 --- a/js/src/tests/test262/built-ins/decodeURI/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/decodeURI/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(decodeURI), false, 'isConstructor(decodeURI) must assert.throws(TypeError, () => { new decodeURI(''); -}, '`new decodeURI(\'\')` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/decodeURIComponent/name.js b/js/src/tests/test262/built-ins/decodeURIComponent/name.js index 35d153a3e9..e52e079ece 100644 --- a/js/src/tests/test262/built-ins/decodeURIComponent/name.js +++ b/js/src/tests/test262/built-ins/decodeURIComponent/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(decodeURIComponent.name, "decodeURIComponent"); - -verifyNotEnumerable(decodeURIComponent, "name"); -verifyNotWritable(decodeURIComponent, "name"); -verifyConfigurable(decodeURIComponent, "name"); +verifyProperty(decodeURIComponent, "name", { + value: "decodeURIComponent", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/decodeURIComponent/not-a-constructor.js b/js/src/tests/test262/built-ins/decodeURIComponent/not-a-constructor.js index dcb99027df..d3a4a2ba4c 100644 --- a/js/src/tests/test262/built-ins/decodeURIComponent/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/decodeURIComponent/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(decodeURIComponent), false, 'isConstructor(decode assert.throws(TypeError, () => { new decodeURIComponent(''); -}, '`new decodeURIComponent(\'\')` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/encodeURI/name.js b/js/src/tests/test262/built-ins/encodeURI/name.js index efb7966e6f..21fe9e4f03 100644 --- a/js/src/tests/test262/built-ins/encodeURI/name.js +++ b/js/src/tests/test262/built-ins/encodeURI/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(encodeURI.name, "encodeURI"); - -verifyNotEnumerable(encodeURI, "name"); -verifyNotWritable(encodeURI, "name"); -verifyConfigurable(encodeURI, "name"); +verifyProperty(encodeURI, "name", { + value: "encodeURI", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/encodeURI/not-a-constructor.js b/js/src/tests/test262/built-ins/encodeURI/not-a-constructor.js index fa9ab49cf7..a5b50f3570 100644 --- a/js/src/tests/test262/built-ins/encodeURI/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/encodeURI/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(encodeURI), false, 'isConstructor(encodeURI) must assert.throws(TypeError, () => { new encodeURI(''); -}, '`new encodeURI(\'\')` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/encodeURIComponent/name.js b/js/src/tests/test262/built-ins/encodeURIComponent/name.js index 6d3594e181..7a65df4c55 100644 --- a/js/src/tests/test262/built-ins/encodeURIComponent/name.js +++ b/js/src/tests/test262/built-ins/encodeURIComponent/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(encodeURIComponent.name, "encodeURIComponent"); - -verifyNotEnumerable(encodeURIComponent, "name"); -verifyNotWritable(encodeURIComponent, "name"); -verifyConfigurable(encodeURIComponent, "name"); +verifyProperty(encodeURIComponent, "name", { + value: "encodeURIComponent", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/encodeURIComponent/not-a-constructor.js b/js/src/tests/test262/built-ins/encodeURIComponent/not-a-constructor.js index 28030608a2..6bc60833b6 100644 --- a/js/src/tests/test262/built-ins/encodeURIComponent/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/encodeURIComponent/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(encodeURIComponent), false, 'isConstructor(encode assert.throws(TypeError, () => { new encodeURIComponent(''); -}, '`new encodeURIComponent(\'\')` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/eval/name.js b/js/src/tests/test262/built-ins/eval/name.js index c69687839b..09483a3dee 100644 --- a/js/src/tests/test262/built-ins/eval/name.js +++ b/js/src/tests/test262/built-ins/eval/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(eval.name, "eval"); - -verifyNotEnumerable(eval, "name"); -verifyNotWritable(eval, "name"); -verifyConfigurable(eval, "name"); +verifyProperty(eval, "name", { + value: "eval", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/eval/not-a-constructor.js b/js/src/tests/test262/built-ins/eval/not-a-constructor.js index e55f74de38..7cf21ad5bd 100644 --- a/js/src/tests/test262/built-ins/eval/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/eval/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(eval), false, 'isConstructor(eval) must return fa assert.throws(TypeError, () => { new eval(''); -}, '`new eval(\'\')` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/isFinite/length.js b/js/src/tests/test262/built-ins/isFinite/length.js index 6d18559474..5b35b88496 100644 --- a/js/src/tests/test262/built-ins/isFinite/length.js +++ b/js/src/tests/test262/built-ins/isFinite/length.js @@ -8,10 +8,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(isFinite.length, 1, "The value of `isFinite.length` is `1`"); - -verifyNotEnumerable(isFinite, "length"); -verifyNotWritable(isFinite, "length"); -verifyConfigurable(isFinite, "length"); +verifyProperty(isFinite, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/isFinite/name.js b/js/src/tests/test262/built-ins/isFinite/name.js index 46da43f25c..0f4b4ad420 100644 --- a/js/src/tests/test262/built-ins/isFinite/name.js +++ b/js/src/tests/test262/built-ins/isFinite/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(isFinite.name, "isFinite"); - -verifyNotEnumerable(isFinite, "name"); -verifyNotWritable(isFinite, "name"); -verifyConfigurable(isFinite, "name"); +verifyProperty(isFinite, "name", { + value: "isFinite", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/isFinite/not-a-constructor.js b/js/src/tests/test262/built-ins/isFinite/not-a-constructor.js index 465d6f20e5..246ae5391f 100644 --- a/js/src/tests/test262/built-ins/isFinite/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/isFinite/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(isFinite), false, 'isConstructor(isFinite) must r assert.throws(TypeError, () => { new isFinite(1); -}, '`new isFinite(1)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/isNaN/length.js b/js/src/tests/test262/built-ins/isNaN/length.js index 01e06d1602..f323904d00 100644 --- a/js/src/tests/test262/built-ins/isNaN/length.js +++ b/js/src/tests/test262/built-ins/isNaN/length.js @@ -8,10 +8,11 @@ description: > includes: [propertyHelper.js] ---*/ -assert.sameValue(isNaN.length, 1, "The value of `isNaN.length` is `1`"); - -verifyNotEnumerable(isNaN, "length"); -verifyNotWritable(isNaN, "length"); -verifyConfigurable(isNaN, "length"); +verifyProperty(isNaN, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/isNaN/name.js b/js/src/tests/test262/built-ins/isNaN/name.js index 967a74566e..515478acae 100644 --- a/js/src/tests/test262/built-ins/isNaN/name.js +++ b/js/src/tests/test262/built-ins/isNaN/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(isNaN.name, "isNaN"); - -verifyNotEnumerable(isNaN, "name"); -verifyNotWritable(isNaN, "name"); -verifyConfigurable(isNaN, "name"); +verifyProperty(isNaN, "name", { + value: "isNaN", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/isNaN/not-a-constructor.js b/js/src/tests/test262/built-ins/isNaN/not-a-constructor.js index 840489d16b..ca7970390e 100644 --- a/js/src/tests/test262/built-ins/isNaN/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/isNaN/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(isNaN), false, 'isConstructor(isNaN) must return assert.throws(TypeError, () => { new isNaN(1); -}, '`new isNaN(1)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/parseFloat/name.js b/js/src/tests/test262/built-ins/parseFloat/name.js index 05b701e234..75df364955 100644 --- a/js/src/tests/test262/built-ins/parseFloat/name.js +++ b/js/src/tests/test262/built-ins/parseFloat/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(parseFloat.name, "parseFloat"); - -verifyNotEnumerable(parseFloat, "name"); -verifyNotWritable(parseFloat, "name"); -verifyConfigurable(parseFloat, "name"); +verifyProperty(parseFloat, "name", { + value: "parseFloat", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/parseFloat/not-a-constructor.js b/js/src/tests/test262/built-ins/parseFloat/not-a-constructor.js index 4bbe63515e..ffab5bc31c 100644 --- a/js/src/tests/test262/built-ins/parseFloat/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/parseFloat/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(parseFloat), false, 'isConstructor(parseFloat) mu assert.throws(TypeError, () => { new parseFloat(1); -}, '`new parseFloat(1)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/parseInt/name.js b/js/src/tests/test262/built-ins/parseInt/name.js index 973b0707da..3d0fc3e513 100644 --- a/js/src/tests/test262/built-ins/parseInt/name.js +++ b/js/src/tests/test262/built-ins/parseInt/name.js @@ -19,10 +19,11 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(parseInt.name, "parseInt", 'The value of parseInt.name is "parseInt"'); - -verifyNotEnumerable(parseInt, "name"); -verifyNotWritable(parseInt, "name"); -verifyConfigurable(parseInt, "name"); +verifyProperty(parseInt, "name", { + value: "parseInt", + writable: false, + enumerable: false, + configurable: true +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/parseInt/not-a-constructor.js b/js/src/tests/test262/built-ins/parseInt/not-a-constructor.js index db318e6a34..9bb720d6c0 100644 --- a/js/src/tests/test262/built-ins/parseInt/not-a-constructor.js +++ b/js/src/tests/test262/built-ins/parseInt/not-a-constructor.js @@ -25,7 +25,7 @@ assert.sameValue(isConstructor(parseInt), false, 'isConstructor(parseInt) must r assert.throws(TypeError, () => { new parseInt(1); -}, '`new parseInt(1)` throws TypeError'); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/harness/shell.js b/js/src/tests/test262/harness/shell.js index 4e6994c9d3..37ca8bb807 100644 --- a/js/src/tests/test262/harness/shell.js +++ b/js/src/tests/test262/harness/shell.js @@ -193,7 +193,22 @@ var byteConversionValues = { -4294967296, // - ( 2 ** 32 ) Infinity, -Infinity, - 0 + 0, + 2049, // an integer which rounds down under ties-to-even when cast to float16 + 2051, // an integer which rounds up under ties-to-even when cast to float16 + 0.00006103515625, // smallest normal float16 + 0.00006097555160522461, // largest subnormal float16 + 5.960464477539063e-8, // smallest float16 + 2.9802322387695312e-8, // largest double which rounds to 0 when cast to float16 + 2.980232238769532e-8, // smallest double which does not round to 0 when cast to float16 + 8.940696716308594e-8, // a double which rounds up to a subnormal under ties-to-even when cast to float16 + 1.4901161193847656e-7, // a double which rounds down to a subnormal under ties-to-even when cast to float16 + 1.490116119384766e-7, // the next double above the one on the previous line one + 65504, // max finite float16 + 65520, // smallest double which rounds to infinity when cast to float16 + 65519.99999999999, // largest double which does not round to infinity when cast to float16 + 0.000061005353927612305, // smallest double which rounds to a non-subnormal when cast to float16 + 0.0000610053539276123 // largest double which rounds to a subnormal when cast to float16 ], expected: { @@ -238,7 +253,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 1, // 2049 + 3, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + -32, // 65504 + -16, // 65520 + -17, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint8: [ 127, // 127 @@ -281,7 +311,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 1, // 2049 + 3, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 224, // 65504 + 240, // 65520 + 239, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint8Clamped: [ 127, // 127 @@ -324,7 +369,22 @@ var byteConversionValues = { 0, // -4294967296 255, // Infinity 0, // -Infinity - 0 + 0, // 0 + 255, // 2049 + 255, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 255, // 65504 + 255, // 65520 + 255, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Int16: [ 127, // 127 @@ -367,7 +427,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + -32, // 65504 + -16, // 65520 + -17, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint16: [ 127, // 127 @@ -410,7 +485,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Int32: [ 127, // 127 @@ -453,7 +543,22 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Uint32: [ 127, // 127 @@ -496,93 +601,138 @@ var byteConversionValues = { 0, // -4294967296 0, // Infinity 0, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0, // 0.00006103515625 + 0, // 0.00006097555160522461 + 0, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 0, // 2.980232238769532e-8 + 0, // 8.940696716308594e-8 + 0, // 1.4901161193847656e-7 + 0, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519, // 65519.99999999999 + 0, // 0.000061005353927612305 + 0 // 0.0000610053539276123 ], Float16: [ - 127, // 127 - 128, // 128 - 32768, // 32767 - 32768, // 32768 - Infinity, // 2147483647 - Infinity, // 2147483648 - 255, // 255 - 256, // 256 - Infinity, // 65535 - Infinity, // 65536 - Infinity, // 4294967295 - Infinity, // 4294967296 - Infinity, // 9007199254740991 - Infinity, // 9007199254740992 - 1.099609375, // 1.1 - 0.0999755859375, // 0.1 - 0.5, // 0.5 - 0.5, // 0.50000001, - 0.60009765625, // 0.6 - 0.7001953125, // 0.7 - NaN, // undefined - -1, // -1 - -0, // -0 - -0.0999755859375, // -0.1 - -1.099609375, // -1.1 - NaN, // NaN - -127, // -127 - -128, // -128 - -32768, // -32767 - -32768, // -32768 - -Infinity, // -2147483647 - -Infinity, // -2147483648 - -255, // -255 - -256, // -256 - -Infinity, // -65535 - -Infinity, // -65536 - -Infinity, // -4294967295 - -Infinity, // -4294967296 - Infinity, // Infinity - -Infinity, // -Infinity - 0 + 127, // 127 + 128, // 128 + 32768, // 32767 + 32768, // 32768 + Infinity, // 2147483647 + Infinity, // 2147483648 + 255, // 255 + 256, // 256 + Infinity, // 65535 + Infinity, // 65536 + Infinity, // 4294967295 + Infinity, // 4294967296 + Infinity, // 9007199254740991 + Infinity, // 9007199254740992 + 1.099609375, // 1.1 + 0.0999755859375, // 0.1 + 0.5, // 0.5 + 0.5, // 0.50000001, + 0.60009765625, // 0.6 + 0.7001953125, // 0.7 + NaN, // undefined + -1, // -1 + -0, // -0 + -0.0999755859375, // -0.1 + -1.099609375, // -1.1 + NaN, // NaN + -127, // -127 + -128, // -128 + -32768, // -32767 + -32768, // -32768 + -Infinity, // -2147483647 + -Infinity, // -2147483648 + -255, // -255 + -256, // -256 + -Infinity, // -65535 + -Infinity, // -65536 + -Infinity, // -4294967295 + -Infinity, // -4294967296 + Infinity, // Infinity + -Infinity, // -Infinity + 0, // 0 + 2048, // 2049 + 2052, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 0, // 2.9802322387695312e-8 + 5.960464477539063e-8, // 2.980232238769532e-8 + 1.1920928955078125e-7, // 8.940696716308594e-8 + 1.1920928955078125e-7, // 1.4901161193847656e-7 + 1.7881393432617188e-7, // 1.490116119384766e-7 + 65504, // 65504 + Infinity, // 65520 + 65504, // 65519.99999999999 + 0.00006103515625, // 0.000061005353927612305 + 0.00006097555160522461 // 0.0000610053539276123 ], Float32: [ - 127, // 127 - 128, // 128 - 32767, // 32767 - 32768, // 32768 - 2147483648, // 2147483647 - 2147483648, // 2147483648 - 255, // 255 - 256, // 256 - 65535, // 65535 - 65536, // 65536 - 4294967296, // 4294967295 - 4294967296, // 4294967296 - 9007199254740992, // 9007199254740991 - 9007199254740992, // 9007199254740992 - 1.100000023841858, // 1.1 - 0.10000000149011612, // 0.1 - 0.5, // 0.5 - 0.5, // 0.50000001, - 0.6000000238418579, // 0.6 - 0.699999988079071, // 0.7 - NaN, // undefined - -1, // -1 - -0, // -0 - -0.10000000149011612, // -0.1 - -1.100000023841858, // -1.1 - NaN, // NaN - -127, // -127 - -128, // -128 - -32767, // -32767 - -32768, // -32768 - -2147483648, // -2147483647 - -2147483648, // -2147483648 - -255, // -255 - -256, // -256 - -65535, // -65535 - -65536, // -65536 - -4294967296, // -4294967295 - -4294967296, // -4294967296 - Infinity, // Infinity - -Infinity, // -Infinity - 0 + 127, // 127 + 128, // 128 + 32767, // 32767 + 32768, // 32768 + 2147483648, // 2147483647 + 2147483648, // 2147483648 + 255, // 255 + 256, // 256 + 65535, // 65535 + 65536, // 65536 + 4294967296, // 4294967295 + 4294967296, // 4294967296 + 9007199254740992, // 9007199254740991 + 9007199254740992, // 9007199254740992 + 1.100000023841858, // 1.1 + 0.10000000149011612, // 0.1 + 0.5, // 0.5 + 0.5, // 0.50000001, + 0.6000000238418579, // 0.6 + 0.699999988079071, // 0.7 + NaN, // undefined + -1, // -1 + -0, // -0 + -0.10000000149011612, // -0.1 + -1.100000023841858, // -1.1 + NaN, // NaN + -127, // -127 + -128, // -128 + -32767, // -32767 + -32768, // -32768 + -2147483648, // -2147483647 + -2147483648, // -2147483648 + -255, // -255 + -256, // -256 + -65535, // -65535 + -65536, // -65536 + -4294967296, // -4294967295 + -4294967296, // -4294967296 + Infinity, // Infinity + -Infinity, // -Infinity + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 2.9802322387695312e-8, // 2.9802322387695312e-8 + 2.9802322387695312e-8, // 2.980232238769532e-8 + 8.940696716308594e-8, // 8.940696716308594e-8 + 1.4901161193847656e-7, // 1.4901161193847656e-7 + 1.4901161193847656e-7, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65520, // 65519.99999999999 + 0.000061005353927612305, // 0.000061005353927612305 + 0.000061005353927612305 // 0.0000610053539276123 ], Float64: [ 127, // 127 @@ -625,7 +775,22 @@ var byteConversionValues = { -4294967296, // -4294967296 Infinity, // Infinity -Infinity, // -Infinity - 0 + 0, // 0 + 2049, // 2049 + 2051, // 2051 + 0.00006103515625, // 0.00006103515625 + 0.00006097555160522461, // 0.00006097555160522461 + 5.960464477539063e-8, // 5.960464477539063e-8 + 2.9802322387695312e-8, // 2.9802322387695312e-8 + 2.980232238769532e-8, // 2.980232238769532e-8 + 8.940696716308594e-8, // 8.940696716308594e-8 + 1.4901161193847656e-7, // 1.4901161193847656e-7 + 1.490116119384766e-7, // 1.490116119384766e-7 + 65504, // 65504 + 65520, // 65520 + 65519.99999999999, // 65519.99999999999 + 0.000061005353927612305, // 0.000061005353927612305 + 0.0000610053539276123 // 0.0000610053539276123 ] } }; @@ -3469,6 +3634,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]", ]; }, @@ -3556,6 +3724,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/harness/testTypedArray-conversions-call-error.js b/js/src/tests/test262/harness/testTypedArray-conversions-call-error.js index 6d22f1460c..03e00213bd 100644 --- a/js/src/tests/test262/harness/testTypedArray-conversions-call-error.js +++ b/js/src/tests/test262/harness/testTypedArray-conversions-call-error.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (c) 2017 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/harness/testTypedArray-conversions.js b/js/src/tests/test262/harness/testTypedArray-conversions.js index 3af4b6a528..3642078e25 100644 --- a/js/src/tests/test262/harness/testTypedArray-conversions.js +++ b/js/src/tests/test262/harness/testTypedArray-conversions.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (c) 2017 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/harness/testTypedArray.js b/js/src/tests/test262/harness/testTypedArray.js index 1c7bfb7303..432f0d67d1 100644 --- a/js/src/tests/test262/harness/testTypedArray.js +++ b/js/src/tests/test262/harness/testTypedArray.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (c) 2017 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- diff --git a/js/src/tests/test262/intl402/DateTimeFormat/prototype/format/dayPeriod-long-en.js b/js/src/tests/test262/intl402/DateTimeFormat/prototype/format/dayPeriod-long-en.js index 13b8f374b3..0e6761b04a 100644 --- a/js/src/tests/test262/intl402/DateTimeFormat/prototype/format/dayPeriod-long-en.js +++ b/js/src/tests/test262/intl402/DateTimeFormat/prototype/format/dayPeriod-long-en.js @@ -5,7 +5,7 @@ esid: sec-createdatetimeformat description: Checks basic handling of dayPeriod, long format. features: [Intl.DateTimeFormat-dayPeriod] -locale: [en-US] +locale: [en] ---*/ const d0000 = new Date(2017, 11, 12, 0, 0, 0, 0); diff --git a/js/src/tests/test262/intl402/DateTimeFormat/prototype/format/dayPeriod-narrow-en.js b/js/src/tests/test262/intl402/DateTimeFormat/prototype/format/dayPeriod-narrow-en.js index 4d26a5131d..986ff1f157 100644 --- a/js/src/tests/test262/intl402/DateTimeFormat/prototype/format/dayPeriod-narrow-en.js +++ b/js/src/tests/test262/intl402/DateTimeFormat/prototype/format/dayPeriod-narrow-en.js @@ -5,7 +5,7 @@ esid: sec-createdatetimeformat description: Checks basic handling of dayPeriod, narrow format. features: [Intl.DateTimeFormat-dayPeriod] -locale: [en-US] +locale: [en] ---*/ const d0000 = new Date(2017, 11, 12, 0, 0, 0, 0); diff --git a/js/src/tests/test262/intl402/DateTimeFormat/prototype/format/dayPeriod-short-en.js b/js/src/tests/test262/intl402/DateTimeFormat/prototype/format/dayPeriod-short-en.js index f7b410f24d..dec193c396 100644 --- a/js/src/tests/test262/intl402/DateTimeFormat/prototype/format/dayPeriod-short-en.js +++ b/js/src/tests/test262/intl402/DateTimeFormat/prototype/format/dayPeriod-short-en.js @@ -5,7 +5,7 @@ esid: sec-initializedatetimeformat description: Checks basic handling of dayPeriod, short format. features: [Intl.DateTimeFormat-dayPeriod] -locale: [en-US] +locale: [en] ---*/ const d0000 = new Date(2017, 11, 12, 0, 0, 0, 0); diff --git a/js/src/tests/test262/intl402/DateTimeFormat/prototype/format/fractionalSecondDigits.js b/js/src/tests/test262/intl402/DateTimeFormat/prototype/format/fractionalSecondDigits.js index 25af5ada6d..49218a3b39 100644 --- a/js/src/tests/test262/intl402/DateTimeFormat/prototype/format/fractionalSecondDigits.js +++ b/js/src/tests/test262/intl402/DateTimeFormat/prototype/format/fractionalSecondDigits.js @@ -5,7 +5,7 @@ esid: sec-createdatetimeformat description: Checks basic handling of fractionalSecondDigits. features: [Intl.DateTimeFormat-fractionalSecondDigits] -locale: [en-US] +locale: [en] ---*/ const d1 = new Date(2019, 7, 10, 1, 2, 3, 234); diff --git a/js/src/tests/test262/intl402/DateTimeFormat/prototype/formatToParts/fractionalSecondDigits.js b/js/src/tests/test262/intl402/DateTimeFormat/prototype/formatToParts/fractionalSecondDigits.js index 543dfb2274..046084493c 100644 --- a/js/src/tests/test262/intl402/DateTimeFormat/prototype/formatToParts/fractionalSecondDigits.js +++ b/js/src/tests/test262/intl402/DateTimeFormat/prototype/formatToParts/fractionalSecondDigits.js @@ -5,7 +5,7 @@ esid: sec-createdatetimeformat description: Checks basic handling of fractionalSecondDigits. features: [Intl.DateTimeFormat-fractionalSecondDigits] -locale: [en-US] +locale: [en] ---*/ const d1 = new Date(2019, 7, 10, 1, 2, 3, 234); diff --git a/js/src/tests/test262/intl402/DateTimeFormat/prototype/resolvedOptions/hourCycle-default.js b/js/src/tests/test262/intl402/DateTimeFormat/prototype/resolvedOptions/hourCycle-default.js index 9063e045a6..c2cccd826c 100644 --- a/js/src/tests/test262/intl402/DateTimeFormat/prototype/resolvedOptions/hourCycle-default.js +++ b/js/src/tests/test262/intl402/DateTimeFormat/prototype/resolvedOptions/hourCycle-default.js @@ -21,27 +21,35 @@ info: | c. If hc is null, set hc to dataLocaleData.[[hourCycle]]. 27. Set dateTimeFormat.[[HourCycle]] to hc. -locale: [en, fr, it, ja, zh, ko, ar, hi, en-u-hc-h24] +locale: [en, fr, it, ja, zh, ko, ar, hi] ---*/ -let locales = ["en", "fr", "it", "ja", "ja-u-hc-h11", "zh", "ko", "ar", "hi", "en-u-hc-h24"]; +let locales = ["en", "fr", "it", "ja", "zh", "ko", "ar", "hi"]; -locales.forEach(function(locale) { - let hcDefault = new Intl.DateTimeFormat(locale, { hour: "numeric" }).resolvedOptions().hourCycle; - if (hcDefault === "h11" || hcDefault === "h12") { - assert.sameValue(new Intl.DateTimeFormat(locale, { hour: "numeric", hour12: true }).resolvedOptions().hourCycle, hcDefault); +for (let locale of locales) { + let hcDefault = new Intl.DateTimeFormat(locale, {hour: "numeric"}).resolvedOptions().hourCycle; + assert( + hcDefault === "h11" || hcDefault === "h12" || hcDefault === "h23" || hcDefault === "h24", + "hcDefault is one of [h11, h12, h23, h24]" + ); - // no locale has "h24" as a default. see https://github.com/tc39/ecma402/pull/758#issue-1622377292 - assert.sameValue(new Intl.DateTimeFormat(locale, { hour: "numeric", hour12: false }).resolvedOptions().hourCycle, "h23"); - } + let hour12 = new Intl.DateTimeFormat(locale, {hour: "numeric", hour12: true}).resolvedOptions().hourCycle; + assert(hour12 === "h11" || hour12 === "h12", "hour12 is one of [h11, h12]"); + + let hour24 = new Intl.DateTimeFormat(locale, {hour: "numeric", hour12: false}).resolvedOptions().hourCycle; + assert(hour24 === "h23" || hour24 === "h24", "hour24 is one of [h23, h24]"); - // however, "h24" can be set via locale extension. - if (hcDefault === "h23" || hcDefault === "h24") { - assert.sameValue(new Intl.DateTimeFormat(locale, { hour: "numeric", hour12: false }).resolvedOptions().hourCycle, hcDefault); + if (hcDefault === "h11" || hcDefault === "h12") { + assert.sameValue(hour12, hcDefault, "hour12 matches hcDefault"); + } else { + assert.sameValue(hour24, hcDefault, "hour24 matches hcDefault"); } - let hcHour12 = new Intl.DateTimeFormat(locale, { hour: "numeric", hour12: true }).resolvedOptions().hourCycle; - assert(hcHour12 === "h11" || hcHour12 === "h12", "Expected `hourCycle`: " + hcHour12 + " to be in [\"h11\", \"h12\"]"); -}); + // 24-hour clock uses the "h23" format in all locales. + assert.sameValue(hour24, "h23"); + + // 12-hour clock uses the "h12" format in all locales except "ja". + assert.sameValue(hour12, locale === "ja" ? "h11" : "h12"); +} reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/DateTimeFormat/timezone-legacy-non-iana.js b/js/src/tests/test262/intl402/DateTimeFormat/timezone-legacy-non-iana.js new file mode 100644 index 0000000000..d99cf18df4 --- /dev/null +++ b/js/src/tests/test262/intl402/DateTimeFormat/timezone-legacy-non-iana.js @@ -0,0 +1,45 @@ +// Copyright (C) 2024 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-initializedatetimeformat +description: Only IANA time zone identifiers are allowed. +---*/ + +// List of non-IANA link names, copied from: +// https://github.com/unicode-org/icu/blob/main/icu4c/source/tools/tzcode/icuzones +const invalidTimeZones = [ + "ACT", + "AET", + "AGT", + "ART", + "AST", + "BET", + "BST", + "CAT", + "CNT", + "CST", + "CTT", + "EAT", + "ECT", + "IET", + "IST", + "JST", + "MIT", + "NET", + "NST", + "PLT", + "PNT", + "PRT", + "PST", + "SST", + "VST", +]; + +for (let timeZone of invalidTimeZones) { + assert.throws(RangeError, () => { + new Intl.DateTimeFormat(undefined, {timeZone}); + }, "Time zone: " + timeZone); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/DisplayNames/prototype/of/type-region-invalid.js b/js/src/tests/test262/intl402/DisplayNames/prototype/of/type-region-invalid.js index 0fcce4ac7e..3c5608d162 100644 --- a/js/src/tests/test262/intl402/DisplayNames/prototype/of/type-region-invalid.js +++ b/js/src/tests/test262/intl402/DisplayNames/prototype/of/type-region-invalid.js @@ -14,7 +14,7 @@ features: [Intl.DisplayNames] ---*/ // https://unicode.org/reports/tr35/#unicode_region_subtag -// unicode_region_subtag = (alpha{2} | digit{3}) ; +// unicode_region_subtag = (alpha{2} | digit{3}) ; var displayNames = new Intl.DisplayNames(undefined, {type: 'region'}); diff --git a/js/src/tests/test262/intl402/DurationFormat/constructor-unit-style-defaults.js b/js/src/tests/test262/intl402/DurationFormat/constructor-unit-style-defaults.js new file mode 100644 index 0000000000..93f54dcab4 --- /dev/null +++ b/js/src/tests/test262/intl402/DurationFormat/constructor-unit-style-defaults.js @@ -0,0 +1,34 @@ +// |reftest| skip -- Intl.DurationFormat is not supported +// Copyright 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.DurationFormat +description: Verifies that default style settings for units following units with "numeric" or "2-digit" style are honored. +info: | + GetDurationUnitOptions (unit, options, baseStyle, stylesList, digitalBase, prevStyle) + (...) + 3. If style is undefined, then + (...) + i. If prevStyle is "fractional", "numeric" or "2-digit", then + (...) + 2. Set style to "numeric". + (...) + 9. If prevStyle is "numeric" or "2-digit", then + (...) + b. If unit is "minutes" or "seconds", then + i. Set style to "2-digit". +features: [Intl.DurationFormat] +---*/ + +for (const numericLikeStyle of ["numeric", "2-digit"]){ + var opts = new Intl.DurationFormat([], {hours: numericLikeStyle}).resolvedOptions(); + + assert.sameValue(opts.minutes, "2-digit", `minutes default value should be '2-digit' when following any ${numericLikeStyle}-styled unit`); + assert.sameValue(opts.seconds, "2-digit", `seconds default value should be '2-digit' when following any ${numericLikeStyle}-styled unit`); + assert.sameValue(opts.milliseconds, "numeric", `milliseconds default value should be 'numeric' when following any ${numericLikeStyle}-styled unit`); + assert.sameValue(opts.microseconds, "numeric", `microseconds default value should be 'numeric' when following any ${numericLikeStyle}-styled unit`); + assert.sameValue(opts.nanoseconds, "numeric", `nanoseconds default value should be 'numeric' when following any ${numericLikeStyle}-styled unit`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/fractions-of-subsecond-units-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/fractions-of-subsecond-units-en.js new file mode 100644 index 0000000000..342fa613cf --- /dev/null +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/fractions-of-subsecond-units-en.js @@ -0,0 +1,65 @@ +// |reftest| skip -- Intl.DurationFormat is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.DurationFormat.prototype.format +description: Checks that fractional milliseconds and microseconds are formatted correctly when microseconds or nanoseconds are the first units with "numeric" style. +info: | + PartitionDurationFormatPattern ( durationFormat, duration ) + (...) + 9. + (...) + g. If unit is "seconds", "milliseconds", or "microseconds", then + i. If unit is "seconds", then + 1. Let nextStyle be durationFormat.[[MillisecondsStyle]]. + ii. Else if unit is "milliseconds", then + 1. Let nextStyle be durationFormat.[[MicrosecondsStyle]]. + iii. Else, + 1. Let nextStyle be durationFormat.[[NanosecondsStyle]]. + iv. If nextStyle is "fractional", then + 1. Set value to value + AddFractionalDigits(durationFormat, duration). + 2. If durationFormat.[[FractionalDigits]] is undefined, then + a. Let maximumFractionDigits be 9𝔽. + b. Let minimumFractionDigits be +0𝔽. + 3. Else, + a. Let maximumFractionDigits be 𝔽(durationFormat.[[FractionalDigits]]). + b. Let minimumFractionDigits be 𝔽(durationFormat.[[FractionalDigits]]). + 4. Perform ! CreateDataPropertyOrThrow(nfOpts, "maximumFractionDigits", maximumFractionDigits ). + 5. Perform ! CreateDataPropertyOrThrow(nfOpts, "minimumFractionDigits", minimumFractionDigits ). + 6. Perform ! CreateDataPropertyOrThrow(nfOpts, "roundingMode", "trunc"). + 7. Set done to true. + +locale: [en] +features: [Intl.DurationFormat] +---*/ + + +const locale = "en"; +const decimalSeparator = "."; + +let d = {seconds: 3, milliseconds: 444, microseconds: 55, nanoseconds: 6}; +let dfOpts = {microseconds: "numeric"}; + +let expectedList = []; +expectedList.push(new Intl.NumberFormat(locale, {style: "unit", unit: "second", unitDisplay: "short"}).format(d.seconds)); +expectedList.push(new Intl.NumberFormat(locale, {style: "unit", unit: "millisecond", unitDisplay: "short", minimumFractionDigits:0, maximumFractionDigits: 9}).format(d.milliseconds.toString() + decimalSeparator + d.microseconds.toString().padStart(3, '0') + d.nanoseconds.toString().padStart(3, '0'))); + +let expected = new Intl.ListFormat(locale, {style: "short"}).format(expectedList); +let actual = new Intl.DurationFormat(locale, dfOpts).format(d); + +// assert.sameValue(actual, expected, `DurationFormat output when microseconds first "numeric" unit`); + +dfOpts = {nanoseconds: "numeric"}; +expectedList = []; + +expectedList.push(new Intl.NumberFormat(locale, {style: "unit", unit: "second", unitDisplay: "short"}).format(d.seconds)); +expectedList.push(new Intl.NumberFormat(locale, {style: "unit", unit: "millisecond", unitDisplay: "short"}).format(d.milliseconds)); +expectedList.push(new Intl.NumberFormat(locale, {style: "unit", unit: "microsecond", unitDisplay: "short", minimumFractionDigits:0, maximumFractionDigits: 9}).format(d.microseconds.toString() + decimalSeparator + d.nanoseconds.toString().padStart(3, '0'))); + +expected = new Intl.ListFormat(locale, {style: "short"}).format(expectedList); +actual = new Intl.DurationFormat(locale, dfOpts).format(d); + +assert.sameValue(actual, expected, `DurationFormat output when nanoseconds first "numeric" unit`); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/mixed-non-numeric-styles-es.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/mixed-non-numeric-styles-es.js new file mode 100644 index 0000000000..33ec1a2776 --- /dev/null +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/mixed-non-numeric-styles-es.js @@ -0,0 +1,88 @@ +// |reftest| skip -- Intl.DurationFormat is not supported +// Copyright 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.DurationFormat.prototype.format +description: Test if format method formats duration correctly with mixed non-numeric settings for unit styles. Compares output from format method to output produced through using NumberFormat and ListFormat as used by DurationFormat. +info: | + PartitionDurationFormatPattern ( durationFormat, duration ) + ... + 9. While done is false, repeat for each row in Table 2 in table order, except the header row: + ... + k. If value is not 0 or display is not "auto" or displayRequired is "true", then + ... + v. If style is not "fractional", "numeric", or "2-digit", then + 1. Perform ! CreateDataPropertyOrThrow(nfOpts, "style", "unit"). + 2. Perform ! CreateDataPropertyOrThrow(nfOpts, "unit", numberFormatUnit). + 3. Perform ! CreateDataPropertyOrThrow(nfOpts, "unitDisplay", style). + ... + ix. Let parts be ! PartitionNumberPattern(nf, value). + ... + 14. Perform ! CreateDataPropertyOrThrow(lfOpts, "style", listStyle). + 15. Let lf be ! Construct(%ListFormat%, « durationFormat.[[Locale]], lfOpts »). + ... + 18. Let formatted be CreatePartsFromList(lf, strings). + +locale: [es] +features: [Intl.DurationFormat] +---*/ + +function formatDuration(locale, duration, dfOpts){ + let result = []; + for (const unit in duration){ + let nfUnit = unit.substring(0, unit.length - 1); + let nf = new Intl.NumberFormat(locale, {style: "unit", unit: nfUnit, unitDisplay: dfOpts[unit]}); + result.push(nf.format(duration[unit])); + } + + for (const baseStyle of ["long", "short", "narrow"]){ + let lf = new Intl.ListFormat(locale, {type: "unit", style: baseStyle}); + let expected = lf.format(result); + dfOpts.style = baseStyle; + let df = new Intl.DurationFormat(locale, dfOpts); + let actual = df.format(duration); + assert.sameValue(actual, expected); + } +} + +const duration = { + years: 1, + months: 2, + weeks: 3, + days: 0, + hours: 4, + minutes: 5, + seconds: 6, + milliseconds: 7, + microseconds: 8, + nanoseconds: 9, +}; + +const locale = "es"; + +formatDuration(locale, duration, { + years: "narrow", + months: "narrow", + weeks: "narrow", + days: "short", + hours: "short", + minutes: "short", + seconds: "long", + milliseconds: "long", + microseconds: "long", + nanoseconds: "narrow", }); + +formatDuration(locale, duration, { + years: "long", + months: "short", + weeks: "narrow", + days: "long", + hours: "short", + minutes: "narrow", + seconds: "long", + milliseconds: "short", + microseconds: "narrow", + nanoseconds: "long", }); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/mixed-short-and-numeric.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/mixed-short-and-numeric.js new file mode 100644 index 0000000000..19adbfbd47 --- /dev/null +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/mixed-short-and-numeric.js @@ -0,0 +1,37 @@ +// |reftest| skip -- Intl.DurationFormat is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.DurationFormat.prototype.format +description: Checks that durations containing a mixture of numericlike and non-numericlike styles are formatted using the "short" style when DurationFormat base style is *undefined*. +info: | + PartitionDurationFormatPattern ( durationFormat, duration ) + + 12. Let listStyle be durationFormat.[[Style]]. + (...) + 14. Perform ! CreateDataPropertyOrThrow(lfOpts, "style", listStyle). + +locale: [en] +features: [Intl.DurationFormat] +---*/ + +const locale = "en"; +const timeSeparator = ":"; + + +let d = {days: 5, hours: 1, minutes: 2, seconds: 3}; +let dfOpts = {minutes: "numeric", seconds: "numeric"}; + +let expectedList = []; +expectedList.push(new Intl.NumberFormat(locale, {style: "unit", unit: "day", unitDisplay: "short"}).format(d.days)); +expectedList.push(new Intl.NumberFormat(locale, {style: "unit", unit: "hour", unitDisplay: "short"}).format(d.hours)); +expectedList.push(new Intl.NumberFormat(locale).format(d.minutes) + timeSeparator + new Intl.NumberFormat(locale, {minimumIntegerDigits: 2}).format(d.seconds)); + +let expected = new Intl.ListFormat(locale, {style: "short"}).format(expectedList); +let actual = new Intl.DurationFormat(locale, dfOpts).format(d); + +assert.sameValue(actual, expected); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-duration-style-default-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-duration-style-default-en.js index c6b58a5dfc..3c0f1d6dd5 100644 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-duration-style-default-en.js +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-duration-style-default-en.js @@ -6,7 +6,7 @@ esid: sec-Intl.DurationFormat.prototype.format description: > Test format method with negative duration and default style -locale: [en-US] +locale: [en] includes: [testIntl.js] features: [Intl.DurationFormat] ---*/ diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-duration-style-short-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-duration-style-short-en.js index 83eb5b4639..9ebf996341 100644 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-duration-style-short-en.js +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-duration-style-short-en.js @@ -6,7 +6,7 @@ esid: sec-Intl.DurationFormat.prototype.format description: > Test format method with negative duration and "short" style -locale: [en-US] +locale: [en] includes: [testIntl.js] features: [Intl.DurationFormat] ---*/ diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-digital-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-digital-en.js index c9f119c368..e26f198cd5 100644 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-digital-en.js +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-digital-en.js @@ -6,7 +6,7 @@ esid: sec-Intl.DurationFormat.prototype.format description: > Test format method with negative duration and "digital" style -locale: [en-US] +locale: [en] includes: [testIntl.js] features: [Intl.DurationFormat] ---*/ diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-long-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-long-en.js index fe074d488e..d7654f5630 100644 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-long-en.js +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-long-en.js @@ -6,7 +6,7 @@ esid: sec-Intl.DurationFormat.prototype.format description: > Test format method with negative duration and "long" style -locale: [en-US] +locale: [en] includes: [testIntl.js] features: [Intl.DurationFormat] ---*/ diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-narrow-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-narrow-en.js index 4d1db5dc67..1735112336 100644 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-narrow-en.js +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/negative-durationstyle-narrow-en.js @@ -6,7 +6,7 @@ esid: sec-Intl.DurationFormat.prototype.format description: > Test format method with negative duration and "narrow" style -locale: [en-US] +locale: [en] includes: [testIntl.js] features: [Intl.DurationFormat] ---*/ diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/numeric-hour-with-zero-minutes-and-non-zero-seconds.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/numeric-hour-with-zero-minutes-and-non-zero-seconds.js index dc5ad4ea84..3c37afa1b4 100644 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/format/numeric-hour-with-zero-minutes-and-non-zero-seconds.js +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/numeric-hour-with-zero-minutes-and-non-zero-seconds.js @@ -5,8 +5,8 @@ /*--- esid: sec-Intl.DurationFormat.prototype.format description: > - The correct separator is used for numeric hours with zero minutes and non-zero seconds. -locale: [en-US] + Minutes with numeric or 2-digit style are included in the output when between displayed hours and seconds, even when the minutes value is zero. +locale: [en] features: [Intl.DurationFormat] ---*/ @@ -15,30 +15,18 @@ const df = new Intl.DurationFormat("en", { hours: "numeric", }); -const lf = new Intl.ListFormat("en", { - type: "unit", - style: "short", -}); - const duration = { hours: 1, - - // Minutes is omitted from the output when its value is zero. minutes: 0, - - // Either seconds or sub-seconds must be non-zero. seconds: 3, }; -const expected = lf.format([ - new Intl.NumberFormat("en", {minimumIntegerDigits: 1}).format(duration.hours), - new Intl.NumberFormat("en", {minimumIntegerDigits: 2}).format(duration.seconds), -]); +const expected = "1:00:03" assert.sameValue( df.format(duration), expected, - `No time separator is used when minutes is zero` + `Minutes always displayed when between displayed hours and seconds, even if minutes is 0` ); reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/precision-exact-mathematical-values.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/precision-exact-mathematical-values.js index 5518450d6a..dbb34d39f7 100644 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/format/precision-exact-mathematical-values.js +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/precision-exact-mathematical-values.js @@ -25,7 +25,7 @@ info: | 7. Let parts be ! PartitionNumberPattern(nf, value). ... -locale: [en-US] +locale: [en] includes: [testIntl.js] features: [Intl.DurationFormat] ---*/ diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-default-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-default-en.js index 6eb5c4999e..dae05ae5f1 100644 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-default-en.js +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-default-en.js @@ -5,7 +5,7 @@ /*--- esid: sec-Intl.DurationFormat.prototype.format description: Test if format method formats duration correctly with different "style" arguments -locale: [en-US] +locale: [en] includes: [testIntl.js] features: [Intl.DurationFormat] ---*/ diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-en.js index 4f34d50aa9..cc2dd3342f 100644 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-en.js +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-en.js @@ -6,7 +6,7 @@ /*--- esid: sec-Intl.DurationFormat.prototype.format description: Test if format method formats duration correctly with different "style" arguments -locale: [en-US] +locale: [en] includes: [testIntl.js] features: [Intl.DurationFormat] ---*/ diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits-en.js new file mode 100644 index 0000000000..60c2232d6a --- /dev/null +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits-en.js @@ -0,0 +1,51 @@ +// |reftest| skip -- Intl.DurationFormat is not supported +// Copyright (C) 2023 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-partitiondurationformatpattern +description: > + Test to ensure that correct number of fractional digits is displayed if fractionalDigits is explicitly specified. + +info: | + 4. If durationFormat.[[FractionalDigits]] is undefined, then + a. Perform ! CreateDataPropertyOrThrow(nfOpts, "maximumFractionDigits", 9). + b. Perform ! CreateDataPropertyOrThrow(nfOpts, "minimumFractionDigits", 0). + 5. Else, + a. Perform ! CreateDataPropertyOrThrow(nfOpts, "maximumFractionDigits", durationFormat.[[FractionalDigits]]). + b. Perform ! CreateDataPropertyOrThrow(nfOpts, "minimumFractionDigits", durationFormat.[[FractionalDigits]]). +locale: [en] +features: [Intl.DurationFormat] +---*/ + +const duration = { + hours: 1, + minutes: 22, + seconds: 33, + milliseconds: 111, + microseconds: 222, + nanoseconds: 333, +}; + + +const style = "digital"; +const df = new Intl.DurationFormat("en", {style, fractionalDigits: 0}); +const dfMilli = new Intl.DurationFormat("en", {style, fractionalDigits: 3}); +const dfFourDigits = new Intl.DurationFormat("en", {style, fractionalDigits: 4}); +const dfMicro = new Intl.DurationFormat("en", {style, fractionalDigits: 6}); +const dfEightDigits = new Intl.DurationFormat("en", {style, fractionalDigits: 8}); +const dfNano = new Intl.DurationFormat("en", {style, fractionalDigits: 9}); + +assert.sameValue(df.format(duration), "1:22:33", `format output without sub-second digits using ${style} style option`); + +assert.sameValue(dfMilli.format(duration), "1:22:33.111", `format output with sub-second digits and fractionalDigits: 3 using ${style} style option`); + +assert.sameValue(dfFourDigits.format(duration), "1:22:33.1112", `format output with sub-second digits and fractionalDigits: 4 using ${style} style option`); + +assert.sameValue(dfMicro.format(duration), "1:22:33.111222", `format output with sub-second digits and fractionalDigits: 6 using ${style} style option`); + +assert.sameValue(dfEightDigits.format(duration), "1:22:33.11122233", `format output with sub-second digits and fractionalDigits: 8 using ${style} style option`); + +assert.sameValue(dfNano.format(duration), "1:22:33.111222333", `format output with sub-second digits and fractionalDigits: 9 using ${style} style option`); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits-undefined-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits-undefined-en.js new file mode 100644 index 0000000000..b297c0c7ba --- /dev/null +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits-undefined-en.js @@ -0,0 +1,80 @@ +// |reftest| skip -- Intl.DurationFormat is not supported +// Copyright (C) 2023 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-partitiondurationformatpattern +description: > + Test to ensure that correct number of fractional digits is displayed (i.e. however many are necessary to represent the data fully) if the fractionalDigits option is left *undefined* + +info: | + 4. If durationFormat.[[FractionalDigits]] is undefined, then + a. Perform ! CreateDataPropertyOrThrow(nfOpts, "maximumFractionDigits", 9). + b. Perform ! CreateDataPropertyOrThrow(nfOpts, "minimumFractionDigits", 0). + 5. Else, + a. Perform ! CreateDataPropertyOrThrow(nfOpts, "maximumFractionDigits", durationFormat.[[FractionalDigits]]). + b. Perform ! CreateDataPropertyOrThrow(nfOpts, "minimumFractionDigits", durationFormat.[[FractionalDigits]]). +locale: [en] +features: [Intl.DurationFormat] +---*/ + + +const durationNano = { + hours: 1, + minutes: 22, + seconds: 33, + milliseconds: 111, + microseconds: 222, + nanoseconds: 333 +}; + +const durationMicro = { + hours: 1, + minutes: 22, + seconds: 33, + milliseconds: 111, + microseconds: 222 +}; + +const durationMilli = { + hours: 1, + minutes: 22, + seconds: 33, + milliseconds: 111 +}; + +const durationNoSubsecond = { + hours: 1, + minutes: 22, + seconds: 33 +}; + +const durationFiveFractional = { + hours: 2, + minutes: 30, + seconds: 10, + milliseconds: 111, + microseconds: 220, +}; + +const durationSevenFractional = { + hours: 2, + minutes: 30, + seconds: 10, + milliseconds: 111, + microseconds: 220, + nanoseconds: 300 +}; + +const style = "digital"; +const df = new Intl.DurationFormat("en", {style, fractionalDigits: undefined}); + +assert.sameValue(df.format(durationNano), "1:22:33.111222333", `format output with nanosecond digits and fractionalDigits: undefined using ${style} style option`); +assert.sameValue(df.format(durationMicro), "1:22:33.111222", `format output with microsecond digits and fractionalDigits: undefined using ${style} style option`); +assert.sameValue(df.format(durationMilli), "1:22:33.111", `format output with millisecond digits and fractionalDigits: undefined using ${style} style option`); +assert.sameValue(df.format(durationNoSubsecond), "1:22:33", `format output with no subsecond digits and fractionalDigits: undefined using ${style} style option`); + +assert.sameValue(df.format(durationFiveFractional), "2:30:10.11122", `format output with five subsecond digits and fractionalDigits: undefined using ${style} style option`); +assert.sameValue(df.format(durationSevenFractional), "2:30:10.1112203", `format output with seven subsecond digits and fractionalDigits: undefined using ${style} style option`); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits-undefined.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits-undefined.js deleted file mode 100644 index 631e6c36eb..0000000000 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits-undefined.js +++ /dev/null @@ -1,71 +0,0 @@ -// |reftest| skip -- Intl.DurationFormat is not supported -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-partitiondurationformatpattern -description: > - Test to ensure that correct number of fractional digits is displayed (i.e. however many are necessary to represent the data fully) if the fractionalDigits option is left *undefined* - -info: | - 4. If durationFormat.[[FractionalDigits]] is undefined, then - a. Perform ! CreateDataPropertyOrThrow(nfOpts, "maximumFractionDigits", 9). - b. Perform ! CreateDataPropertyOrThrow(nfOpts, "minimumFractionDigits", 0). - 5. Else, - a. Perform ! CreateDataPropertyOrThrow(nfOpts, "maximumFractionDigits", durationFormat.[[FractionalDigits]]). - b. Perform ! CreateDataPropertyOrThrow(nfOpts, "minimumFractionDigits", durationFormat.[[FractionalDigits]]). -features: [Intl.DurationFormat] ----*/ - - -const durationNano = { - hours: 1, - minutes: 22, - seconds: 33, - milliseconds: 111, - microseconds: 222, - nanoseconds: 333 -}; - -const durationMicro = { - hours: 1, - minutes: 22, - seconds: 33, - milliseconds: 111, - microseconds: 222 -}; - -const durationMill = { - hours: 1, - minutes: 22, - seconds: 33, - milliseconds: 111 -}; - -const durationNoSubsecond = { - hours: 1, - minutes: 22, - seconds: 33 -}; - -const durationSevenFractional = { - hours: 2, - minutes: 30, - seconds: 10, - milliseconds: 111, - microseconds: 220, - nanoseconds: 300 -}; - -const style = "digital"; -const df = new Intl.DurationFormat(undefined, {style, fractionalDigits: undefined}); - -assert.sameValue(df.format(durationNano), "1:22:33.111222333", `format output with nanosecond digits and fractionalDigits: undefined using ${style} style option`); -assert.sameValue(df.format(durationMicro), "1:22:33.111222", `format output with microsecond digits and fractionalDigits: undefined using ${style} style option`); -assert.sameValue(df.format(durationMilli), "1:22:33.111", `format output with millisecond digits and fractionalDigits: undefined using ${style} style option`); -assert.sameValue(df.format(durationNoSubsecond), "1:22:33", `format output with no subsecond digits and fractionalDigits: undefined using ${style} style option`); - -assert.sameValue(df.format(durationFiveFractional), "2:30:11122", `format output with five subsecond digits and fractionalDigits: undefined using ${style} style option`); -assert.sameValue(df.format(durationSevenFractional), "2:30:1112203", `format output with seven subsecond digits and fractionalDigits: undefined using ${style} style option`); - -reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits.js deleted file mode 100644 index d75f51b14a..0000000000 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-digital-fractionalDigits.js +++ /dev/null @@ -1,50 +0,0 @@ -// |reftest| skip -- Intl.DurationFormat is not supported -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-partitiondurationformatpattern -description: > - Test to ensure that correct number of fractional digits is displayed if fractionalDigits is explicitly specified. - -info: | - 4. If durationFormat.[[FractionalDigits]] is undefined, then - a. Perform ! CreateDataPropertyOrThrow(nfOpts, "maximumFractionDigits", 9). - b. Perform ! CreateDataPropertyOrThrow(nfOpts, "minimumFractionDigits", 0). - 5. Else, - a. Perform ! CreateDataPropertyOrThrow(nfOpts, "maximumFractionDigits", durationFormat.[[FractionalDigits]]). - b. Perform ! CreateDataPropertyOrThrow(nfOpts, "minimumFractionDigits", durationFormat.[[FractionalDigits]]). -features: [Intl.DurationFormat] ----*/ - -const duration = { - hours: 1, - minutes: 22, - seconds: 33, - milliseconds: 111, - microseconds: 222, - nanoseconds: 333, -}; - - -const style = "digital"; -const df = new Intl.DurationFormat(undefined, {style, fractionalDigits: 0}); -const dfMilli = new Intl.DurationFormat(undefined, {style, fractionalDigits: 3}); -const dfFourDigits = new Intl.DurationFormat(undefined, {style, fractionalDigits: 4}); -const dfMicro = new Intl.DurationFormat(undefined, {style, fractionalDigits: 6}); -const dfEightDigits = new Intl.DurationFormat(undefined, {style, fractionalDigits: 8}); -const dfNano = new Intl.DurationFormat(undefined, {style, fractionalDigits: 9}); - -assert.sameValue(df.format(duration), "1:22:33", `format output without sub-second digits using ${style} style option`); - -assert.sameValue(dfMilli.format(duration), "1:22:33.111", `format output with sub-second digits and fractionalDigits: 3 using ${style} style option`); - -assert.sameValue(dfFourDigits.format(duration), "1:22:33.1112", `format output with sub-second digits and fractionalDigits: 4 using ${style} style option`); - -assert.sameValue(dfMicro.format(duration), "1:22:33.111222", `format output with sub-second digits and fractionalDigits: 6 using ${style} style option`); - -assert.sameValue(dfEightDigits.format(duration), "1:22:33.11122233", `format output with sub-second digits and fractionalDigits: 8 using ${style} style option`); - -assert.sameValue(dfNano.format(duration), "1:22:33.111222333", `format output with sub-second digits and fractionalDigits: 9 using ${style} style option`); - -reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-long-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-long-en.js index d9e6fc6cbb..74524da674 100644 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-long-en.js +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-long-en.js @@ -5,7 +5,7 @@ /*--- esid: sec-Intl.DurationFormat.prototype.format description: Test if format method formats duration correctly with different "style" arguments -locale: [en-US] +locale: [en] includes: [testIntl.js] features: [Intl.DurationFormat] ---*/ diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-narrow-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-narrow-en.js index 66b2258761..e75dc17170 100644 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-narrow-en.js +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-narrow-en.js @@ -5,7 +5,7 @@ /*--- esid: sec-Intl.DurationFormat.prototype.format description: Test if format method formats duration correctly with different "style" arguments -locale: [en-US] +locale: [en] includes: [testIntl.js] features: [Intl.DurationFormat] ---*/ diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-short-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-short-en.js index 2a66c01b06..049e034681 100644 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-short-en.js +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/format/style-short-en.js @@ -5,7 +5,7 @@ /*--- esid: sec-Intl.DurationFormat.prototype.format description: Test if format method formats duration correctly with different "style" arguments -locale: [en-US] +locale: [en] includes: [testIntl.js] features: [Intl.DurationFormat] ---*/ diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-default-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-default-en.js index bfc182c34b..5ce6300268 100644 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-default-en.js +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-default-en.js @@ -6,7 +6,7 @@ esid: sec-Intl.DurationFormat.prototype.formatToParts description: > Test formatToParts method with negative duration and default style -locale: [en-US] +locale: [en] includes: [testIntl.js] features: [Intl.DurationFormat] ---*/ diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-digital-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-digital-en.js index 52a40072ba..6978739ac3 100644 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-digital-en.js +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-digital-en.js @@ -6,7 +6,7 @@ esid: sec-Intl.DurationFormat.prototype.formatToParts description: > Test formatToParts method with negative duration and "digital" style -locale: [en-US] +locale: [en] includes: [testIntl.js] features: [Intl.DurationFormat] ---*/ diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-long-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-long-en.js index 3756db8a84..638f5922f1 100644 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-long-en.js +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-long-en.js @@ -6,7 +6,7 @@ esid: sec-Intl.DurationFormat.prototype.formatToParts description: > Test formatToParts method with negative duration and "long" style -locale: [en-US] +locale: [en] includes: [testIntl.js] features: [Intl.DurationFormat] ---*/ diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-narrow-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-narrow-en.js index a9717ce67a..b138100f8a 100644 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-narrow-en.js +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-narrow-en.js @@ -6,7 +6,7 @@ esid: sec-Intl.DurationFormat.prototype.formatToParts description: > Test formatToParts method with negative duration and "narrow" style -locale: [en-US] +locale: [en] includes: [testIntl.js] features: [Intl.DurationFormat] ---*/ diff --git a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-short-en.js b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-short-en.js index bc2ed69c5b..76ce8ccbf1 100644 --- a/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-short-en.js +++ b/js/src/tests/test262/intl402/DurationFormat/prototype/formatToParts/negative-duration-formatToParts-style-short-en.js @@ -6,7 +6,7 @@ esid: sec-Intl.DurationFormat.prototype.formatToParts description: > Test formatToParts method with negative duration and "short" style -locale: [en-US] +locale: [en] includes: [testIntl.js] features: [Intl.DurationFormat] ---*/ diff --git a/js/src/tests/test262/intl402/Locale/constructor-options-collation-invalid.js b/js/src/tests/test262/intl402/Locale/constructor-options-collation-invalid.js index d256093257..10f5cd5e4a 100644 --- a/js/src/tests/test262/intl402/Locale/constructor-options-collation-invalid.js +++ b/js/src/tests/test262/intl402/Locale/constructor-options-collation-invalid.js @@ -30,7 +30,7 @@ const invalidCollationOptions = [ for (const invalidCollationOption of invalidCollationOptions) { assert.throws(RangeError, function() { new Intl.Locale("en", {collation: invalidCollationOption}); - }, '`new Intl.Locale("en", {collation: invalidCollationOption})` throws RangeError'); + }); } reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Locale/prototype/calendar/canonicalize.js b/js/src/tests/test262/intl402/Locale/prototype/calendar/canonicalize.js new file mode 100644 index 0000000000..5ade4fe795 --- /dev/null +++ b/js/src/tests/test262/intl402/Locale/prototype/calendar/canonicalize.js @@ -0,0 +1,22 @@ +// Copyright 2024 Google Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-apply-unicode-extension-to-tag +description: Checks canonicalize value of extension in ApplyUnicodeExtensionToTag. +info: | + ApplyUnicodeExtensionToTag + 1. Let _optionsUValue_ be the ASCII-lowercase of _optionsValue_. + 1. Set _value_ to the String value resulting from canonicalizing _optionsUValue_ as a value of key _key_ per Unicode Technical Standard #35 Part 1 Core, Annex C LocaleId Canonicalization Section 5 Canonicalizing Syntax, Processing LocaleIds. +features: [Intl.Locale] +---*/ + +const loc = new Intl.Locale('en', {calendar: 'islamicc'}); + +assert.sameValue(loc.toString(), "en-u-ca-islamic-civil", + "'islamicc' should be canonicalize to 'islamic-civil'"); + +assert.sameValue(loc.calendar, "islamic-civil", + "'islamicc' should be canonicalize to 'islamic-civil'"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateAdd/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateAdd/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateAdd/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateAdd/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Calendar/prototype/dateFromFields/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateFromFields/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateFromFields/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateFromFields/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Calendar/prototype/dateUntil/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateUntil/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateUntil/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dateUntil/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Calendar/prototype/day/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/day/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/day/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/day/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Calendar/prototype/dayOfWeek/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dayOfWeek/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dayOfWeek/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dayOfWeek/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Calendar/prototype/dayOfYear/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dayOfYear/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dayOfYear/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/dayOfYear/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Calendar/prototype/daysInMonth/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInMonth/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInMonth/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInMonth/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Calendar/prototype/daysInWeek/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInWeek/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInWeek/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInWeek/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Calendar/prototype/daysInYear/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInYear/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInYear/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/daysInYear/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..2772960abe --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.era +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.era(arg); + assert.sameValue(result, undefined, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-year-zero.js index d0698c070c..57df6364f9 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.Calendar("iso8601"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.era(arg), diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..f34a405169 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.era +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Calendar("iso8601"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.era(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/shell.js index 32df7c4217..63bc783738 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/era/shell.js @@ -2046,6 +2046,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]", ]; }, @@ -2133,6 +2136,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/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-iso-string.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-iso-string.js new file mode 100644 index 0000000000..2899ea877c --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-iso-string.js @@ -0,0 +1,28 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.erayear +description: An ISO 8601 string can be converted to a calendar ID in Calendar +features: [Temporal] +---*/ + +const instance = new Temporal.Calendar("iso8601"); + +for (const calendar of [ + "2020-01-01", + "2020-01-01[u-ca=iso8601]", + "2020-01-01T00:00:00.000000000", + "2020-01-01T00:00:00.000000000[u-ca=iso8601]", + "01-01", + "01-01[u-ca=iso8601]", + "2020-01", + "2020-01[u-ca=iso8601]", +]) { + const arg = { year: 1976, monthCode: "M11", day: 18, calendar }; + const result = instance.eraYear(arg); + assert.sameValue(result, undefined, `Calendar created from string "${calendar}"`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-year-zero.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-year-zero.js index 65675a5894..eaa93d916a 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-year-zero.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-year-zero.js @@ -16,7 +16,8 @@ const invalidStrings = [ "-000000-10-31T17:45+00:00[UTC]", ]; const instance = new Temporal.Calendar("iso8601"); -invalidStrings.forEach((arg) => { +invalidStrings.forEach((str) => { + const arg = { year: 1976, month: 11, day: 18, calendar: str }; assert.throws( RangeError, () => instance.eraYear(arg), diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-string-calendar-annotation-invalid-key.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-string-calendar-annotation-invalid-key.js new file mode 100644 index 0000000000..7bec3d6a54 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/argument-string-calendar-annotation-invalid-key.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.erayear +description: Annotation keys are lowercase-only +features: [Temporal] +---*/ + +const invalidStrings = [ + ["1970-01-01[U-CA=iso8601]", "invalid capitalized key"], + ["1970-01-01[u-CA=iso8601]", "invalid partially-capitalized key"], + ["1970-01-01[FOO=bar]", "invalid capitalized unrecognized key"], +]; +const instance = new Temporal.Calendar("iso8601"); +invalidStrings.forEach(([arg, descr]) => { + assert.throws( + RangeError, + () => instance.eraYear(arg), + `annotation keys must be lowercase: ${arg} - ${descr}` + ); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/shell.js index 32df7c4217..63bc783738 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/eraYear/shell.js @@ -2046,6 +2046,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]", ]; }, @@ -2133,6 +2136,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/intl402/Temporal/Calendar/prototype/inLeapYear/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/inLeapYear/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/inLeapYear/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/inLeapYear/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Calendar/prototype/month/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/month/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/month/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/month/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Calendar/prototype/monthCode/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthCode/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthCode/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthCode/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Calendar/prototype/monthDayFromFields/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthDayFromFields/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthDayFromFields/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthDayFromFields/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Calendar/prototype/monthsInYear/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthsInYear/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthsInYear/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/monthsInYear/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Calendar/prototype/weekOfYear/gregory-iso-weekofyear.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/gregory-iso-weekofyear.js new file mode 100644 index 0000000000..3eeb8186ef --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/gregory-iso-weekofyear.js @@ -0,0 +1,30 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.weekofyear +description: > + In the ISO 8601 week calendar, calendar week number 1 of a calendar year is + the week including the first Thursday of that year (based on the principle + that a week belongs to the same calendar year as the majority of its calendar + days). Because of this, some calendar days of the first calendar week of a + calendar year may be part of the preceding date calendar year, and some + calendar days of the last calendar week of a calendar year may be part of + the next calendar year. +features: [Temporal] +---*/ + +// + +let calendar = new Temporal.Calendar("gregory"); +const date = { month: 1, day: 1, year: 2021, calendar}; + +assert.sameValue(calendar.weekOfYear({...date}), 1); + +calendar = new Temporal.Calendar("iso8601"); +const isodate = { month: 1, day: 1, year: 2021, calendar}; + +assert.sameValue(calendar.weekOfYear({...isodate}), 53); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/non-iso-week-of-year.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/non-iso-week-of-year.js new file mode 100644 index 0000000000..9392c0c13b --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/non-iso-week-of-year.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.weekofyear +description: > + Temporal.Calendar.prototype.weekOfYear returns undefined for all + non-ISO calendars without a well-defined week numbering system. +features: [Temporal] +---*/ + +// Gregorian calendar has a well defined week-numbering system. + +let calendar = new Temporal.Calendar("gregory"); +const date = { month: 1, day: 1, year: 2024, calendar}; + +assert.sameValue(calendar.weekOfYear({...date}), 1); + +calendar = new Temporal.Calendar("hebrew"); +const nonisodate = { month: 1, day: 1, year: 2024, calendar}; + +assert.sameValue(calendar.weekOfYear({...nonisodate}), undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/weekOfYear/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Calendar/prototype/year/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/year/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/year/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/year/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Calendar/prototype/yearMonthFromFields/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearMonthFromFields/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearMonthFromFields/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearMonthFromFields/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Calendar/prototype/yearOfWeek/gregory-iso-weekofyear.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/gregory-iso-weekofyear.js new file mode 100644 index 0000000000..ff2d9c0b60 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/gregory-iso-weekofyear.js @@ -0,0 +1,30 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.yearofweek +description: > + In the ISO 8601 week calendar, calendar week number 1 of a calendar year is + the week including the first Thursday of that year (based on the principle + that a week belongs to the same calendar year as the majority of its calendar + days). Because of this, some calendar days of the first calendar week of a + calendar year may be part of the preceding date calendar year, and some + calendar days of the last calendar week of a calendar year may be part of + the next calendar year. +features: [Temporal] +---*/ + +// + +let calendar = new Temporal.Calendar("gregory"); +const date = { month: 1, day: 1, year: 2021, calendar}; + +assert.sameValue(calendar.yearOfWeek({...date}), 2021); + +calendar = new Temporal.Calendar("iso8601"); +const isodate = { month: 1, day: 1, year: 2021, calendar}; + +assert.sameValue(calendar.yearOfWeek({...isodate}), 2020); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/non-iso-week-of-year.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/non-iso-week-of-year.js new file mode 100644 index 0000000000..9abf674f0f --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/non-iso-week-of-year.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.calendar.prototype.yearofweek +description: > + Temporal.Calendar.prototype.yearOfWeek returns undefined for all + non-ISO calendars without a well-defined week numbering system. +features: [Temporal] +---*/ + +// Gregorian calendar has a well defined week-numbering system. + +let calendar = new Temporal.Calendar("gregory"); +const date = { month: 1, day: 1, year: 2024, calendar}; + +assert.sameValue(calendar.yearOfWeek({...date}), 2024); + +calendar = new Temporal.Calendar("hebrew"); +const nonisodate = { month: 1, day: 1, year: 2024, calendar}; + +assert.sameValue(calendar.yearOfWeek({...nonisodate}), undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/shell.js b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Calendar/prototype/yearOfWeek/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Duration/prototype/add/shell.js b/js/src/tests/test262/intl402/Temporal/Duration/prototype/add/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Duration/prototype/add/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Duration/prototype/add/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Duration/prototype/round/shell.js b/js/src/tests/test262/intl402/Temporal/Duration/prototype/round/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Duration/prototype/round/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Duration/prototype/round/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Duration/prototype/subtract/shell.js b/js/src/tests/test262/intl402/Temporal/Duration/prototype/subtract/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Duration/prototype/subtract/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Duration/prototype/subtract/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Duration/prototype/total/shell.js b/js/src/tests/test262/intl402/Temporal/Duration/prototype/total/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/Duration/prototype/total/shell.js +++ b/js/src/tests/test262/intl402/Temporal/Duration/prototype/total/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/Instant/prototype/toLocaleString/dateStyle.js b/js/src/tests/test262/intl402/Temporal/Instant/prototype/toLocaleString/dateStyle.js new file mode 100644 index 0000000000..2d0614deb9 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/Instant/prototype/toLocaleString/dateStyle.js @@ -0,0 +1,31 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.instant.prototype.tolocalestring +description: Basic tests that dateStyle option affects output +locale: [en-u-ca-gregory, en-u-ca-islamic] +features: [Temporal, Intl.DateTimeFormat-datetimestyle] +---*/ + +const instant = new Temporal.Instant(1711475200_000_000_000n); + +assert( + instant.toLocaleString("en-u-ca-gregory", { dateStyle: "long" }).includes("March"), + "dateStyle: long writes month of March out in full" +); +assert( + !instant.toLocaleString("en-u-ca-gregory", { dateStyle: "short" }).includes("March"), + "dateStyle: short does not write month of March out in full" +); +assert( + instant.toLocaleString("en-u-ca-islamic", { dateStyle: "long" }).includes("Ramadan"), + "dateStyle: long writes month of Ramadan out in full" +); +assert( + !instant.toLocaleString("en-u-ca-islamic", { dateStyle: "short" }).includes("Ramadan"), + "dateStyle: short does not write month of Ramadan out in full" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/PlainDate/compare/shell.js b/js/src/tests/test262/intl402/Temporal/PlainDate/compare/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainDate/compare/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainDate/compare/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainDate/from/shell.js b/js/src/tests/test262/intl402/Temporal/PlainDate/from/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainDate/from/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainDate/from/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainDate/prototype/equals/shell.js b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/equals/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/equals/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/equals/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainDate/prototype/since/shell.js b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/since/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/since/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/since/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainDate/prototype/toLocaleString/dateStyle.js b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/toLocaleString/dateStyle.js new file mode 100644 index 0000000000..0bb42308d5 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/toLocaleString/dateStyle.js @@ -0,0 +1,34 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.tolocalestring +description: Basic tests that dateStyle option affects output +locale: [en-u-ca-gregory, en-u-ca-islamic] +features: [Temporal, Intl.DateTimeFormat-datetimestyle] +---*/ + +const dateGregorian = new Temporal.PlainDate(2024, 3, 26, "gregory"); + +assert( + dateGregorian.toLocaleString("en-u-ca-gregory", { dateStyle: "long" }).includes("March"), + "dateStyle: long writes month of March out in full" +); +assert( + !dateGregorian.toLocaleString("en-u-ca-gregory", { dateStyle: "short" }).includes("March"), + "dateStyle: short does not write month of March out in full" +); + +const dateIslamic = new Temporal.PlainDate(2024, 3, 26, "islamic"); + +assert( + dateIslamic.toLocaleString("en-u-ca-islamic", { dateStyle: "long" }).includes("Ramadan"), + "dateStyle: long writes month of Ramadan out in full" +); +assert( + !dateIslamic.toLocaleString("en-u-ca-islamic", { dateStyle: "short" }).includes("Ramadan"), + "dateStyle: short does not write month of Ramadan out in full" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/until/shell.js b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/until/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/until/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/until/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainDate/prototype/weekOfYear/browser.js b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/weekOfYear/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/weekOfYear/gregory-iso-weekofyear.js b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/weekOfYear/gregory-iso-weekofyear.js new file mode 100644 index 0000000000..312d87afd6 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/weekOfYear/gregory-iso-weekofyear.js @@ -0,0 +1,30 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.weekofyear +description: > + In the ISO 8601 week calendar, calendar week number 1 of a calendar year is + the week including the first Thursday of that year (based on the principle + that a week belongs to the same calendar year as the majority of its calendar + days). Because of this, some calendar days of the first calendar week of a + calendar year may be part of the preceding date calendar year, and some + calendar days of the last calendar week of a calendar year may be part of + the next calendar year. +features: [Temporal] +---*/ + +// + +let calendar = new Temporal.Calendar("gregory"); +const date = new Temporal.PlainDate(2021, 1, 1, calendar); + +assert.sameValue(date.weekOfYear, 1); + +calendar = new Temporal.Calendar("iso8601"); +const isodate = new Temporal.PlainDate(2021, 1, 1, calendar); + +assert.sameValue(isodate.weekOfYear, 53); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/weekOfYear/non-iso-week-of-year.js b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/weekOfYear/non-iso-week-of-year.js new file mode 100644 index 0000000000..b9717b8eba --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/weekOfYear/non-iso-week-of-year.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.weekofyear +description: > + Temporal.PlainDate.prototype.weekOfYear returns undefined for all + non-ISO calendars without a well-defined week numbering system. +features: [Temporal] +---*/ + +// Gregorian calendar has a well defined week-numbering system. + +let calendar = new Temporal.Calendar("gregory"); +const date = new Temporal.PlainDate(2024, 1, 1, calendar); + +assert.sameValue(date.weekOfYear, 1); + +calendar = new Temporal.Calendar("hebrew"); +const nonisodate = new Temporal.PlainDate(2024, 1, 1, calendar); + +assert.sameValue(nonisodate.weekOfYear, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/weekOfYear/shell.js b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/weekOfYear/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/yearOfWeek/browser.js b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/yearOfWeek/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/yearOfWeek/gregory-iso-weekofyear.js b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/yearOfWeek/gregory-iso-weekofyear.js new file mode 100644 index 0000000000..d8556f309a --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/yearOfWeek/gregory-iso-weekofyear.js @@ -0,0 +1,30 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.yearofweek +description: > + In the ISO 8601 week calendar, calendar week number 1 of a calendar year is + the week including the first Thursday of that year (based on the principle + that a week belongs to the same calendar year as the majority of its calendar + days). Because of this, some calendar days of the first calendar week of a + calendar year may be part of the preceding date calendar year, and some + calendar days of the last calendar week of a calendar year may be part of + the next calendar year. +features: [Temporal] +---*/ + +// + +let calendar = new Temporal.Calendar("gregory"); +const date = new Temporal.PlainDate(2021, 1, 1, calendar); + +assert.sameValue(date.yearOfWeek, 2021); + +calendar = new Temporal.Calendar("iso8601"); +const isodate = new Temporal.PlainDate(2021, 1, 1, calendar); + +assert.sameValue(isodate.yearOfWeek, 2020); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/yearOfWeek/non-iso-week-of-year.js b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/yearOfWeek/non-iso-week-of-year.js new file mode 100644 index 0000000000..047166e765 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/yearOfWeek/non-iso-week-of-year.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.yearofweek +description: > + Temporal.PlainDate.prototype.yearOfWeek returns undefined for all + non-ISO calendars without a well-defined week numbering system. +features: [Temporal] +---*/ + +// Gregorian calendar has a well defined week-numbering system. + +let calendar = new Temporal.Calendar("gregory"); +const date = new Temporal.PlainDate(2024, 1, 1, calendar); + +assert.sameValue(date.yearOfWeek, 2024); + +calendar = new Temporal.Calendar("hebrew"); +const nonisodate = new Temporal.PlainDate(2024, 1, 1, calendar); + +assert.sameValue(nonisodate.yearOfWeek, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/yearOfWeek/shell.js b/js/src/tests/test262/intl402/Temporal/PlainDate/prototype/yearOfWeek/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/intl402/Temporal/PlainDateTime/compare/shell.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/compare/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainDateTime/compare/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainDateTime/compare/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainDateTime/from/shell.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/from/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainDateTime/from/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainDateTime/from/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainDateTime/prototype/equals/shell.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/equals/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/equals/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/equals/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainDateTime/prototype/since/shell.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/since/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/since/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/since/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainDateTime/prototype/toLocaleString/dateStyle.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/toLocaleString/dateStyle.js new file mode 100644 index 0000000000..9abc7e4128 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/toLocaleString/dateStyle.js @@ -0,0 +1,34 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.tolocalestring +description: Basic tests that dateStyle option affects output +locale: [en-u-ca-gregory, en-u-ca-islamic] +features: [Temporal, Intl.DateTimeFormat-datetimestyle] +---*/ + +const dateGregorian = new Temporal.PlainDateTime(2024, 3, 26, 10, 30, 0, 0, 0, 0, "gregory"); + +assert( + dateGregorian.toLocaleString("en-u-ca-gregory", { dateStyle: "long" }).includes("March"), + "dateStyle: long writes month of March out in full" +); +assert( + !dateGregorian.toLocaleString("en-u-ca-gregory", { dateStyle: "short" }).includes("March"), + "dateStyle: short does not write month of March out in full" +); + +const dateIslamic = new Temporal.PlainDateTime(2024, 3, 26, 10, 30, 0, 0, 0, 0, "islamic"); + +assert( + dateIslamic.toLocaleString("en-u-ca-islamic", { dateStyle: "long" }).includes("Ramadan"), + "dateStyle: long writes month of Ramadan out in full" +); +assert( + !dateIslamic.toLocaleString("en-u-ca-islamic", { dateStyle: "short" }).includes("Ramadan"), + "dateStyle: short does not write month of Ramadan out in full" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/until/shell.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/until/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/until/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/until/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainDateTime/prototype/weekOfYear/browser.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/weekOfYear/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/weekOfYear/gregory-iso-weekofyear.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/weekOfYear/gregory-iso-weekofyear.js new file mode 100644 index 0000000000..5b0fce3473 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/weekOfYear/gregory-iso-weekofyear.js @@ -0,0 +1,30 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.weekofyear +description: > + In the ISO 8601 week calendar, calendar week number 1 of a calendar year is + the week including the first Thursday of that year (based on the principle + that a week belongs to the same calendar year as the majority of its calendar + days). Because of this, some calendar days of the first calendar week of a + calendar year may be part of the preceding date calendar year, and some + calendar days of the last calendar week of a calendar year may be part of + the next calendar year. +features: [Temporal] +---*/ + +// + +let calendar = new Temporal.Calendar("gregory"); +const date = new Temporal.PlainDateTime(2021, 1, 1, 12, 34, 56, 987, 654, 321, calendar); + +assert.sameValue(date.weekOfYear, 1); + +calendar = new Temporal.Calendar("iso8601"); +const isodate = new Temporal.PlainDateTime(2021, 1, 1, 12, 34, 56, 987, 654, 321, calendar); + +assert.sameValue(isodate.weekOfYear, 53); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/weekOfYear/non-iso-week-of-year.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/weekOfYear/non-iso-week-of-year.js new file mode 100644 index 0000000000..b90a9cde8d --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/weekOfYear/non-iso-week-of-year.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.weekofyear +description: > + Temporal.PlainDateTime.prototype.weekOfYear returns undefined for all + non-ISO calendars without a well-defined week numbering system. +features: [Temporal] +---*/ + +// Gregorian calendar has a well defined week-numbering system. + +let calendar = new Temporal.Calendar("gregory"); +const date = new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); + +assert.sameValue(date.weekOfYear, 1); + +calendar = new Temporal.Calendar("hebrew"); +const nonisodate = new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); + +assert.sameValue(nonisodate.weekOfYear, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/weekOfYear/shell.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/weekOfYear/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/withPlainDate/shell.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/withPlainDate/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/withPlainDate/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/withPlainDate/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/browser.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js new file mode 100644 index 0000000000..a3846e5d01 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js @@ -0,0 +1,30 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.yearofweek +description: > + In the ISO 8601 week calendar, calendar week number 1 of a calendar year is + the week including the first Thursday of that year (based on the principle + that a week belongs to the same calendar year as the majority of its calendar + days). Because of this, some calendar days of the first calendar week of a + calendar year may be part of the preceding date calendar year, and some + calendar days of the last calendar week of a calendar year may be part of + the next calendar year. +features: [Temporal] +---*/ + +// + +let calendar = new Temporal.Calendar("gregory"); +const date = new Temporal.PlainDateTime(2021, 1, 1, 12, 34, 56, 987, 654, 321, calendar); + +assert.sameValue(date.yearOfWeek, 2021); + +calendar = new Temporal.Calendar("iso8601"); +const isodate = new Temporal.PlainDateTime(2021, 1, 1, 12, 34, 56, 987, 654, 321, calendar); + +assert.sameValue(isodate.yearOfWeek, 2020); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/non-iso-week-of-year.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/non-iso-week-of-year.js new file mode 100644 index 0000000000..cffb030267 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/non-iso-week-of-year.js @@ -0,0 +1,25 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindatetime.prototype.yearofweek +description: > + Temporal.PlainDateTime.prototype.yearOfWeek returns undefined for all + non-ISO calendars without a well-defined week numbering system. +features: [Temporal] +---*/ + +// Gregorian calendar has a well defined week-numbering system. + +let calendar = new Temporal.Calendar("gregory"); +const date = new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); + +assert.sameValue(date.yearOfWeek, 2024); + +calendar = new Temporal.Calendar("hebrew"); +const nonisodate = new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); + +assert.sameValue(nonisodate.yearOfWeek, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/shell.js b/js/src/tests/test262/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/intl402/Temporal/PlainMonthDay/from/shell.js b/js/src/tests/test262/intl402/Temporal/PlainMonthDay/from/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainMonthDay/from/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainMonthDay/from/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainMonthDay/prototype/equals/shell.js b/js/src/tests/test262/intl402/Temporal/PlainMonthDay/prototype/equals/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainMonthDay/prototype/equals/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainMonthDay/prototype/equals/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainMonthDay/prototype/toLocaleString/dateStyle.js b/js/src/tests/test262/intl402/Temporal/PlainMonthDay/prototype/toLocaleString/dateStyle.js new file mode 100644 index 0000000000..9011393592 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/PlainMonthDay/prototype/toLocaleString/dateStyle.js @@ -0,0 +1,34 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainmonthday.prototype.tolocalestring +description: Basic tests that dateStyle option affects output +locale: [en-u-ca-gregory, en-u-ca-islamic] +features: [Temporal, Intl.DateTimeFormat-datetimestyle] +---*/ + +const dateGregorian = Temporal.PlainMonthDay.from({ monthCode: "M03", day: 26, calendar: "gregory" }); + +assert( + dateGregorian.toLocaleString("en-u-ca-gregory", { dateStyle: "long" }).includes("March"), + "dateStyle: long writes month of March out in full" +); +assert( + !dateGregorian.toLocaleString("en-u-ca-gregory", { dateStyle: "short" }).includes("March"), + "dateStyle: short does not write month of March out in full" +); + +const dateIslamic = Temporal.PlainMonthDay.from({ monthCode: "M09", day: 16, calendar: "islamic" }); + +assert( + dateIslamic.toLocaleString("en-u-ca-islamic", { dateStyle: "long" }).includes("Ramadan"), + "dateStyle: long writes month of Ramadan out in full" +); +assert( + !dateIslamic.toLocaleString("en-u-ca-islamic", { dateStyle: "short" }).includes("Ramadan"), + "dateStyle: short does not write month of Ramadan out in full" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/PlainMonthDay/prototype/toPlainDate/shell.js b/js/src/tests/test262/intl402/Temporal/PlainMonthDay/prototype/toPlainDate/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainMonthDay/prototype/toPlainDate/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainMonthDay/prototype/toPlainDate/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainTime/prototype/toPlainDateTime/shell.js b/js/src/tests/test262/intl402/Temporal/PlainTime/prototype/toPlainDateTime/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainTime/prototype/toPlainDateTime/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainTime/prototype/toPlainDateTime/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainTime/prototype/toZonedDateTime/shell.js b/js/src/tests/test262/intl402/Temporal/PlainTime/prototype/toZonedDateTime/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainTime/prototype/toZonedDateTime/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainTime/prototype/toZonedDateTime/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainYearMonth/compare/shell.js b/js/src/tests/test262/intl402/Temporal/PlainYearMonth/compare/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainYearMonth/compare/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainYearMonth/compare/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainYearMonth/from/shell.js b/js/src/tests/test262/intl402/Temporal/PlainYearMonth/from/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainYearMonth/from/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainYearMonth/from/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainYearMonth/prototype/equals/shell.js b/js/src/tests/test262/intl402/Temporal/PlainYearMonth/prototype/equals/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainYearMonth/prototype/equals/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainYearMonth/prototype/equals/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainYearMonth/prototype/since/shell.js b/js/src/tests/test262/intl402/Temporal/PlainYearMonth/prototype/since/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainYearMonth/prototype/since/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainYearMonth/prototype/since/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/PlainYearMonth/prototype/toLocaleString/dateStyle.js b/js/src/tests/test262/intl402/Temporal/PlainYearMonth/prototype/toLocaleString/dateStyle.js new file mode 100644 index 0000000000..b4816e1b19 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/PlainYearMonth/prototype/toLocaleString/dateStyle.js @@ -0,0 +1,34 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainyearmonth.prototype.tolocalestring +description: Basic tests that dateStyle option affects output +locale: [en-u-ca-gregory, en-u-ca-islamic] +features: [Temporal, Intl.DateTimeFormat-datetimestyle] +---*/ + +const dateGregorian = Temporal.PlainYearMonth.from({ year: 2024, monthCode: "M03", calendar: "gregory" }); + +assert( + dateGregorian.toLocaleString("en-u-ca-gregory", { dateStyle: "long" }).includes("March"), + "dateStyle: long writes month of March out in full" +); +assert( + !dateGregorian.toLocaleString("en-u-ca-gregory", { dateStyle: "short" }).includes("March"), + "dateStyle: short does not write month of March out in full" +); + +const dateIslamic = Temporal.PlainYearMonth.from({ year: 1445, monthCode: "M09", calendar: "islamic" }); + +assert( + dateIslamic.toLocaleString("en-u-ca-islamic", { dateStyle: "long" }).includes("Ramadan"), + "dateStyle: long writes month of Ramadan out in full" +); +assert( + !dateIslamic.toLocaleString("en-u-ca-islamic", { dateStyle: "short" }).includes("Ramadan"), + "dateStyle: short does not write month of Ramadan out in full" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/PlainYearMonth/prototype/until/shell.js b/js/src/tests/test262/intl402/Temporal/PlainYearMonth/prototype/until/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/PlainYearMonth/prototype/until/shell.js +++ b/js/src/tests/test262/intl402/Temporal/PlainYearMonth/prototype/until/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/TimeZone/from/timezone-string-legacy-non-iana.js b/js/src/tests/test262/intl402/Temporal/TimeZone/from/timezone-string-legacy-non-iana.js new file mode 100644 index 0000000000..90f7e9f4f6 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/TimeZone/from/timezone-string-legacy-non-iana.js @@ -0,0 +1,47 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.timezone.from +description: Only IANA time zone identifiers are allowed. +features: [Temporal] +---*/ + +// List of non-IANA link names, copied from: +// https://github.com/unicode-org/icu/blob/main/icu4c/source/tools/tzcode/icuzones +const invalidTimeZones = [ + "ACT", + "AET", + "AGT", + "ART", + "AST", + "BET", + "BST", + "CAT", + "CNT", + "CST", + "CTT", + "EAT", + "ECT", + "IET", + "IST", + "JST", + "MIT", + "NET", + "NST", + "PLT", + "PNT", + "PRT", + "PST", + "SST", + "VST", +]; + +for (let timeZone of invalidTimeZones) { + assert.throws(RangeError, () => { + Temporal.TimeZone.from(timeZone); + }, "Time zone: " + timeZone); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/TimeZone/legacy-non-iana.js b/js/src/tests/test262/intl402/Temporal/TimeZone/legacy-non-iana.js new file mode 100644 index 0000000000..aaf9dd1a80 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/TimeZone/legacy-non-iana.js @@ -0,0 +1,47 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.timezone +description: Only IANA time zone identifiers are allowed. +features: [Temporal] +---*/ + +// List of non-IANA link names, copied from: +// https://github.com/unicode-org/icu/blob/main/icu4c/source/tools/tzcode/icuzones +const invalidTimeZones = [ + "ACT", + "AET", + "AGT", + "ART", + "AST", + "BET", + "BST", + "CAT", + "CNT", + "CST", + "CTT", + "EAT", + "ECT", + "IET", + "IST", + "JST", + "MIT", + "NET", + "NST", + "PLT", + "PNT", + "PRT", + "PST", + "SST", + "VST", +]; + +for (let timeZone of invalidTimeZones) { + assert.throws(RangeError, () => { + new Temporal.TimeZone(timeZone); + }, "Time zone: " + timeZone); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/TimeZone/prototype/getInstantFor/shell.js b/js/src/tests/test262/intl402/Temporal/TimeZone/prototype/getInstantFor/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/TimeZone/prototype/getInstantFor/shell.js +++ b/js/src/tests/test262/intl402/Temporal/TimeZone/prototype/getInstantFor/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/TimeZone/prototype/getPlainDateTimeFor/shell.js b/js/src/tests/test262/intl402/Temporal/TimeZone/prototype/getPlainDateTimeFor/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/TimeZone/prototype/getPlainDateTimeFor/shell.js +++ b/js/src/tests/test262/intl402/Temporal/TimeZone/prototype/getPlainDateTimeFor/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/TimeZone/prototype/getPossibleInstantsFor/shell.js b/js/src/tests/test262/intl402/Temporal/TimeZone/prototype/getPossibleInstantsFor/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/TimeZone/prototype/getPossibleInstantsFor/shell.js +++ b/js/src/tests/test262/intl402/Temporal/TimeZone/prototype/getPossibleInstantsFor/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/ZonedDateTime/compare/shell.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/compare/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/ZonedDateTime/compare/shell.js +++ b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/compare/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/ZonedDateTime/from/shell.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/from/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/ZonedDateTime/from/shell.js +++ b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/from/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/ZonedDateTime/prototype/equals/shell.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/equals/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/equals/shell.js +++ b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/equals/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/ZonedDateTime/prototype/era/shell.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/era/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/era/shell.js +++ b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/era/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/ZonedDateTime/prototype/eraYear/shell.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/eraYear/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/eraYear/shell.js +++ b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/eraYear/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/ZonedDateTime/prototype/since/shell.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/since/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/since/shell.js +++ b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/since/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/ZonedDateTime/prototype/toLocaleString/dateStyle.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/toLocaleString/dateStyle.js new file mode 100644 index 0000000000..b8235d824d --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/toLocaleString/dateStyle.js @@ -0,0 +1,34 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.tolocalestring +description: Basic tests that dateStyle option affects output +locale: [en-u-ca-gregory, en-u-ca-islamic] +features: [Temporal, Intl.DateTimeFormat-datetimestyle] +---*/ + +const dateGregorian = new Temporal.ZonedDateTime(1711475200_000_000_000n, "UTC", "gregory"); + +assert( + dateGregorian.toLocaleString("en-u-ca-gregory", { dateStyle: "long" }).includes("March"), + "dateStyle: long writes month of March out in full" +); +assert( + !dateGregorian.toLocaleString("en-u-ca-gregory", { dateStyle: "short" }).includes("March"), + "dateStyle: short does not write month of March out in full" +); + +const dateIslamic = new Temporal.ZonedDateTime(1711475200_000_000_000n, "UTC", "islamic"); + +assert( + dateIslamic.toLocaleString("en-u-ca-islamic", { dateStyle: "long" }).includes("Ramadan"), + "dateStyle: long writes month of Ramadan out in full" +); +assert( + !dateIslamic.toLocaleString("en-u-ca-islamic", { dateStyle: "short" }).includes("Ramadan"), + "dateStyle: short does not write month of Ramadan out in full" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/until/shell.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/until/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/until/shell.js +++ b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/until/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/browser.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/gregory-iso-weekofyear.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/gregory-iso-weekofyear.js new file mode 100644 index 0000000000..bf1ddaaaeb --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/gregory-iso-weekofyear.js @@ -0,0 +1,30 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.weekofyear +description: > + In the ISO 8601 week calendar, calendar week number 1 of a calendar year is + the week including the first Thursday of that year (based on the principle + that a week belongs to the same calendar year as the majority of its calendar + days). Because of this, some calendar days of the first calendar week of a + calendar year may be part of the preceding date calendar year, and some + calendar days of the last calendar week of a calendar year may be part of + the next calendar year. +features: [Temporal] +---*/ + +// + +let calendar = new Temporal.Calendar("gregory"); +const date = new Temporal.ZonedDateTime(1_609_504_496_987_654_321n, "UTC", calendar); + +assert.sameValue(date.weekOfYear, 1); + +calendar = new Temporal.Calendar("iso8601"); +const isodate = new Temporal.ZonedDateTime(1_609_504_496_987_654_321n, "UTC", calendar); + +assert.sameValue(isodate.weekOfYear, 53); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/non-iso-week-of-year.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/non-iso-week-of-year.js new file mode 100644 index 0000000000..79769e6d19 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/non-iso-week-of-year.js @@ -0,0 +1,27 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.weekofyear +description: > + Temporal.ZonedDateTime.prototype.weekOfYear returns undefined for all + non-ISO calendars without a well-defined week numbering system. +features: [Temporal] +---*/ + +// Gregorian calendar has a well defined week-numbering system. + +let calendar = new Temporal.Calendar("gregory"); + +// Epoch Nanoseconds for new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); +const date = new Temporal.ZonedDateTime(1_704_112_496_987_654_321n, "UTC", calendar); + +assert.sameValue(date.weekOfYear, 1); + +calendar = new Temporal.Calendar("hebrew"); +const nonisodate = new Temporal.ZonedDateTime(1_704_112_496_987_654_321n, "UTC", calendar); + +assert.sameValue(nonisodate.weekOfYear, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/shell.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/with/shell.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/with/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/with/shell.js +++ b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/with/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/ZonedDateTime/prototype/withPlainDate/shell.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/withPlainDate/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/withPlainDate/shell.js +++ b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/withPlainDate/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/browser.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js new file mode 100644 index 0000000000..afa4ce7165 --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js @@ -0,0 +1,30 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.yearofweek +description: > + In the ISO 8601 week calendar, calendar week number 1 of a calendar year is + the week including the first Thursday of that year (based on the principle + that a week belongs to the same calendar year as the majority of its calendar + days). Because of this, some calendar days of the first calendar week of a + calendar year may be part of the preceding date calendar year, and some + calendar days of the last calendar week of a calendar year may be part of + the next calendar year. +features: [Temporal] +---*/ + +// + +let calendar = new Temporal.Calendar("gregory"); +const date = new Temporal.ZonedDateTime(1_609_504_496_987_654_321n, "UTC", calendar); + +assert.sameValue(date.yearOfWeek, 2021); + +calendar = new Temporal.Calendar("iso8601"); +const isodate = new Temporal.ZonedDateTime(1_609_504_496_987_654_321n, "UTC", calendar); + +assert.sameValue(isodate.yearOfWeek, 2020); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/non-iso-week-of-year.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/non-iso-week-of-year.js new file mode 100644 index 0000000000..58f0b6a5ff --- /dev/null +++ b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/non-iso-week-of-year.js @@ -0,0 +1,27 @@ +// |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.zoneddatetime.prototype.yearofweek +description: > + Temporal.ZonedDateTime.prototype.yearOfWeek returns undefined for all + non-ISO calendars without a well-defined week numbering system. +features: [Temporal] +---*/ + +// Gregorian calendar has a well defined week-numbering system. + +let calendar = new Temporal.Calendar("gregory"); + +// Epoch Nanoseconds for new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); +const date = new Temporal.ZonedDateTime(1_704_112_496_987_654_321n, "UTC", calendar); + +assert.sameValue(date.yearOfWeek, 2024); + +calendar = new Temporal.Calendar("hebrew"); +const nonisodate = new Temporal.ZonedDateTime(1_704_112_496_987_654_321n, "UTC", calendar); + +assert.sameValue(nonisodate.yearOfWeek, undefined); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/shell.js b/js/src/tests/test262/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/intl402/TypedArray/prototype/toLocaleString/calls-toLocaleString-number-elements.js b/js/src/tests/test262/intl402/TypedArray/prototype/toLocaleString/calls-toLocaleString-number-elements.js index c6b895e5db..133d6bb5d7 100644 --- a/js/src/tests/test262/intl402/TypedArray/prototype/toLocaleString/calls-toLocaleString-number-elements.js +++ b/js/src/tests/test262/intl402/TypedArray/prototype/toLocaleString/calls-toLocaleString-number-elements.js @@ -1,3 +1,4 @@ +// |reftest| shell-option(--enable-float16array) // Copyright (C) 2018 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/jstests.list b/js/src/tests/test262/jstests.list index 84cb15a834..e904904c30 100644 --- a/js/src/tests/test262/jstests.list +++ b/js/src/tests/test262/jstests.list @@ -1,5 +1,8 @@ # GENERATED, DO NOT EDIT +test262-raw error:Test262Error script annexB/language/comments/single-line-html-close-first-line-1.js +test262-raw error:Test262Error script annexB/language/comments/single-line-html-close-first-line-2.js +test262-raw error:Test262Error script annexB/language/comments/single-line-html-close-first-line-3.js test262-raw error:SyntaxError script language/comments/hashbang/escaped-bang-041.js test262-raw error:SyntaxError script language/comments/hashbang/escaped-bang-u0021.js test262-raw error:SyntaxError script language/comments/hashbang/escaped-bang-u21.js diff --git a/js/src/tests/test262/language/expressions/assignment/S11.13.1_A7_T3.js b/js/src/tests/test262/language/expressions/assignment/S11.13.1_A7_T3.js deleted file mode 100644 index 8675448e23..0000000000 --- a/js/src/tests/test262/language/expressions/assignment/S11.13.1_A7_T3.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (C) 2015 André Bargull. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Assignment Operator evaluates its operands from left to right. -description: > - The left-hand side expression is evaluated before the right-hand side. - Left-hand side expression is MemberExpression: base[prop]. Evaluating - ToPropertyKey(prop) throws an error. ----*/ - -function DummyError() { } - -assert.throws(DummyError, function() { - var base = {}; - var prop = { - toString: function() { - throw new DummyError(); - } - }; - var expr = function() { - throw new Test262Error("right-hand side expression evaluated"); - }; - - base[prop] = expr(); -}); - -reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/assignment/target-member-computed-reference.js b/js/src/tests/test262/language/expressions/assignment/target-member-computed-reference.js new file mode 100644 index 0000000000..fefc73370f --- /dev/null +++ b/js/src/tests/test262/language/expressions/assignment/target-member-computed-reference.js @@ -0,0 +1,42 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// Copyright (C) 2024 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-assignment-operators +description: Assignment Operator evaluates its operands from left to right (formerly S11.13.1_A7_T3) +info: | + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. + ToPropertyKey(prop) occurs after both sides are evaluated. +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = {}; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + throw new Test262Error("right-hand side expression evaluated"); + }; + + base[prop()] = expr(); +}); + +assert.throws(DummyError, function() { + var base = {}; + var prop = { + toString: function() { + throw new Test262Error("property key evaluated"); + } + }; + var expr = function() { + throw new DummyError(); + }; + + base[prop] = expr(); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/assignment/target-super-computed-reference.js b/js/src/tests/test262/language/expressions/assignment/target-super-computed-reference.js new file mode 100644 index 0000000000..39d692a81b --- /dev/null +++ b/js/src/tests/test262/language/expressions/assignment/target-super-computed-reference.js @@ -0,0 +1,51 @@ +// Copyright (C) 2024 Sony Interactive Entertainment Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-assignment-operators +description: Assignment Operator evaluates its operands from left to right +info: | + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: super[prop]. + ToPropertyKey(prop) occurs after both sides are evaluated. +---*/ + +function DummyError() {} + +assert.throws(DummyError, function() { + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + throw new Test262Error("right-hand side expression evaluated"); + }; + + class C extends class {} { + m() { + super[prop()] = expr(); + } + } + + (new C()).m(); +}); + +assert.throws(DummyError, function() { + var prop = { + toString: function() { + throw new Test262Error("property key evaluated"); + } + }; + var expr = function() { + throw new DummyError(); + }; + + class C extends class {} { + m() { + super[prop] = expr(); + } + } + + (new C()).m(); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/global-code/script-decl-lex-var-declared-via-eval-sloppy.js b/js/src/tests/test262/language/global-code/script-decl-lex-var-declared-via-eval-sloppy.js deleted file mode 100644 index 85c144b666..0000000000 --- a/js/src/tests/test262/language/global-code/script-decl-lex-var-declared-via-eval-sloppy.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (C) 2023 Alexey Shvayka. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-globaldeclarationinstantiation -description: Let binding collision with existing var declaration that was created via eval(). -info: | - [...] - 3. For each element name of lexNames, do - a. If env.HasVarDeclaration(name) is true, throw a SyntaxError exception. -flags: [noStrict] ----*/ - -eval('var test262Var;'); -eval('function test262Fn() {}'); - -assert.throws(SyntaxError, function() { - $262.evalScript('var x; let test262Var;'); -}, 'variable'); - -assert.throws(ReferenceError, function() { - x; -}, 'no bindings created (script shadowing variable)'); - -assert.throws(SyntaxError, function() { - $262.evalScript('var x; let test262Fn;'); -}, 'function'); - -assert.throws(ReferenceError, function() { - x; -}, 'no bindings created (script shadowing function)'); - -reportCompare(0, 0); diff --git a/js/src/tests/test262/language/global-code/script-decl-lex-var-declared-via-eval-strict-strict.js b/js/src/tests/test262/language/global-code/script-decl-lex-var-declared-via-eval-strict-strict.js deleted file mode 100644 index 34c2685a80..0000000000 --- a/js/src/tests/test262/language/global-code/script-decl-lex-var-declared-via-eval-strict-strict.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; -// Copyright (C) 2023 Alexey Shvayka. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-globaldeclarationinstantiation -description: No let binding collision with existing var declaration due to strict-mode eval(). -info: | - PerformEval ( x, strictCaller, direct ) - - [...] - 16. If direct is true, then - a. Let lexEnv be NewDeclarativeEnvironment(runningContext's LexicalEnvironment). - [...] - 18. If strictEval is true, set varEnv to lexEnv. -flags: [onlyStrict] ----*/ - -eval('var test262Var;'); -eval('function test262Fn() {}'); - -$262.evalScript('let test262Var = 1;'); -assert.sameValue(test262Var, 1); - -$262.evalScript('const test262Fn = 2;'); -assert.sameValue(test262Fn, 2); - -reportCompare(0, 0); diff --git a/js/src/tests/test262/language/global-code/script-decl-lex-var-declared-via-eval.js b/js/src/tests/test262/language/global-code/script-decl-lex-var-declared-via-eval.js new file mode 100644 index 0000000000..a92cca7b41 --- /dev/null +++ b/js/src/tests/test262/language/global-code/script-decl-lex-var-declared-via-eval.js @@ -0,0 +1,38 @@ +// Copyright (C) 2023 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-globaldeclarationinstantiation +description: No let binding collision with existing var declaration due to eval(). +info: | + In strict mode: + + PerformEval ( x, strictCaller, direct ) + + [...] + 16. If direct is true, then + a. Let lexEnv be NewDeclarativeEnvironment(runningContext's LexicalEnvironment). + [...] + 18. If strictEval is true, set varEnv to lexEnv. + + In sloppy mode: + + GlobalDeclarationInstantiation ( script, env ) + + [...] + 3. For each element name of lexNames, do + a. If env.HasLexicalDeclaration(name) is true, throw a SyntaxError exception. + b. Let hasRestrictedGlobal be ? env.HasRestrictedGlobalProperty(name). + c. NOTE: Global var and function bindings (except those that are introduced by non-strict direct eval) are non-configurable and are therefore restricted global properties. + d. If hasRestrictedGlobal is true, throw a SyntaxError exception. +---*/ + +eval('var test262Var;'); +eval('function test262Fn() {}'); + +$262.evalScript('let test262Var = 1;'); +assert.sameValue(test262Var, 1); + +$262.evalScript('const test262Fn = 2;'); +assert.sameValue(test262Fn, 2); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-i.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-i.js new file mode 100644 index 0000000000..a63c3e1af7 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-i.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?i-i:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-m.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-m.js new file mode 100644 index 0000000000..c3b44f4796 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-m.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?m-m:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-multi-duplicate.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-multi-duplicate.js new file mode 100644 index 0000000000..92cfb0457d --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-multi-duplicate.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?ims-m:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-s-escape.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-s-escape.js new file mode 100644 index 0000000000..b8937aaa07 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-s-escape.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?\u{0073}-s:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-s.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-s.js new file mode 100644 index 0000000000..e8d09f4cc6 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-add-remove-s.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?s-s:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-both-empty.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-both-empty.js new file mode 100644 index 0000000000..db06a2eb86 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-both-empty.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by the first RegularExpressionFlags and the source text matched by the second RegularExpressionFlags are both empty. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-code-point-repeat-i-1.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-code-point-repeat-i-1.js new file mode 100644 index 0000000000..78c275e17f --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-code-point-repeat-i-1.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-ii:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-code-point-repeat-i-2.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-code-point-repeat-i-2.js new file mode 100644 index 0000000000..16f52d86f5 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-code-point-repeat-i-2.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-imsi:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-no-colon-1.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-no-colon-1.js new file mode 100644 index 0000000000..a392d5b0e0 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-no-colon-1.js @@ -0,0 +1,19 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Regular expression modifiers should not parse without the colon. +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... +---*/ + +$DONOTEVALUATE(); + +/(?ms-i)/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-no-colon-2.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-no-colon-2.js new file mode 100644 index 0000000000..46c3f4db43 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-no-colon-2.js @@ -0,0 +1,19 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Regular expression modifiers should not parse without the colon. +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... +---*/ + +$DONOTEVALUATE(); + +/(?-s)/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-no-colon-3.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-no-colon-3.js new file mode 100644 index 0000000000..e44077389c --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-no-colon-3.js @@ -0,0 +1,19 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Regular expression modifiers should not parse without the colon. +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... +---*/ + +$DONOTEVALUATE(); + +/(?i-)/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-arbitrary.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-arbitrary.js new file mode 100644 index 0000000000..62a138a3aa --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-arbitrary.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-1:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-combining-i.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-combining-i.js new file mode 100644 index 0000000000..958024fe65 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-combining-i.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-iͥ:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-combining-m.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-combining-m.js new file mode 100644 index 0000000000..45284e6d38 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-combining-m.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-mͫ:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-combining-s.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-combining-s.js new file mode 100644 index 0000000000..35bda819bd --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-combining-s.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-s̀:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-d.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-d.js new file mode 100644 index 0000000000..6567f99c37 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-d.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-d:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-g.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-g.js new file mode 100644 index 0000000000..ec8b2f03f8 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-g.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-g:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-non-display-1.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-non-display-1.js new file mode 100644 index 0000000000..e88cb7a696 Binary files /dev/null and b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-non-display-1.js differ diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-non-display-2.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-non-display-2.js new file mode 100644 index 0000000000..90816752fb --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-non-display-2.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-s‎:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-non-flag.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-non-flag.js new file mode 100644 index 0000000000..cd8ae0baf9 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-non-flag.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-Q:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-u.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-u.js new file mode 100644 index 0000000000..23a1f23b72 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-u.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-u:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-uppercase-I.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-uppercase-I.js new file mode 100644 index 0000000000..be6d2e61dc --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-uppercase-I.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-I:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-y.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-y.js new file mode 100644 index 0000000000..d65d6e6874 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-y.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-y:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-zwj.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-zwj.js new file mode 100644 index 0000000000..84e7253ef8 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-zwj.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-s‍:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-zwnbsp.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-zwnbsp.js new file mode 100644 index 0000000000..7acc6a49e3 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-zwnbsp.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-s:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-zwnj.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-zwnj.js new file mode 100644 index 0000000000..118ff69976 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-other-code-point-zwnj.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-s‌:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-i.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-i.js new file mode 100644 index 0000000000..a63c3e1af7 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-i.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?i-i:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-m.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-m.js new file mode 100644 index 0000000000..c3b44f4796 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-m.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?m-m:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-multi-duplicate.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-multi-duplicate.js new file mode 100644 index 0000000000..20ad04b60d --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-multi-duplicate.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?m-ims:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-s-escape.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-s-escape.js new file mode 100644 index 0000000000..a3b3263fdf --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-s-escape.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?s-\u{0073}:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-s.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-s.js new file mode 100644 index 0000000000..e8d09f4cc6 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-add-remove-s.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the any code point in the source text matched by the first RegularExpressionFlags is also contained in the source text matched by the second RegularExpressionFlags. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?s-s:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-code-point-repeat-i-1.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-code-point-repeat-i-1.js new file mode 100644 index 0000000000..80352f948e --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-code-point-repeat-i-1.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?ii-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-code-point-repeat-i-2.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-code-point-repeat-i-2.js new file mode 100644 index 0000000000..1793724cfa --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-code-point-repeat-i-2.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?imsi-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-arbitrary.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-arbitrary.js new file mode 100644 index 0000000000..996963dbd0 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-arbitrary.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?1-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-combining-i.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-combining-i.js new file mode 100644 index 0000000000..616a537acb --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-combining-i.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?iͥ-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-combining-m.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-combining-m.js new file mode 100644 index 0000000000..6fa734c89a --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-combining-m.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?mͫ-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-combining-s.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-combining-s.js new file mode 100644 index 0000000000..d3d5aa8ce3 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-combining-s.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?s̀-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-d.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-d.js new file mode 100644 index 0000000000..b91c8bd612 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-d.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?d-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-g.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-g.js new file mode 100644 index 0000000000..c1e99de1ad --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-g.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?g-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-non-display-1.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-non-display-1.js new file mode 100644 index 0000000000..eec06fce52 Binary files /dev/null and b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-non-display-1.js differ diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-non-display-2.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-non-display-2.js new file mode 100644 index 0000000000..6a00b90484 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-non-display-2.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?s‎-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-non-flag.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-non-flag.js new file mode 100644 index 0000000000..e351dd2e3b --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-non-flag.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?Q-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-u.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-u.js new file mode 100644 index 0000000000..ae33a9ae34 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-u.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?u-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-uppercase-I.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-uppercase-I.js new file mode 100644 index 0000000000..c177ef76c7 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-uppercase-I.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?I-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-y.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-y.js new file mode 100644 index 0000000000..65383882cc --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-y.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?y-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-zwj.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-zwj.js new file mode 100644 index 0000000000..c3d3032ea0 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-zwj.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?s‍-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-zwnbsp.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-zwnbsp.js new file mode 100644 index 0000000000..e4b702e4a7 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-zwnbsp.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?s-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-zwnj.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-zwnj.js new file mode 100644 index 0000000000..eff2688281 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-other-code-point-zwnj.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?s‌-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-case-fold-i.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-case-fold-i.js new file mode 100644 index 0000000000..7b922f651c --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-case-fold-i.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?I-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-case-fold-m.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-case-fold-m.js new file mode 100644 index 0000000000..189fce143c --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-case-fold-m.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?M-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-case-fold-s.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-case-fold-s.js new file mode 100644 index 0000000000..47dbf5aa9a --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-case-fold-s.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?S-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-unicode-case-fold-i.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-unicode-case-fold-i.js new file mode 100644 index 0000000000..106b9b2add --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-unicode-case-fold-i.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case-folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?İ-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-unicode-case-fold-s.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-unicode-case-fold-s.js new file mode 100644 index 0000000000..7b15fe7a09 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-reverse-should-not-unicode-case-fold-s.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case-folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?ſ-:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-case-fold-i.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-case-fold-i.js new file mode 100644 index 0000000000..c07e0041c0 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-case-fold-i.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-I:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-case-fold-m.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-case-fold-m.js new file mode 100644 index 0000000000..4afe34ff44 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-case-fold-m.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-M:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-case-fold-s.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-case-fold-s.js new file mode 100644 index 0000000000..e83af36569 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-case-fold-s.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-S:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-unicode-case-fold-i.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-unicode-case-fold-i.js new file mode 100644 index 0000000000..2a948073f0 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-unicode-case-fold-i.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case-folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-İ:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-unicode-case-fold-s.js b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-unicode-case-fold-s.js new file mode 100644 index 0000000000..7c2f23c502 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-arithmetic-modifiers-should-not-unicode-case-fold-s.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case-folded to "i", "m", or "s" (arithmetic regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpressionFlags - RegularExpressionFlags : Disjunction ) + ... + +---*/ + +$DONOTEVALUATE(); + +/(?-ſ:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-code-point-repeat-i-1.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-code-point-repeat-i-1.js new file mode 100644 index 0000000000..ff0d589e26 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-code-point-repeat-i-1.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?ii:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-code-point-repeat-i-2.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-code-point-repeat-i-2.js new file mode 100644 index 0000000000..7975935725 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-code-point-repeat-i-2.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?imsi:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-arbitrary.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-arbitrary.js new file mode 100644 index 0000000000..6569bbef01 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-arbitrary.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?1:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-combining-i.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-combining-i.js new file mode 100644 index 0000000000..7d557532d8 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-combining-i.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?iͥ:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-combining-m.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-combining-m.js new file mode 100644 index 0000000000..a09130e2df --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-combining-m.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?mͫ:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-combining-s.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-combining-s.js new file mode 100644 index 0000000000..a83fe10f9d --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-combining-s.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?s̀:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-d.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-d.js new file mode 100644 index 0000000000..559b7b4566 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-d.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?d:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-g.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-g.js new file mode 100644 index 0000000000..92304ef165 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-g.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?g:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-non-display-1.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-non-display-1.js new file mode 100644 index 0000000000..102dee02bc Binary files /dev/null and b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-non-display-1.js differ diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-non-display-2.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-non-display-2.js new file mode 100644 index 0000000000..b005b43c67 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-non-display-2.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?s‎:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-non-flag.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-non-flag.js new file mode 100644 index 0000000000..d144b58bd1 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-non-flag.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?Q:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-u.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-u.js new file mode 100644 index 0000000000..94805b1c8e --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-u.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?u:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-uppercase-I.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-uppercase-I.js new file mode 100644 index 0000000000..a1bd269c61 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-uppercase-I.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?I:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-y.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-y.js new file mode 100644 index 0000000000..399f5d8837 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-y.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?y:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-zwj.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-zwj.js new file mode 100644 index 0000000000..5f3c392313 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-zwj.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?s‍:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-zwnbsp.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-zwnbsp.js new file mode 100644 index 0000000000..37b0bf301b --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-zwnbsp.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?s:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-zwnj.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-zwnj.js new file mode 100644 index 0000000000..5889fc154d --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-other-code-point-zwnj.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code point other than i, m, or s, or if it contains the same code point more than once. (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?s‌:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-case-fold-i.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-case-fold-i.js new file mode 100644 index 0000000000..0c50a15058 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-case-fold-i.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?I:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-case-fold-m.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-case-fold-m.js new file mode 100644 index 0000000000..38e290647e --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-case-fold-m.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?M:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-case-fold-s.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-case-fold-s.js new file mode 100644 index 0000000000..a2c4ba26db --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-case-fold-s.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case folded to "i", "m", or "s" (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?S:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-case-fold-i.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-case-fold-i.js new file mode 100644 index 0000000000..3a4efff07d --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-case-fold-i.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case-folded to "i", "m", or "s" (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?İ:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-case-fold-s.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-case-fold-s.js new file mode 100644 index 0000000000..32ebb024e2 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-case-fold-s.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Code points other than "i", "m", "s" should not be case-folded to "i", "m", or "s" (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?ſ:a)//*{ global-modifiers }*/; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-escape-i.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-escape-i.js new file mode 100644 index 0000000000..b2493e3855 --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-escape-i.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Source text cannot use unicode escape sequences to express code points "i", "m", "s" (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?\u0069:a)/u /* i */; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-escape-m.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-escape-m.js new file mode 100644 index 0000000000..cd1e66099c --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-escape-m.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Source text cannot use unicode escape sequences to express code points "i", "m", "s" (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?\u006D:a)/u /* m */; diff --git a/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-escape-s.js b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-escape-s.js new file mode 100644 index 0000000000..145ab4fe4a --- /dev/null +++ b/js/src/tests/test262/language/literals/regexp/early-err-modifiers-should-not-unicode-escape-s.js @@ -0,0 +1,20 @@ +// |reftest| skip error:SyntaxError -- regexp-modifiers is not supported +// Copyright (C) 2024 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Source text cannot use unicode escape sequences to express code points "i", "m", "s" (regular expression flags) +esid: sec-patterns-static-semantics-early-errors +features: [regexp-modifiers] +negative: + phase: parse + type: SyntaxError +info: | + Atom :: ( ? RegularExpresisonFlags : Disjunction ) + It is a Syntax Error if the source text matched by RegularExpressionFlags contains any code points other than "i", "m", "s", or if it contains the same code point more than once. + +---*/ + +$DONOTEVALUATE(); + +/(?\u0073:a)/u /* s */; diff --git a/js/src/tests/test262/language/module-code/import-attributes/allow-nlt-before-with.js b/js/src/tests/test262/language/module-code/import-attributes/allow-nlt-before-with.js index ed6c329c92..73131843af 100644 --- a/js/src/tests/test262/language/module-code/import-attributes/allow-nlt-before-with.js +++ b/js/src/tests/test262/language/module-code/import-attributes/allow-nlt-before-with.js @@ -7,7 +7,7 @@ description: > esid: sec-modules info: | ImportDeclaration: - import ModuleSpecifier[no LineTerminator here] WithClause; + import ModuleSpecifier WithClause; WithClause: AttributesKeyword {} diff --git a/js/src/tests/test262/language/module-code/top-level-await/async-module-does-not-block-sibling-modules.js b/js/src/tests/test262/language/module-code/top-level-await/async-module-does-not-block-sibling-modules.js new file mode 100644 index 0000000000..c7c5e2f35f --- /dev/null +++ b/js/src/tests/test262/language/module-code/top-level-await/async-module-does-not-block-sibling-modules.js @@ -0,0 +1,17 @@ +// |reftest| module async +// Copyright (C) 2023 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-innermoduleevaluation +description: > + While an asynchronous module is waiting for a promise resolution, + sibling modules in the modules graph must be evaluated. +flags: [module, async] +features: [top-level-await] +---*/ + +import "./async-module-tla_FIXTURE.js"; +import { check } from "./async-module-sync_FIXTURE.js"; +assert.sameValue(check, false); +$DONE(); diff --git a/js/src/tests/test262/language/module-code/top-level-await/async-module-sync_FIXTURE.js b/js/src/tests/test262/language/module-code/top-level-await/async-module-sync_FIXTURE.js new file mode 100644 index 0000000000..a6595716be --- /dev/null +++ b/js/src/tests/test262/language/module-code/top-level-await/async-module-sync_FIXTURE.js @@ -0,0 +1,5 @@ +// |reftest| skip -- not a test file +// Copyright (C) 2023 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +export const { check } = globalThis; diff --git a/js/src/tests/test262/language/module-code/top-level-await/async-module-tla_FIXTURE.js b/js/src/tests/test262/language/module-code/top-level-await/async-module-tla_FIXTURE.js new file mode 100644 index 0000000000..b5a0b046b2 --- /dev/null +++ b/js/src/tests/test262/language/module-code/top-level-await/async-module-tla_FIXTURE.js @@ -0,0 +1,7 @@ +// |reftest| skip -- not a test file +// Copyright (C) 2023 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +globalThis.check = false; +await 0; +globalThis.check = true; diff --git a/js/src/tests/test262/language/statements/class/subclass/builtin-objects/TypedArray/regular-subclassing.js b/js/src/tests/test262/language/statements/class/subclass/builtin-objects/TypedArray/regular-subclassing.js index dc22b74e0f..69722f58e3 100644 --- a/js/src/tests/test262/language/statements/class/subclass/builtin-objects/TypedArray/regular-subclassing.js +++ b/js/src/tests/test262/language/statements/class/subclass/builtin-objects/TypedArray/regular-subclassing.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/language/statements/class/subclass/builtin-objects/TypedArray/super-must-be-called.js b/js/src/tests/test262/language/statements/class/subclass/builtin-objects/TypedArray/super-must-be-called.js index 04b4638390..e75fbfe30b 100644 --- a/js/src/tests/test262/language/statements/class/subclass/builtin-objects/TypedArray/super-must-be-called.js +++ b/js/src/tests/test262/language/statements/class/subclass/builtin-objects/TypedArray/super-must-be-called.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/staging/Intl402/Temporal/old/non-iso-calendars.js b/js/src/tests/test262/staging/Intl402/Temporal/old/non-iso-calendars.js index a4f1a2908f..4639e58e9e 100644 --- a/js/src/tests/test262/staging/Intl402/Temporal/old/non-iso-calendars.js +++ b/js/src/tests/test262/staging/Intl402/Temporal/old/non-iso-calendars.js @@ -6,6 +6,26 @@ esid: sec-temporal-intl description: Non-ISO Calendars features: [Temporal, Array.prototype.includes] +locale: + - en-US-u-ca-iso8601 + - en-US-u-ca-buddhist + - en-US-u-ca-chinese + - en-US-u-ca-coptic + - en-US-u-ca-dangi + - en-US-u-ca-ethioaa + - en-US-u-ca-ethiopic + - en-US-u-ca-gregory + - en-US-u-ca-hebrew + - en-US-u-ca-indian + - en-US-u-ca-islamic + - en-US-u-ca-islamic-umalqura + - en-US-u-ca-islamic-tbla + - en-US-u-ca-islamic-civil + - en-US-u-ca-islamic-rgsa + - en-US-u-ca-islamicc + - en-US-u-ca-japanese + - en-US-u-ca-persian + - en-US-u-ca-roc ---*/ var testChineseData = new Date("2001-02-01T00:00Z").toLocaleString("en-US-u-ca-chinese", { @@ -18,69 +38,256 @@ var testChineseData = new Date("2001-02-01T00:00Z").toLocaleString("en-US-u-ca-c var hasOutdatedChineseIcuData = !testChineseData.endsWith("2001"); // verify that Intl.DateTimeFormat.formatToParts output matches snapshot data -var getLocalizedDates = isoString => { - var calendars = [ - "iso8601", - "buddhist", - "chinese", - "coptic", - "dangi", - "ethioaa", - "ethiopic", - "gregory", - "hebrew", - "indian", - "islamic", - "islamic-umalqura", - "islamic-tbla", - "islamic-civil", - "islamic-rgsa", - "islamicc", - "japanese", - "persian", - "roc" - ]; - var date = new Date(isoString); - return calendars.map(id => `${ id }: ${ date.toLocaleDateString(`en-US-u-ca-${ id }`, { timeZone: "UTC" }) }`).join("\n"); -}; -var year2000Content = getLocalizedDates("2000-01-01T00:00Z"); -var year1Content = getLocalizedDates("0001-01-01T00:00Z"); -var year2000Snapshot = "iso8601: 1/1/2000\n" + "buddhist: 1/1/2543 BE\n" + "chinese: 11/25/1999\n" + "coptic: 4/22/1716 ERA1\n" + "dangi: 11/25/1999\n" + "ethioaa: 4/22/7492 ERA0\n" + "ethiopic: 4/22/1992 ERA1\n" + "gregory: 1/1/2000\n" + "hebrew: 23 Tevet 5760\n" + "indian: 10/11/1921 Saka\n" + "islamic: 9/25/1420 AH\n" + "islamic-umalqura: 9/24/1420 AH\n" + "islamic-tbla: 9/25/1420 AH\n" + "islamic-civil: 9/24/1420 AH\n" + "islamic-rgsa: 9/25/1420 AH\n" + "islamicc: 9/24/1420 AH\n" + "japanese: 1/1/12 H\n" + "persian: 10/11/1378 AP\n" + "roc: 1/1/89 Minguo"; -assert.sameValue(year2000Content, year2000Snapshot); +function compareFormatToPartsSnapshot(isoString, expected) { + const date = new Date(isoString); + Object.entries(expected).forEach(([calendar, expectedComponents]) => { + const formatter = new Intl.DateTimeFormat(`en-US-u-ca-${calendar}`, { timeZone: "UTC" }); + const actualComponents = formatter.formatToParts(date); + Object.entries(expectedComponents).forEach(([expectedType, expectedValue]) => { + const part = actualComponents.find(({type}) => type === expectedType); + const contextMessage = `${expectedType} component of ${isoString} formatted in ${calendar}`; + assert.notSameValue(part, undefined, contextMessage); + assert.sameValue(part.value, `${expectedValue}`, contextMessage); + }); + }); +} + +compareFormatToPartsSnapshot("2000-01-01T00:00Z", { + iso8601: { + year: 2000, + month: 1, + day: 1, + }, + buddhist: { + year: 2543, + era: "BE", + month: 1, + day: 1, + }, + chinese: { + relatedYear: 1999, + month: 11, + day: 25, + }, + coptic: { + year: 1716, + era: "ERA1", + month: 4, + day: 22, + }, + dangi: { + relatedYear: 1999, + month: 11, + day: 25, + }, + ethioaa: { + year: 7492, + era: "ERA0", + month: 4, + day: 22, + }, + ethiopic: { + year: 1992, + era: "ERA1", + month: 4, + day: 22, + }, + gregory: { + year: 2000, + month: 1, + day: 1, + }, + hebrew: { + year: 5760, + month: "Tevet", + day: 23, + }, + indian: { + year: 1921, + era: "Saka", + month: 10, + day: 11, + }, + islamic: { + year: 1420, + era: "AH", + month: 9, + day: 25, + }, + "islamic-umalqura": { + year: 1420, + era: "AH", + month: 9, + day: 24, + }, + "islamic-tbla": { + year: 1420, + era: "AH", + month: 9, + day: 25, + }, + "islamic-civil": { + year: 1420, + era: "AH", + month: 9, + day: 24, + }, + "islamic-rgsa": { + year: 1420, + era: "AH", + month: 9, + day: 25, + }, + islamicc: { + year: 1420, + era: "AH", + month: 9, + day: 24, + }, + japanese: { + year: 12, + era: "H", + month: 1, + day: 1, + }, + persian: { + year: 1378, + era: "AP", + month: 10, + day: 11, + }, + roc: { + year: 89, + era: "Minguo", + month: 1, + day: 1, + }, +}); // Several calendars based on the Gregorian calendar use Julian dates (not // proleptic Gregorian dates) before the Gregorian switchover in Oct 1582. See // https://bugs.chromium.org/p/chromium/issues/detail?id=1173158. The code below // allows these tests to pass regardless of the bug, while still remaining // sensitive to other bugs that may crop up. -const yearOneMonthDay = new Map( +const yearOneDay = new Map( ["iso8601", "gregory", "roc", "buddhist", "japanese"].map(calendar => { hasGregorianSwitchoverBug = new Date("+001001-01-01T00:00Z") .toLocaleDateString(`en-US-u-ca-${calendar}`, { timeZone: "UTC" }) .startsWith("12"); - return [calendar, hasGregorianSwitchoverBug ? "1/3" : "1/1"] + return [calendar, hasGregorianSwitchoverBug ? 3 : 1] })); -var year1Snapshot = - `iso8601: ${yearOneMonthDay.get("iso8601")}/1\n` + - `buddhist: ${yearOneMonthDay.get("buddhist")}/544 BE\n` + - "chinese: 11/21/0\n" + - "coptic: 5/8/284 ERA0\n" + - "dangi: 11/21/0\n" + - "ethioaa: 5/8/5493 ERA0\n" + - "ethiopic: 5/8/5493 ERA0\n" + - `gregory: ${yearOneMonthDay.get("gregory")}/1\n` + - "hebrew: 18 Tevet 3761\n" + - "indian: 10/11/-78 Saka\n" + - "islamic: 5/20/-640 AH\n" + - "islamic-umalqura: 5/18/-640 AH\n" + - "islamic-tbla: 5/19/-640 AH\n" + - "islamic-civil: 5/18/-640 AH\n" + - "islamic-rgsa: 5/20/-640 AH\n" + - "islamicc: 5/18/-640 AH\n" + - `japanese: ${yearOneMonthDay.get("japanese")}/-643 Taika (645\u2013650)\n` + - "persian: 10/11/-621 AP\n" + - `roc: ${yearOneMonthDay.get("roc")}/1911 B.R.O.C.`; -assert.sameValue(year1Content, year1Snapshot); +compareFormatToPartsSnapshot("0001-01-01T00:00Z", { + iso8601: { + year: 1, + month: 1, + day: yearOneDay.get("iso8601"), + }, + buddhist: { + year: 544, + era: "BE", + month: 1, + day: yearOneDay.get("buddhist"), + }, + chinese: { + relatedYear: 0, + month: 11, + day: 21, + }, + coptic: { + year: 284, + era: "ERA0", + month: 5, + day: 8, + }, + dangi: { + relatedYear: 0, + month: 11, + day: 21, + }, + ethioaa: { + year: 5493, + era: "ERA0", + month: 5, + day: 8, + }, + ethiopic: { + year: 5493, + era: "ERA0", + month: 5, + day: 8, + }, + gregory: { + year: 1, + month: 1, + day: yearOneDay.get("gregory"), + }, + hebrew: { + year: 3761, + month: "Tevet", + day: 18, + }, + indian: { + year: -78, + era: "Saka", + month: 10, + day: 11, + }, + islamic: { + year: -640, + era: "AH", + month: 5, + day: 20, + }, + "islamic-umalqura": { + year: -640, + era: "AH", + month: 5, + day: 18, + }, + "islamic-tbla": { + year: -640, + era: "AH", + month: 5, + day: 19, + }, + "islamic-civil": { + year: -640, + era: "AH", + month: 5, + day: 18, + }, + "islamic-rgsa": { + year: -640, + era: "AH", + month: 5, + day: 20, + }, + islamicc: { + year: -640, + era: "AH", + month: 5, + day: 18, + }, + japanese: { + year: -643, + era: "Taika (645\u2013650)", + month: 1, + day: yearOneDay.get("japanese"), + }, + persian: { + year: -621, + era: "AP", + month: 10, + day: 11, + }, + roc: { + year: 1911, + era: "B.R.O.C.", + month: 1, + day: yearOneDay.get("roc"), + }, +}); + var fromWithCases = { iso8601: { year2000: { @@ -331,8 +538,6 @@ var fromWithCases = { year1: RangeError } }; -var logPerf = false; -var totalNow = 0; for (var [id, tests] of Object.entries(fromWithCases)) { var dates = { year2000: Temporal.PlainDate.from("2000-01-01"), @@ -342,7 +547,6 @@ for (var [id, tests] of Object.entries(fromWithCases)) { var values = tests[name]; var errorExpected = values === RangeError; if ((id === "chinese" || id === "dangi") && hasOutdatedChineseIcuData ) { - var now = globalThis.performance ? globalThis.performance.now() : Date.now(); if (errorExpected) { assert.throws(RangeError, () => { var inCal = date.withCalendar(id); @@ -411,13 +615,8 @@ for (var [id, tests] of Object.entries(fromWithCases)) { monthCode: values.monthCode, year: values.year })); - var ms = (globalThis.performance ? globalThis.performance.now() : Date.now()) - now; - totalNow += ms; - if (logPerf) - console.log(`from: ${ id } ${ name }: ${ ms.toFixed(2) }ms, total: ${ totalNow.toFixed(2) }ms`); }; if ((id === "chinese" || id === "dangi") && hasOutdatedChineseIcuData ) { - var now = globalThis.performance ? globalThis.performance.now() : Date.now(); var inCal = date.withCalendar(id); if (errorExpected) { assert.throws(RangeError, () => inCal.with({ day: 1 }).year); @@ -437,10 +636,6 @@ for (var [id, tests] of Object.entries(fromWithCases)) { assert.sameValue(`${ t } year: ${ afterWithYear.year }`, `${ t } year: 2220`); assert.sameValue(`${ t } month: ${ afterWithYear.month }`, `${ t } month: 1`); assert.sameValue(`${ t } day: ${ afterWithYear.day }`, `${ t } day: 1`); - var ms = (globalThis.performance ? globalThis.performance.now() : Date.now()) - now; - totalNow += ms; - if (logPerf) - console.log(`with: ${ id } ${ name }: ${ ms.toFixed(2) }ms, total: ${ totalNow.toFixed(2) }ms`); }; } } @@ -660,13 +855,11 @@ var tests = { } } }; -var calendars = Object.keys(addMonthsCases); -for (var id of calendars) { +for (var id of Object.keys(addMonthsCases)) { for (var [unit, {duration, results, startDate}] of Object.entries(tests)) { var values = results[id]; duration = Temporal.Duration.from(duration); if ((id === "chinese" || id === "dangi") && hasOutdatedChineseIcuData ) { - var now = globalThis.performance ? globalThis.performance.now() : Date.now(); if (values === RangeError) { assert.throws(RangeError, () => Temporal.PlainDate.from({ ...startDate, @@ -722,10 +915,6 @@ for (var id of calendars) { assert.sameValue(`subtract from end-of-month ${ unit } ${ id } month: ${ startReverseNextDay.month }`, `subtract from end-of-month ${ unit } ${ id } month: ${ start.month }`); assert.sameValue(`subtract from end-of-month ${ unit } ${ id } monthCode: ${ startReverseNextDay.monthCode }`, `subtract from end-of-month ${ unit } ${ id } monthCode: ${ start.monthCode }`); } - var ms = (globalThis.performance ? globalThis.performance.now() : Date.now()) - now; - totalNow += ms; - if (logPerf) - console.log(`${ id } add ${ duration }: ${ ms.toFixed(2) }ms, total: ${ totalNow.toFixed(2) }ms`); }; } } @@ -1080,7 +1269,7 @@ var daysInMonthCases = { } }; totalNow = 0; -for (var id of calendars) { +for (var id of Object.keys(daysInMonthCases)) { var {year, leap, days} = daysInMonthCases[id]; var date = hasOutdatedChineseIcuData && (id === "chinese" || id === "dangi") ? undefined : Temporal.PlainDate.from({ year, @@ -1098,7 +1287,6 @@ for (var id of calendars) { } }; if ((id === "chinese" || id === "dangi") && hasOutdatedChineseIcuData ) { - var now = globalThis.performance ? globalThis.performance.now() : Date.now(); var {monthsInYear} = date; assert.sameValue(monthsInYear, days.length); for (var i = monthsInYear, leapMonthIndex = undefined, monthStart = undefined; i >= 1; i--) { @@ -1142,10 +1330,6 @@ for (var id of calendars) { var oneDayPastMonthEnd = monthStart.with({ day: daysInMonth + 1 }); assert.sameValue(oneDayPastMonthEnd.day, daysInMonth); } - var ms = (globalThis.performance ? globalThis.performance.now() : Date.now()) - now; - totalNow += ms; - if (logPerf) - console.log(`${ id } months check ${ id }: ${ ms.toFixed(2) }ms, total: ${ totalNow.toFixed(2) }ms`); }; } var monthDayCases = [ diff --git a/js/src/tests/test262/staging/Temporal/Duration/old/shell.js b/js/src/tests/test262/staging/Temporal/Duration/old/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/staging/Temporal/Duration/old/shell.js +++ b/js/src/tests/test262/staging/Temporal/Duration/old/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/staging/Temporal/TimeZone/old/shell.js b/js/src/tests/test262/staging/Temporal/TimeZone/old/shell.js index eaa8761415..cd31c09e9b 100644 --- a/js/src/tests/test262/staging/Temporal/TimeZone/old/shell.js +++ b/js/src/tests/test262/staging/Temporal/TimeZone/old/shell.js @@ -2351,6 +2351,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]", ]; }, @@ -2438,6 +2441,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/staging/Temporal/ZonedDateTime/old/round.js b/js/src/tests/test262/staging/Temporal/ZonedDateTime/old/round.js index 3dfb21989d..6c613fa47b 100644 --- a/js/src/tests/test262/staging/Temporal/ZonedDateTime/old/round.js +++ b/js/src/tests/test262/staging/Temporal/ZonedDateTime/old/round.js @@ -217,17 +217,19 @@ var bal = Temporal.ZonedDateTime.from("1976-11-18T23:59:59.999999999+01:00[+01:0 var timeZone = TemporalHelpers.springForwardFallBackTimeZone(); // rounds correctly to a 25-hour day +// (the 12.5 hour is the halfway point, which is 11:30 local time, since 2:00-2:59 repeats) var roundTo = { smallestUnit: "day" }; -var roundMeDown = Temporal.PlainDateTime.from("2000-10-29T12:29:59").toZonedDateTime(timeZone); +var roundMeDown = Temporal.PlainDateTime.from("2000-10-29T11:29:59").toZonedDateTime(timeZone); assert.sameValue(`${ roundMeDown.round(roundTo) }`, "2000-10-29T00:00:00-07:00[Custom/Spring_Fall]"); -var roundMeUp = Temporal.PlainDateTime.from("2000-10-29T12:30:01").toZonedDateTime(timeZone); +var roundMeUp = Temporal.PlainDateTime.from("2000-10-29T11:30:01").toZonedDateTime(timeZone); assert.sameValue(`${ roundMeUp.round(roundTo) }`, "2000-10-30T00:00:00-08:00[Custom/Spring_Fall]"); // rounds correctly to a 23-hour day +// (the 11.5 hour is the halfway point, which is 12:30 local time, since 2:00-2:59 skips) var roundTo = { smallestUnit: "day" }; -var roundMeDown = Temporal.PlainDateTime.from("2000-04-02T11:29:59").toZonedDateTime(timeZone); +var roundMeDown = Temporal.PlainDateTime.from("2000-04-02T12:29:59").toZonedDateTime(timeZone); assert.sameValue(`${ roundMeDown.round(roundTo) }`, "2000-04-02T00:00:00-08:00[Custom/Spring_Fall]"); -var roundMeUp = Temporal.PlainDateTime.from("2000-04-02T11:30:01").toZonedDateTime(timeZone); +var roundMeUp = Temporal.PlainDateTime.from("2000-04-02T12:30:01").toZonedDateTime(timeZone); assert.sameValue(`${ roundMeUp.round(roundTo) }`, "2000-04-03T00:00:00-07:00[Custom/Spring_Fall]"); // rounding up to a nonexistent wall-clock time diff --git a/js/src/tests/test262/staging/Temporal/ZonedDateTime/old/shell.js b/js/src/tests/test262/staging/Temporal/ZonedDateTime/old/shell.js index 60f74c2518..5265d86aa2 100644 --- a/js/src/tests/test262/staging/Temporal/ZonedDateTime/old/shell.js +++ b/js/src/tests/test262/staging/Temporal/ZonedDateTime/old/shell.js @@ -2022,6 +2022,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]", ]; }, @@ -2109,6 +2112,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/staging/built-ins/Array/browser.js b/js/src/tests/test262/staging/built-ins/Array/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/staging/built-ins/Array/prototype/browser.js b/js/src/tests/test262/staging/built-ins/Array/prototype/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/staging/built-ins/Array/prototype/flatMap/browser.js b/js/src/tests/test262/staging/built-ins/Array/prototype/flatMap/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/staging/built-ins/Array/prototype/flatMap/callback-with-side-effects.js b/js/src/tests/test262/staging/built-ins/Array/prototype/flatMap/callback-with-side-effects.js new file mode 100644 index 0000000000..83d2057623 --- /dev/null +++ b/js/src/tests/test262/staging/built-ins/Array/prototype/flatMap/callback-with-side-effects.js @@ -0,0 +1,30 @@ +// Copyright (C) 2024 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.flatMap +description: > + Array.prototype.flatMap is given a callback that modifies the array being + iterated. +includes: [compareArray.js] +---*/ + +(function TestGrow() { + let array = [0,1,2,3]; + function f(e) { + array[4] = 42; + return e; + } + assert.compareArray(array.flatMap(f), [0,1,2,3]); +})(); + +(function TestShrink() { + let array = [0,1,2,3]; + function f(e) { + array.length = 3; + return e; + } + assert.compareArray(array.flatMap(f), [0,1,2]); +})(); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/staging/built-ins/Array/prototype/flatMap/shell.js b/js/src/tests/test262/staging/built-ins/Array/prototype/flatMap/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/staging/built-ins/Array/prototype/shell.js b/js/src/tests/test262/staging/built-ins/Array/prototype/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/staging/built-ins/Array/shell.js b/js/src/tests/test262/staging/built-ins/Array/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/staging/built-ins/RegExp/browser.js b/js/src/tests/test262/staging/built-ins/RegExp/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/staging/built-ins/RegExp/named-groups/browser.js b/js/src/tests/test262/staging/built-ins/RegExp/named-groups/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/staging/built-ins/RegExp/named-groups/duplicate-named-groups-replace.js b/js/src/tests/test262/staging/built-ins/RegExp/named-groups/duplicate-named-groups-replace.js new file mode 100644 index 0000000000..f26eebab4d --- /dev/null +++ b/js/src/tests/test262/staging/built-ins/RegExp/named-groups/duplicate-named-groups-replace.js @@ -0,0 +1,31 @@ +// |reftest| skip -- regexp-duplicate-named-groups is not supported +// Copyright (C) 2024 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Test replace function with duplicate names in alteration. +features: [regexp-duplicate-named-groups] +includes: [compareArray.js] +---*/ + +assert.compareArray( + '2xyy', 'xxyy'.replace(/(?:(?:(?x)|(?y))\k)/, '2$')); +assert.compareArray( + 'x2zyyxxy', + 'xzzyyxxy'.replace( + /(?:(?:(?x)|(?y)|(a)|(?b)|(?z))\k)/, '2$')); +assert.compareArray( + '2x(x,)yy', 'xxyy'.replace(/(?:(?:(?x)|(?y))\k)/, '2$($1,$2)')); +assert.compareArray( + 'x2z(,,,,z)yyxxy', + 'xzzyyxxy'.replace( + /(?:(?:(?x)|(?y)|(a)|(?b)|(?z))\k)/, + '2$($1,$2,$3,$4,$5)')); +assert.compareArray( + '2x2y', 'xxyy'.replace(/(?:(?:(?x)|(?y))\k)/g, '2$')); +assert.compareArray( + 'x2z2y2xy', + 'xzzyyxxy'.replace( + /(?:(?:(?x)|(?y)|(a)|(?b)|(?z))\k)/g, '2$')); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/staging/built-ins/RegExp/named-groups/duplicate-named-groups-search.js b/js/src/tests/test262/staging/built-ins/RegExp/named-groups/duplicate-named-groups-search.js new file mode 100644 index 0000000000..27a2b22a82 --- /dev/null +++ b/js/src/tests/test262/staging/built-ins/RegExp/named-groups/duplicate-named-groups-search.js @@ -0,0 +1,16 @@ +// |reftest| skip -- regexp-duplicate-named-groups is not supported +// Copyright (C) 2024 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Test search function with duplicate names in alteration. +features: [regexp-duplicate-named-groups] +includes: [compareArray.js] +---*/ + +assert.compareArray(3, 'abcxyz'.search(/(?x)|(?y)/)); +assert.compareArray(3, 'abcxyz'.search(/(?y)|(?x)/)); +assert.compareArray(1, 'aybcxyz'.search(/(?x)|(?y)/)); +assert.compareArray(1, 'aybcxyz'.search(/(?y)|(?x)/)); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/staging/built-ins/RegExp/named-groups/duplicate-named-groups.js b/js/src/tests/test262/staging/built-ins/RegExp/named-groups/duplicate-named-groups.js new file mode 100644 index 0000000000..d28346f13b --- /dev/null +++ b/js/src/tests/test262/staging/built-ins/RegExp/named-groups/duplicate-named-groups.js @@ -0,0 +1,19 @@ +// |reftest| skip -- regexp-duplicate-named-groups is not supported +// Copyright (C) 2024 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Test different functions with duplicate names in alteration. +features: [regexp-duplicate-named-groups] +includes: [compareArray.js] +---*/ + +assert.compareArray( + ['xxyy', undefined, 'y'], /(?:(?:(?x)|(?y))\k){2}/.exec('xxyy')); +assert.compareArray( + ['zzyyxx', 'x', undefined, undefined, undefined, undefined], + /(?:(?:(?x)|(?y)|(a)|(?b)|(?z))\k){3}/.exec('xzzyyxxy')); +assert.compareArray( + ['xxyy', undefined, 'y'], 'xxyy'.match(/(?:(?:(?x)|(?y))\k){2}/)); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/staging/built-ins/RegExp/named-groups/shell.js b/js/src/tests/test262/staging/built-ins/RegExp/named-groups/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/staging/built-ins/RegExp/shell.js b/js/src/tests/test262/staging/built-ins/RegExp/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/staging/built-ins/browser.js b/js/src/tests/test262/staging/built-ins/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/staging/built-ins/shell.js b/js/src/tests/test262/staging/built-ins/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/staging/explicit-resource-management/Symbol/browser.js b/js/src/tests/test262/staging/explicit-resource-management/Symbol/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/staging/explicit-resource-management/Symbol/dispose/browser.js b/js/src/tests/test262/staging/explicit-resource-management/Symbol/dispose/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/staging/explicit-resource-management/Symbol/dispose/cross-realm.js b/js/src/tests/test262/staging/explicit-resource-management/Symbol/dispose/cross-realm.js new file mode 100644 index 0000000000..40a3a9a54c --- /dev/null +++ b/js/src/tests/test262/staging/explicit-resource-management/Symbol/dispose/cross-realm.js @@ -0,0 +1,17 @@ +// |reftest| skip -- explicit-resource-management is not supported +// Copyright (C) 2024 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Value shared by all realms +info: | + Unless otherwise specified, well-known symbols values are shared by all + realms. +features: [cross-realm, explicit-resource-management] +---*/ + +var OSymbol = $262.createRealm().global.Symbol; + +assert.sameValue(Symbol.dispose, OSymbol.dispose); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/staging/explicit-resource-management/Symbol/dispose/prop-desc.js b/js/src/tests/test262/staging/explicit-resource-management/Symbol/dispose/prop-desc.js new file mode 100644 index 0000000000..8f4330035c --- /dev/null +++ b/js/src/tests/test262/staging/explicit-resource-management/Symbol/dispose/prop-desc.js @@ -0,0 +1,20 @@ +// |reftest| skip -- explicit-resource-management is not supported +// Copyright (C) 2024 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + `Symbol.dispose` property descriptor +info: | + This property has the attributes { [[Writable]]: false, [[Enumerable]]: + false, [[Configurable]]: false }. +includes: [propertyHelper.js] +features: [explicit-resource-management] +---*/ + +assert.sameValue(typeof Symbol.dispose, 'symbol'); +verifyNotEnumerable(Symbol, 'dispose'); +verifyNotWritable(Symbol, 'dispose'); +verifyNotConfigurable(Symbol, 'dispose'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/staging/explicit-resource-management/Symbol/dispose/shell.js b/js/src/tests/test262/staging/explicit-resource-management/Symbol/dispose/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/staging/explicit-resource-management/Symbol/shell.js b/js/src/tests/test262/staging/explicit-resource-management/Symbol/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/staging/explicit-resource-management/browser.js b/js/src/tests/test262/staging/explicit-resource-management/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/staging/explicit-resource-management/call-dispose-methods.js b/js/src/tests/test262/staging/explicit-resource-management/call-dispose-methods.js new file mode 100644 index 0000000000..55189d2150 --- /dev/null +++ b/js/src/tests/test262/staging/explicit-resource-management/call-dispose-methods.js @@ -0,0 +1,194 @@ +// |reftest| skip -- explicit-resource-management is not supported +// Copyright (C) 2024 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Test if disposed methods are called in correct syntax. +includes: [compareArray.js] +features: [explicit-resource-management] +---*/ + +// Block ---------------- +let blockValues = []; + +(function TestUsingInBlock() { + { + using x = { + value: 1, + [Symbol.dispose]() { + blockValues.push(42); + } + }; + blockValues.push(43); + } +})(); +assert.compareArray(blockValues, [43, 42]); + +// CaseBlock -------------- +let caseBlockValues = []; + +(function TestUsingInCaseBlock() { + let label = 1; + switch (label) { + case 1: + using x = { + value: 1, + [Symbol.dispose]() { + caseBlockValues.push(42); + } + }; + } + caseBlockValues.push(43); +})(); +assert.compareArray(caseBlockValues, [42, 43]); + +// ForStatement -------------- +let forStatementValues = []; + +(function TestUsingInForStatement() { + for (let i = 0; i < 3; i++) { + using x = { + value: i, + [Symbol.dispose]() { + forStatementValues.push(this.value); + } + }; + } + forStatementValues.push(3); +})(); +assert.compareArray(forStatementValues, [0, 1, 2, 3]); + +// ForInStatement -------------- +let forInStatementValues = []; + +(function TestUsingInForInStatement() { + for (let i in [0, 1]) { + using x = { + value: i, + [Symbol.dispose]() { + forInStatementValues.push(this.value); + } + }; + } + forInStatementValues.push('2'); +})(); +assert.compareArray(forInStatementValues, ['0', '1', '2']); + +// ForOfStatement -------------- +let forOfStatementValues = []; + +(function TestUsingInForOfStatement() { + for (let i of [0, 1]) { + using x = { + value: i, + [Symbol.dispose]() { + forOfStatementValues.push(this.value); + } + }; + } + forOfStatementValues.push(2); +})(); +assert.compareArray(forOfStatementValues, [0, 1, 2]); + +// FunctionBody -------------- +let functionBodyValues = []; + +(function TestUsingInFunctionBody() { + using x = { + value: 1, + [Symbol.dispose]() { + functionBodyValues.push(42); + } + }; + using y = { + value: 2, + [Symbol.dispose]() { + functionBodyValues.push(43); + } + }; +})(); +assert.compareArray(functionBodyValues, [43, 42]); + +// GeneratorBody -------------- +let generatorBodyValues = []; + +function* gen() { + using x = { + value: 1, + [Symbol.dispose]() { + generatorBodyValues.push(42); + } + }; + yield x; +} + +(function TestUsingInGeneratorBody() { + let iter = gen(); + iter.next(); + iter.next(); + generatorBodyValues.push(43); +})(); +assert.compareArray(generatorBodyValues, [42, 43]); + +// ClassStaticBlockBody -------------- +let classStaticBlockBodyValues = []; + +class staticBlockClass { + static { + using x = { + value: 1, + [Symbol.dispose]() { + classStaticBlockBodyValues.push(42); + } + }; + } +} + +(function TestUsingInAsyncFunctionBody() { + let example = new staticBlockClass(); +})(); +assert.compareArray(classStaticBlockBodyValues, [42]); + +// Derived constructor case +let derivedConstructorValues = []; + +class baseClass { + constructor() { + derivedConstructorValues.push(43); + } +} + +class subClass extends baseClass { + constructor() { + try { + using x = { + value: 1, + [Symbol.dispose]() { + derivedConstructorValues.push(42); + } + }; + } catch (e) { + return; + } finally { + super(); + } + } +} + +(function TestUsingInDerivedConstructor() { + let example = new subClass(); +})(); +assert.compareArray(derivedConstructorValues, [42, 43]); + +// Lack of dispose method +let values = []; + +function TestUsingWithoutDisposeMethod() { + { + using x = {value: 1}; + values.push(43); + } +} +assert.throws(TypeError, TestUsingWithoutDisposeMethod, 'No dispose method'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/staging/explicit-resource-management/shell.js b/js/src/tests/test262/staging/explicit-resource-management/shell.js new file mode 100644 index 0000000000..e69de29bb2 -- cgit v1.2.3