mirror of
https://github.com/tc39/test262.git
synced 2025-07-29 17:04:31 +02:00
introduce nonClampedIntArrayConstructors (#3984)
This commit is contained in:
parent
c2aaae4cc3
commit
9c4e0fd902
@ -5,6 +5,7 @@ description: |
|
|||||||
Collection of functions used to assert the correctness of TypedArray objects.
|
Collection of functions used to assert the correctness of TypedArray objects.
|
||||||
defines:
|
defines:
|
||||||
- floatArrayConstructors
|
- floatArrayConstructors
|
||||||
|
- nonClampedIntArrayConstructors
|
||||||
- intArrayConstructors
|
- intArrayConstructors
|
||||||
- typedArrayConstructors
|
- typedArrayConstructors
|
||||||
- TypedArray
|
- TypedArray
|
||||||
@ -20,16 +21,17 @@ var floatArrayConstructors = [
|
|||||||
Float32Array
|
Float32Array
|
||||||
];
|
];
|
||||||
|
|
||||||
var intArrayConstructors = [
|
var nonClampedIntArrayConstructors = [
|
||||||
Int32Array,
|
Int32Array,
|
||||||
Int16Array,
|
Int16Array,
|
||||||
Int8Array,
|
Int8Array,
|
||||||
Uint32Array,
|
Uint32Array,
|
||||||
Uint16Array,
|
Uint16Array,
|
||||||
Uint8Array,
|
Uint8Array
|
||||||
Uint8ClampedArray
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
var intArrayConstructors = nonClampedIntArrayConstructors.concat([Uint8ClampedArray]);
|
||||||
|
|
||||||
// Float16Array is a newer feature
|
// Float16Array is a newer feature
|
||||||
// adding it to this list unconditionally would cause implementations lacking it to fail every test which uses it
|
// adding it to this list unconditionally would cause implementations lacking it to fail every test which uses it
|
||||||
if (typeof Float16Array !== 'undefined') {
|
if (typeof Float16Array !== 'undefined') {
|
||||||
|
@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
const buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
const buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
||||||
const views = intArrayConstructors.slice();
|
const views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
let view = new TA(buffer);
|
let view = new TA(buffer);
|
||||||
|
@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
|
|
||||||
const sab = new SharedArrayBuffer(1024);
|
const sab = new SharedArrayBuffer(1024);
|
||||||
const ab = new ArrayBuffer(16);
|
const ab = new ArrayBuffer(16);
|
||||||
const views = intArrayConstructors.slice();
|
const views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
||||||
|
@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
const buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
const buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
||||||
const views = intArrayConstructors.slice();
|
const views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
const view = new TA(buffer);
|
const view = new TA(buffer);
|
||||||
|
@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
|
|
||||||
const sab = new SharedArrayBuffer(1024);
|
const sab = new SharedArrayBuffer(1024);
|
||||||
const ab = new ArrayBuffer(16);
|
const ab = new ArrayBuffer(16);
|
||||||
const views = intArrayConstructors.slice();
|
const views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
||||||
|
@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
const buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
const buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
||||||
const views = intArrayConstructors.slice();
|
const views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
const view = new TA(buffer);
|
const view = new TA(buffer);
|
||||||
|
@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
|
|
||||||
const sab = new SharedArrayBuffer(1024);
|
const sab = new SharedArrayBuffer(1024);
|
||||||
const ab = new ArrayBuffer(16);
|
const ab = new ArrayBuffer(16);
|
||||||
const views = intArrayConstructors.slice();
|
const views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
||||||
|
@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
const buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
const buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
||||||
const views = intArrayConstructors.slice();
|
const views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
const view = new TA(buffer);
|
const view = new TA(buffer);
|
||||||
|
@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
|
|
||||||
const sab = new SharedArrayBuffer(1024);
|
const sab = new SharedArrayBuffer(1024);
|
||||||
const ab = new ArrayBuffer(16);
|
const ab = new ArrayBuffer(16);
|
||||||
const views = intArrayConstructors.slice();
|
const views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
||||||
|
@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
||||||
var views = intArrayConstructors.slice();
|
var views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
let view = new TA(buffer);
|
let view = new TA(buffer);
|
||||||
|
@ -11,7 +11,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
const sab = new SharedArrayBuffer(1024);
|
const sab = new SharedArrayBuffer(1024);
|
||||||
const ab = new ArrayBuffer(16);
|
const ab = new ArrayBuffer(16);
|
||||||
|
|
||||||
const views = intArrayConstructors.slice();
|
const views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
||||||
|
@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
||||||
var views = intArrayConstructors.slice();
|
var views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
let view = new TA(buffer);
|
let view = new TA(buffer);
|
||||||
|
@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
|
|
||||||
var sab = new SharedArrayBuffer(1024);
|
var sab = new SharedArrayBuffer(1024);
|
||||||
var ab = new ArrayBuffer(16);
|
var ab = new ArrayBuffer(16);
|
||||||
var views = intArrayConstructors.slice();
|
var views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
||||||
|
@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
const buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
const buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
||||||
const views = intArrayConstructors.slice();
|
const views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
const view = new TA(buffer);
|
const view = new TA(buffer);
|
||||||
|
@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
|
|
||||||
const sab = new SharedArrayBuffer(1024);
|
const sab = new SharedArrayBuffer(1024);
|
||||||
const ab = new ArrayBuffer(16);
|
const ab = new ArrayBuffer(16);
|
||||||
const views = intArrayConstructors.slice();
|
const views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
||||||
|
@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
var buffer = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
||||||
var views = intArrayConstructors.slice();
|
var views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
let view = new TA(buffer);
|
let view = new TA(buffer);
|
||||||
|
@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
|
|
||||||
var sab = new SharedArrayBuffer(1024);
|
var sab = new SharedArrayBuffer(1024);
|
||||||
var ab = new ArrayBuffer(16);
|
var ab = new ArrayBuffer(16);
|
||||||
var views = intArrayConstructors.slice();
|
var views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
||||||
|
@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
var sab = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
var sab = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2);
|
||||||
var views = intArrayConstructors.slice();
|
var views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
let view = new TA(sab);
|
let view = new TA(sab);
|
||||||
|
@ -10,7 +10,7 @@ features: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, Symbol, TypedArray
|
|||||||
|
|
||||||
var sab = new SharedArrayBuffer(1024);
|
var sab = new SharedArrayBuffer(1024);
|
||||||
var ab = new ArrayBuffer(16);
|
var ab = new ArrayBuffer(16);
|
||||||
var views = intArrayConstructors.slice();
|
var views = nonClampedIntArrayConstructors.slice();
|
||||||
|
|
||||||
testWithTypedArrayConstructors(function(TA) {
|
testWithTypedArrayConstructors(function(TA) {
|
||||||
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
// Make it interesting - use non-zero byteOffsets and non-zero indexes.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user