From 62294b592e332bc16da6114e461fd7a8ed90daab Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Wed, 10 Jan 2024 11:31:58 -0800 Subject: [PATCH] introduce nonClampedIntArrayConstructors --- harness/testTypedArray.js | 6 ++++-- test/built-ins/Atomics/add/bad-range.js | 2 +- test/built-ins/Atomics/add/good-views.js | 2 +- test/built-ins/Atomics/and/bad-range.js | 2 +- test/built-ins/Atomics/and/good-views.js | 2 +- test/built-ins/Atomics/compareExchange/bad-range.js | 2 +- test/built-ins/Atomics/compareExchange/good-views.js | 2 +- test/built-ins/Atomics/exchange/bad-range.js | 2 +- test/built-ins/Atomics/exchange/good-views.js | 2 +- test/built-ins/Atomics/load/bad-range.js | 2 +- test/built-ins/Atomics/load/good-views.js | 2 +- test/built-ins/Atomics/or/bad-range.js | 2 +- test/built-ins/Atomics/or/good-views.js | 2 +- test/built-ins/Atomics/store/bad-range.js | 2 +- test/built-ins/Atomics/store/good-views.js | 2 +- test/built-ins/Atomics/sub/bad-range.js | 2 +- test/built-ins/Atomics/sub/good-views.js | 2 +- test/built-ins/Atomics/xor/bad-range.js | 2 +- test/built-ins/Atomics/xor/good-views.js | 2 +- 19 files changed, 22 insertions(+), 20 deletions(-) diff --git a/harness/testTypedArray.js b/harness/testTypedArray.js index f563a1dafb0..986c131e2d2 100644 --- a/harness/testTypedArray.js +++ b/harness/testTypedArray.js @@ -20,7 +20,7 @@ var floatArrayConstructors = [ Float32Array ]; -var intArrayConstructors = [ +var nonClampedIntArrayConstructors = [ Int32Array, Int16Array, Int8Array, @@ -29,6 +29,8 @@ var intArrayConstructors = [ Uint8Array ]; +var intArrayConstructors = nonClampedIntArrayConstructors.concat([Uint8ClampedArray]); + // Float16Array is a newer feature // adding it to this list unconditionally would cause implementations lacking it to fail every test which uses it if (typeof Float16Array !== 'undefined') { @@ -39,7 +41,7 @@ if (typeof Float16Array !== 'undefined') { * Array containing every non-bigint typed array constructor. */ -var typedArrayConstructors = floatArrayConstructors.concat(intArrayConstructors, [Uint8ClampedArray]); +var typedArrayConstructors = floatArrayConstructors.concat(intArrayConstructors); /** * The %TypedArray% intrinsic constructor function. diff --git a/test/built-ins/Atomics/add/bad-range.js b/test/built-ins/Atomics/add/bad-range.js index 8c582b88ca6..d5ad1d732c3 100644 --- a/test/built-ins/Atomics/add/bad-range.js +++ b/test/built-ins/Atomics/add/bad-range.js @@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray ---*/ const buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2); -const views = intArrayConstructors.slice(); +const views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { let view = new TA(buffer); diff --git a/test/built-ins/Atomics/add/good-views.js b/test/built-ins/Atomics/add/good-views.js index ddef527b5ac..95f60854d90 100644 --- a/test/built-ins/Atomics/add/good-views.js +++ b/test/built-ins/Atomics/add/good-views.js @@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray const sab = new SharedArrayBuffer(1024); const ab = new ArrayBuffer(16); -const views = intArrayConstructors.slice(); +const views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { // Make it interesting - use non-zero byteOffsets and non-zero indexes. diff --git a/test/built-ins/Atomics/and/bad-range.js b/test/built-ins/Atomics/and/bad-range.js index 730fd6b560c..bf41aa26d88 100644 --- a/test/built-ins/Atomics/and/bad-range.js +++ b/test/built-ins/Atomics/and/bad-range.js @@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray ---*/ const buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2); -const views = intArrayConstructors.slice(); +const views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { const view = new TA(buffer); diff --git a/test/built-ins/Atomics/and/good-views.js b/test/built-ins/Atomics/and/good-views.js index 6bf15d2f18a..59fbd736c4b 100644 --- a/test/built-ins/Atomics/and/good-views.js +++ b/test/built-ins/Atomics/and/good-views.js @@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray const sab = new SharedArrayBuffer(1024); const ab = new ArrayBuffer(16); -const views = intArrayConstructors.slice(); +const views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { // Make it interesting - use non-zero byteOffsets and non-zero indexes. diff --git a/test/built-ins/Atomics/compareExchange/bad-range.js b/test/built-ins/Atomics/compareExchange/bad-range.js index 1cb3e527854..04fc7bda26a 100644 --- a/test/built-ins/Atomics/compareExchange/bad-range.js +++ b/test/built-ins/Atomics/compareExchange/bad-range.js @@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray ---*/ const buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2); -const views = intArrayConstructors.slice(); +const views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { const view = new TA(buffer); diff --git a/test/built-ins/Atomics/compareExchange/good-views.js b/test/built-ins/Atomics/compareExchange/good-views.js index 1468eaabf29..99a55768041 100644 --- a/test/built-ins/Atomics/compareExchange/good-views.js +++ b/test/built-ins/Atomics/compareExchange/good-views.js @@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray const sab = new SharedArrayBuffer(1024); const ab = new ArrayBuffer(16); -const views = intArrayConstructors.slice(); +const views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { // Make it interesting - use non-zero byteOffsets and non-zero indexes. diff --git a/test/built-ins/Atomics/exchange/bad-range.js b/test/built-ins/Atomics/exchange/bad-range.js index 6f5c8f1749e..0c5294e99a5 100644 --- a/test/built-ins/Atomics/exchange/bad-range.js +++ b/test/built-ins/Atomics/exchange/bad-range.js @@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray ---*/ const buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2); -const views = intArrayConstructors.slice(); +const views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { const view = new TA(buffer); diff --git a/test/built-ins/Atomics/exchange/good-views.js b/test/built-ins/Atomics/exchange/good-views.js index 2eeb53bd70e..90b635d893b 100644 --- a/test/built-ins/Atomics/exchange/good-views.js +++ b/test/built-ins/Atomics/exchange/good-views.js @@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray const sab = new SharedArrayBuffer(1024); const ab = new ArrayBuffer(16); -const views = intArrayConstructors.slice(); +const views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { // Make it interesting - use non-zero byteOffsets and non-zero indexes. diff --git a/test/built-ins/Atomics/load/bad-range.js b/test/built-ins/Atomics/load/bad-range.js index dd0546b10ff..77e47f95ca8 100644 --- a/test/built-ins/Atomics/load/bad-range.js +++ b/test/built-ins/Atomics/load/bad-range.js @@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray ---*/ var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2); -var views = intArrayConstructors.slice(); +var views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { let view = new TA(buffer); diff --git a/test/built-ins/Atomics/load/good-views.js b/test/built-ins/Atomics/load/good-views.js index f7f3e7ed47b..69b3d281300 100644 --- a/test/built-ins/Atomics/load/good-views.js +++ b/test/built-ins/Atomics/load/good-views.js @@ -11,7 +11,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray const sab = new SharedArrayBuffer(1024); const ab = new ArrayBuffer(16); -const views = intArrayConstructors.slice(); +const views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { // Make it interesting - use non-zero byteOffsets and non-zero indexes. diff --git a/test/built-ins/Atomics/or/bad-range.js b/test/built-ins/Atomics/or/bad-range.js index ac859a9a843..5ac2f377870 100644 --- a/test/built-ins/Atomics/or/bad-range.js +++ b/test/built-ins/Atomics/or/bad-range.js @@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray ---*/ var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2); -var views = intArrayConstructors.slice(); +var views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { let view = new TA(buffer); diff --git a/test/built-ins/Atomics/or/good-views.js b/test/built-ins/Atomics/or/good-views.js index 89803533974..bea292a310f 100644 --- a/test/built-ins/Atomics/or/good-views.js +++ b/test/built-ins/Atomics/or/good-views.js @@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray var sab = new SharedArrayBuffer(1024); var ab = new ArrayBuffer(16); -var views = intArrayConstructors.slice(); +var views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { // Make it interesting - use non-zero byteOffsets and non-zero indexes. diff --git a/test/built-ins/Atomics/store/bad-range.js b/test/built-ins/Atomics/store/bad-range.js index 9d67dabdded..7037736a983 100644 --- a/test/built-ins/Atomics/store/bad-range.js +++ b/test/built-ins/Atomics/store/bad-range.js @@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray ---*/ const buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2); -const views = intArrayConstructors.slice(); +const views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { const view = new TA(buffer); diff --git a/test/built-ins/Atomics/store/good-views.js b/test/built-ins/Atomics/store/good-views.js index 086559cf1fa..f84c83ce7ed 100644 --- a/test/built-ins/Atomics/store/good-views.js +++ b/test/built-ins/Atomics/store/good-views.js @@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray const sab = new SharedArrayBuffer(1024); const ab = new ArrayBuffer(16); -const views = intArrayConstructors.slice(); +const views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { // Make it interesting - use non-zero byteOffsets and non-zero indexes. diff --git a/test/built-ins/Atomics/sub/bad-range.js b/test/built-ins/Atomics/sub/bad-range.js index c7444d7772a..245fcb66a7b 100644 --- a/test/built-ins/Atomics/sub/bad-range.js +++ b/test/built-ins/Atomics/sub/bad-range.js @@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray ---*/ var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2); -var views = intArrayConstructors.slice(); +var views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { let view = new TA(buffer); diff --git a/test/built-ins/Atomics/sub/good-views.js b/test/built-ins/Atomics/sub/good-views.js index c53596f4577..a13b7d15e8e 100644 --- a/test/built-ins/Atomics/sub/good-views.js +++ b/test/built-ins/Atomics/sub/good-views.js @@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray var sab = new SharedArrayBuffer(1024); var ab = new ArrayBuffer(16); -var views = intArrayConstructors.slice(); +var views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { // Make it interesting - use non-zero byteOffsets and non-zero indexes. diff --git a/test/built-ins/Atomics/xor/bad-range.js b/test/built-ins/Atomics/xor/bad-range.js index 09395761edf..644f7523503 100644 --- a/test/built-ins/Atomics/xor/bad-range.js +++ b/test/built-ins/Atomics/xor/bad-range.js @@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray ---*/ var sab = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2); -var views = intArrayConstructors.slice(); +var views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { let view = new TA(sab); diff --git a/test/built-ins/Atomics/xor/good-views.js b/test/built-ins/Atomics/xor/good-views.js index cdf1714178a..74198415fe5 100644 --- a/test/built-ins/Atomics/xor/good-views.js +++ b/test/built-ins/Atomics/xor/good-views.js @@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray var sab = new SharedArrayBuffer(1024); var ab = new ArrayBuffer(16); -var views = intArrayConstructors.slice(); +var views = nonClampedIntArrayConstructors.slice(); testWithTypedArrayConstructors(function(TA) { // Make it interesting - use non-zero byteOffsets and non-zero indexes.