introduce nonClampedIntArrayConstructors (#3984)

This commit is contained in:
Kevin Gibbons 2024-01-11 02:35:28 -08:00 committed by GitHub
parent c2aaae4cc3
commit 9c4e0fd902
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 23 additions and 21 deletions

View File

@ -5,6 +5,7 @@ description: |
Collection of functions used to assert the correctness of TypedArray objects.
defines:
- floatArrayConstructors
- nonClampedIntArrayConstructors
- intArrayConstructors
- typedArrayConstructors
- TypedArray
@ -20,16 +21,17 @@ var floatArrayConstructors = [
Float32Array
];
var intArrayConstructors = [
var nonClampedIntArrayConstructors = [
Int32Array,
Int16Array,
Int8Array,
Uint32Array,
Uint16Array,
Uint8Array,
Uint8ClampedArray
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') {

View File

@ -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);

View File

@ -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.

View File

@ -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);

View File

@ -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.

View File

@ -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);

View File

@ -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.

View File

@ -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);

View File

@ -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.

View File

@ -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);

View File

@ -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.

View File

@ -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);

View File

@ -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.

View File

@ -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);

View File

@ -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.

View File

@ -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);

View File

@ -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.

View File

@ -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);

View File

@ -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.