Incorrect test: built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.8k
- Forks
- 564
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 10
Description
This test initializes a Float64Array with elements [1, 2, 3, 4, 5, 6, 7, 8]. Then the same buffer is used to create a Float32Array of size 2 (covering only the first element of the Float64Array).
So the binary representation of the Float32Array is the following:
little endian
00 00 00 00 00 00 F0 3F
big endian
3F F0 00 00 00 00 00 00
Then the first element of the Float32Array is assigned the value 42, this results in:
little endian
00 00 28 42 00 00 F0 3F
big endian
42 28 00 00 00 00 00 00
The test relies on little endian architecture, on big endian it always fails as the initial bits are overwritten. Writing 42 to the second element of the Float32Array and adjusting expected values for big endian would make the test pass.
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
Open built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js and inspect how the shared buffer is initialized and how the expected values are checked. Run this test on little- and big-endian environments; done means the write and expectations pass on both architectures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100