mirror of
https://github.com/tc39/test262.git
synced 2025-07-31 01:44:54 +02:00
Adds name
This commit is contained in:
parent
6ad7c115b9
commit
216bdb5160
@ -128,8 +128,16 @@ function createTypedArrayVariations(TA, values) {
|
|||||||
let nonresizable = new TA(values);
|
let nonresizable = new TA(values);
|
||||||
let fixedLength = new TA(rab, 0, values.length);
|
let fixedLength = new TA(rab, 0, values.length);
|
||||||
let lengthTracking = new TA(rab, 0);
|
let lengthTracking = new TA(rab, 0);
|
||||||
let fixedLengthWithOffset = new TA(rab, 2 * TA.BYTES_PER_ELEMENT, (values.length / 2));
|
|
||||||
let lengthTrackingWithOffset = new TA(rab, 2 * TA.BYTES_PER_ELEMENT);
|
let fixedLengthWithOffset = {
|
||||||
|
name: fixedLengthWithOffset,
|
||||||
|
contents: new TA(rab, 2 * TA.BYTES_PER_ELEMENT, (values.length / 2))
|
||||||
|
};
|
||||||
|
|
||||||
|
let lengthTrackingWithOffset = {
|
||||||
|
name: lengthTrackingWithOffset,
|
||||||
|
contents: new TA(rab, 2 * TA.BYTES_PER_ELEMENT)
|
||||||
|
};
|
||||||
|
|
||||||
// Writes data to the buffer backing all the arrays
|
// Writes data to the buffer backing all the arrays
|
||||||
let ta_write = new TA(rab);
|
let ta_write = new TA(rab);
|
||||||
|
@ -58,3 +58,32 @@ testWithTypedArrayConstructors(TA => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
testWithTypedArrayVariants(TA => {
|
||||||
|
assert.sameValue(typeof TA.prototype.at, 'function', 'The value of `typeof TA.prototype.at` is "function"');
|
||||||
|
|
||||||
|
const values = [1, 2, 3, 4];
|
||||||
|
|
||||||
|
/*
|
||||||
|
Works for non-offset ...
|
||||||
|
*/
|
||||||
|
|
||||||
|
testWithTypedArrayVariants(TA, values, (case) => {
|
||||||
|
/*
|
||||||
|
I updated this to refer to the values array instead of the
|
||||||
|
explicit value because really they should have both been
|
||||||
|
written this way — it makes the connection clear.
|
||||||
|
*/
|
||||||
|
assert.sameValue(a.at(0), values[0], 'a.at(0) must return 1');
|
||||||
|
assert.sameValue(a.at(1), values[1], 'a.at(1) must return 2');
|
||||||
|
assert.sameValue(a.at(2), values[2], 'a.at(2) must return 3');
|
||||||
|
assert.sameValue(a.at(3), values[3], 'a.at(3) must return 4');
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
... and then what do we do for the offsets?
|
||||||
|
*/
|
||||||
|
|
||||||
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user