mirror of
https://github.com/tc39/test262.git
synced 2025-07-21 04:54:44 +02:00
Focus test for BigInt v. of copyWithin
method
Prior to this commit, a test for %TypedArray%.prototype.copyWithin provided a TypedArray instance as the first argument. That argument that is interpreted as a number, so in relying on the conversion, the test verified behavior beyond what it purported to test. Simplify the test by using the desired number value directly.
This commit is contained in:
parent
de6583d61d
commit
50dd431dff
@ -29,14 +29,14 @@ testWithBigIntTypedArrayConstructors(TA => {
|
|||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
|
|
||||||
// no error following grow:
|
// no error following grow:
|
||||||
array.copyWithin(new TA(), 0);
|
array.copyWithin(0, 0);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ab.resize(BPE * 3);
|
ab.resize(BPE * 3);
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
|
|
||||||
// no error following shrink (within bounds):
|
// no error following shrink (within bounds):
|
||||||
array.copyWithin(new TA(), 0);
|
array.copyWithin(0, 0);
|
||||||
|
|
||||||
var expectedError;
|
var expectedError;
|
||||||
try {
|
try {
|
||||||
@ -53,7 +53,7 @@ testWithBigIntTypedArrayConstructors(TA => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
assert.throws(expectedError, () => {
|
assert.throws(expectedError, () => {
|
||||||
array.copyWithin(new TA(), 0);
|
array.copyWithin(0, 0);
|
||||||
throw new Test262Error('copyWithin completed successfully');
|
throw new Test262Error('copyWithin completed successfully');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user