Missing coverage: Resizable / Growable (Shared)ArrayBuffers: More combinations for TypedArray.prototype.set
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.8k
- Forks
- 564
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 10
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with built-ins/TypedArray/prototype/set/typedarray-arg-target-out-of-bounds.js and review the existing TypedArray.prototype.set test coverage in test262. Add tests for RAB/GSAB and non-RAB/GSAB source and target combinations, differing element types, SharedArrayBuffers, and relevant out-of-bounds cases. Done means the listed combinations are covered and the tests pass against compliant implementations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100