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
Fabrice Bellard
458c34d29d
fixed GC logic so that a module can live after a JSContext is destroyed ( #280 ) - update the reference count for the realm in jobs and FinalizationRegistry
2025-06-28 17:41:58 +02:00
Fabrice Bellard
2fd48bf7df
fixed module async evaluation logic - added DUMP_MODULE_EXEC
2025-06-28 17:25:54 +02:00
Fabrice Bellard
098f221cf3
added Error.isError() (bnoordhuis)
2025-06-14 11:42:54 +02:00
Nick Vatamaniuc
00b1d8d0b2
Read byteOffset for detached buffers
...
The spec [1] expects to read `byteOffset` even for detached buffers.
Noticed a new test262 test [2] failed and there an an existing one we skipped
as well for the same reason.
[1] https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray
[2] https://github.com/tc39/test262/blob/main/test/built-ins/TypedArray/prototype/subarray/byteoffset-with-detached-buffer.js
Fix: https://github.com/bellard/quickjs/issues/417
2025-06-07 01:37:54 -04:00
Fabrice Bellard
638ec8ca5e
fixed js_bigint_to_string1() ( #412 )
2025-05-29 20:01:24 +02:00
Fabrice Bellard
3d92a9d30c
new keyword cannot be used with an optional chain
2025-05-24 13:01:50 +02:00
Fabrice Bellard
02a2643142
fixed parsing of function definition
2025-05-24 12:47:35 +02:00
Fabrice Bellard
3dc7ef1f7f
more robust out of memory handling ( #406 )
2025-05-24 12:09:46 +02:00
Fabrice Bellard
1572aa8a59
avoid win32 crash in getTimezoneOffset() if time is < 1970 ( #238 )
2025-05-24 11:32:22 +02:00
Fabrice Bellard
7c487f1c6a
support JSON modules in qjsc - added support of JSON5 modules (using type = "json5")
2025-05-24 10:24:01 +02:00
Fabrice Bellard
1dfaa61680
improved compatibility of std.parseExtJSON() with JSON5
2025-05-24 10:16:10 +02:00
Fabrice Bellard
8b2a1249a4
fixed Regexp.prototype[Symbol.match]
2025-05-24 10:12:51 +02:00
Fabrice Bellard
f10ef299a6
added JSON modules and import attributes
2025-05-20 18:27:23 +02:00
Fabrice Bellard
838124580b
added JS_AtomToCStringLen()
2025-05-20 18:03:29 +02:00
Fabrice Bellard
2f167bbeeb
export JS_FreePropertyEnum()
2025-05-20 17:59:48 +02:00
Fabrice Bellard
9bce51eefd
improved JSON parser conformity (chqrlie) ( #250 )
2025-05-19 17:23:25 +02:00
Fabrice Bellard
aaa9cea6a8
Proxy: fixed prototype comparison in setPrototypeOf() and getPrototypeOf() ( #410 )
2025-05-19 13:35:06 +02:00
Fabrice Bellard
1021e3c729
compilation fix
2025-05-16 20:48:01 +02:00
Fabrice Bellard
9c973a8923
added Promise.try (saghul)
2025-05-16 18:02:14 +02:00
Fabrice Bellard
d7cdfdc8d7
regexp: added v flag support - fixed corner cases of case insensitive matching
2025-05-16 17:43:03 +02:00
Fabrice Bellard
a8b2d7c2b2
added Float16Array (bnoordhuis) - optimized float16 conversion functions
2025-05-05 19:12:32 +02:00
Fabrice Bellard
c95b024d3e
added RegExp.escape (bnoordhuis)
2025-05-05 16:46:21 +02:00
Fabrice Bellard
0a6160d7b3
avoid relying on 'FILE *' in JS_PrintValue() API
2025-05-05 15:59:04 +02:00
Fabrice Bellard
11d076fac6
added get_array_el3 opcode - removed to_propkey2 opcode
2025-04-30 14:12:10 +02:00
Fabrice Bellard
703de06c43
fixed use of JS_DumpValue()
2025-04-30 14:09:31 +02:00
Fabrice Bellard
be06b3e92b
added JS_PrintValue() and use it in console.log(), print() and the REPL ( #256 )
2025-04-30 13:40:15 +02:00
Fabrice Bellard
30fe3de91d
Object.prototype has an immutable prototype
2025-04-29 19:03:36 +02:00
Fabrice Bellard
53327c2580
simplified uncatchable exception handling
2025-04-29 18:48:58 +02:00
Fabrice Bellard
23e2dc9c39
handle strings as module import and export names
2025-04-29 14:54:57 +02:00
Fabrice Bellard
9bb1d7252b
fixed operation order in js_obj_to_desc()
2025-04-28 16:33:14 +02:00
Fabrice Bellard
2d4e1cc20c
fixed the delete operator with global variables
2025-04-28 16:32:23 +02:00
Fabrice Bellard
1b13fa6450
added more C callbacks for exotic objects ( #324 )
2025-04-26 12:25:42 +02:00
Fabrice Bellard
7645ce5f63
more precise error location reporting
2025-04-26 12:25:00 +02:00
Fabrice Bellard
3bffe67e6b
fixed TypedArray.prototype.slice() when the buffers overlap
2025-04-22 19:07:47 +02:00
Fabrice Bellard
08a28c0cc3
fixed TypedArray.prototype.with with detached ArrayBuffer
2025-04-22 19:05:36 +02:00
Fabrice Bellard
a0a760f74f
fixed GeneratorFunction prototype
2025-04-22 19:03:18 +02:00
Fabrice Bellard
b32cccb5fe
fixed RegExp.prototype[Symbol.split]
2025-04-22 19:01:43 +02:00
Fabrice Bellard
1e958abcd8
fixed operation order in Object.prototype.propertyIsEnumerable()
2025-04-22 18:59:21 +02:00
Fabrice Bellard
5afd0eb37b
fix property ordering in the object returned by RegExp.prototype.exec()
2025-04-22 18:56:59 +02:00
Fabrice Bellard
5e71d148f2
setters cannot have rest arguments
2025-04-22 18:53:48 +02:00
Fabrice Bellard
99a855f2c7
future reserved keywords are forbidden in function name and arguments when the function body is in strict mode
2025-04-22 18:51:54 +02:00
Fabrice Bellard
fbf7d8a205
fixed detached TypedArray handling in Atomics operations
2025-04-21 16:14:00 +02:00
Fabrice Bellard
334aa18013
fixed iterator close in Map/Set constructor
2025-04-21 16:12:56 +02:00
Fabrice Bellard
37cde16ba2
fixed build_arg_list()
2025-04-21 14:13:49 +02:00
Fabrice Bellard
e1f6dfe61a
fixed checks in Proxy defineProperty
2025-04-21 14:00:32 +02:00
Fabrice Bellard
e7264d6f94
fixed Array.from() and TypedArray.from()
2025-04-21 12:39:18 +02:00
Fabrice Bellard
000db3aab3
the %TypedArray% Intrinsic Object should be a constructor
2025-04-21 11:52:42 +02:00
Fabrice Bellard
db3d3f09cd
fixed memory leak in String constructor
2025-04-16 17:16:10 +02:00
Fabrice Bellard
b67c41689e
fixed Proxy getOwnPropertyDescriptor with getters and setters
2025-04-16 16:51:34 +02:00