Missing coverage: Resizable / Growable (Shared)ArrayBuffers: More combinations for TypedArray.prototype.set
There are some tests which pass RAB/GSAB to TypedArray.prototype.set, but those don't seem to cover enough cases. Proof: I now have v8 in a state where all TA.p.set -related test262 tests pass, but there are bugs in the uncovered code paths. :)
At least these seem uncovered:
- target is a RAB/GSAB-TA and source is a non-RAB/GSAB TA and the source is not OOB
There is built-ins/TypedArray/prototype/set/typedarray-arg-target-out-of-bounds.js but it doesn't cover this case.
Here's a simple test that currently fails for my impl even though test262 passes:
let a = new Uint8Array(new ArrayBuffer(80, {maxByteLength: 100}));
let a2 = new Uint8Array(new ArrayBuffer(80));
a2.set(a);
-
target is a non-RAB/GSAB-TA and source is a RAB/GSAB TA (both "source OOB" and "source not OOB" cases would be relevant)
-
source and target have different element types
-
SharedArrayBuffers (the existing test only uses ArrayBuffers)
-
In addition, tests where the resizing happens when getting the length of the arraylike source in https://tc39.es/ecma262/#sec-settypedarrayfromarraylike , or when iterating the arraylike, are missing. But I think I have another open issue for covering those cases for all TA.p. functions.
cc @sarahghp @syg