Correct mistakes in support of proposal change

Ensure that when the ArrayBuffer of a length-tracking TypedArray is
resized to the address matching the TypedArray's byte offset, the
TypedArray is *not* considered "out of bounds."
This commit is contained in:
Mike Pennisi 2021-09-22 22:02:26 -04:00 committed by Rick Waldron
parent 94500e1de9
commit 1b72bcd857
2 changed files with 10 additions and 7 deletions

View File

@ -34,13 +34,17 @@ testWithBigIntTypedArrayConstructors(function(TA) {
assert.sameValue(array.byteOffset, BPE, "following shrink (within bounds)");
var expected;
try {
ab.resize(BPE);
} catch (_) {}
assert.sameValue(array.byteOffset, BPE, "following shrink (on boundary)");
var expected = BPE;
try {
ab.resize(0);
expected = 0;
} catch (_) {
expected = BPE;
}
} catch (_) {}
assert.sameValue(array.byteOffset, expected, "following shrink (out of bounds)");
});

View File

@ -34,14 +34,13 @@ testWithTypedArrayConstructors(function(TA) {
assert.sameValue(array.byteOffset, BPE, "following shrink (within bounds)");
var expected = BPE;
try {
ab.resize(BPE);
expected = 0;
} catch (_) {}
assert.sameValue(array.byteOffset, expected, "following shrink (on boundary)");
assert.sameValue(array.byteOffset, BPE, "following shrink (on boundary)");
var expected = BPE;
try {
ab.resize(0);
expected = 0;