Skip to content

Commit

Permalink
introduce nonClampedIntArrayConstructors
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkot committed Jan 10, 2024
1 parent 511a372 commit 62294b5
Show file tree
Hide file tree
Showing 19 changed files with 22 additions and 20 deletions.
6 changes: 4 additions & 2 deletions harness/testTypedArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var floatArrayConstructors = [
Float32Array
];

var intArrayConstructors = [
var nonClampedIntArrayConstructors = [
Int32Array,
Int16Array,
Int8Array,
Expand All @@ -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') {
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/add/bad-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/add/good-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/and/bad-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/and/good-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/compareExchange/bad-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/compareExchange/good-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/exchange/bad-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/exchange/good-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/load/bad-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/load/good-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/or/bad-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/or/good-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/store/bad-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/store/good-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/sub/bad-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/sub/good-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/xor/bad-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/built-ins/Atomics/xor/good-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 62294b5

Please sign in to comment.