Nick Vatamaniuc 1ab4972246
For TypedArrays read byteOffset before getting start and final
Previously, in issue #418 and pr #417 I misread the spec that in `subarray` we
should be able to access the `byteOffset` from a detached buffer. Thinking more
about it, something didn't seem right and I started a discussion in the TC39
group [1].

It turns out we shouldn't be able to read the ``byteOffset`` from detched
buffers. Instead, the spec says we should just read the `byteOffset` value
before we access `start` and `finish`. In the test262 test [2] the buffer is
detached when accessing the `end` inside the `valueOf()` conversion, and the
test expects to see the `byteOffset` before it was detached.

So to fix it, ensure we access and save the `byteOffset` value first, then get
the `start` and `finish`.

[1]
https://es.discourse.group/t/typedarray-subarray-byteoffset-with-detached-buffers/2381

[2] https://github.com/tc39/test262/blob/main/test/built-ins/TypedArray/prototype/subarray/byteoffset-with-detached-buffer.js
2025-06-29 14:47:22 -04:00
2024-05-10 01:57:55 +02:00
2025-06-28 10:43:26 +02:00
2025-06-14 11:51:48 +02:00
2025-03-20 11:47:07 +01:00
2025-04-21 15:33:47 +02:00
2025-05-16 20:34:18 +02:00
2025-05-16 20:34:18 +02:00
2024-02-10 16:19:17 +01:00
2024-02-10 16:19:17 +01:00
2025-04-26 12:30:26 +02:00
2025-05-20 18:27:23 +02:00
2025-04-26 12:30:26 +02:00
2020-09-06 18:53:08 +02:00
2025-04-26 12:30:26 +02:00
2025-06-28 10:43:26 +02:00
2020-09-06 18:53:08 +02:00
2024-02-10 20:54:29 +01:00
2025-04-26 12:30:26 +02:00

The main documentation is in doc/quickjs.pdf or doc/quickjs.html.
Description
Public repository of the QuickJS Javascript Engine.
Readme MIT 24 MiB
Languages
C 94.2%
JavaScript 5.2%
Makefile 0.5%
Shell 0.1%