Commit Graph

254 Commits

Author SHA1 Message Date
Fabrice Bellard
64c55c6daf removed JS_PROP_NO_ADD 2025-10-03 16:52:17 +02:00
Fabrice Bellard
57f8ec0099 inlined fast path for get_field, get_field2 and put_field 2025-10-03 15:41:21 +02:00
Fabrice Bellard
2c90110287 - optimized global variable access
- removed full compliance with the spec for strict mode variable
  assignment so that they are as fast as in non strict mode (V8,
  SpiderMonkey and JavascriptCore do the same, so IMHO the spec should
  be updated).
2025-10-03 14:26:13 +02:00
Fabrice Bellard
f4951efd94 optimize the create of arrays - optimized the rest and array_from opcodes 2025-10-03 12:25:05 +02:00
Fabrice Bellard
f1253f2ab5 Improve error handling in Promise.withResolvers (bnoordhuis) 2025-10-03 12:00:26 +02:00
Fabrice Bellard
c3e5ae2008 simplified math.sumPrecise() 2025-09-29 16:12:23 +02:00
Fabrice Bellard
00608769df fixed Date parsing: "1997-03-08 11:19:10-0700" is a valid date and "1997-03-08T11:19:10-07" should yield an error 2025-09-29 15:13:04 +02:00
Fabrice Bellard
a6db749af7 fixed Atomics.pause() in the NaN boxing case (32 bit cpu) 2025-09-29 12:10:36 +02:00
Fabrice Bellard
bc753c6a15 added Math.sumPrecise() 2025-09-27 18:44:19 +02:00
Fabrice Bellard
456e016f7c added Map and WeakMap upsert methods (bnoordhuis) 2025-09-27 10:24:48 +02:00
Fabrice Bellard
8807fedec5 - added Atomics.pause (bnoordhuis)
- use the pause instruction for x86 and ARM64 in Atomics.pause()
2025-09-22 18:58:18 +02:00
Fabrice Bellard
f021d7714f - added resizable array buffers (bnoordhuis)
- fixed Atomics.wait, Atomics.notify, TypedArray.prototype.lastIndexOf
- fixed JS_PreventExtensions() with resizable typed arrays
2025-09-22 18:37:41 +02:00
Fabrice Bellard
44d03a823d fixed parsing of computed property name 2025-09-22 14:48:43 +02:00
Fabrice Bellard
1e19893c82 - added ArrayBuffer.prototype.transfer (Divy Srivastava)
- fixed transfer when the ArrayBuffer was allocated with a custom allocator
2025-09-21 16:41:02 +02:00
Fabrice Bellard
2d99c323a2 Iterator functions:
- removed memory leak
- don't close iterator when IteratorStepValue fails
- fixed  Iterator Wrap next() and return() arguments
- fixed Iterator.from()
2025-09-20 18:30:02 +02:00
Fabrice Bellard
cf0e179263 Iterator is an abstract class (bnoordhuis) 2025-09-20 17:05:13 +02:00
Fabrice Bellard
3dcca0d1d6 fix Iterator.prototype.constructor (initial patch by bnoordhuis) 2025-09-20 17:01:52 +02:00
Fabrice Bellard
b2ed2e91f5 added Iterator.prototype.[drop,filter,flatMap,map,take,every,find,forEach,some,reduce,[Symbol.toStringTag]] (saghul) 2025-09-20 16:47:43 +02:00
Fabrice Bellard
e924173c0f added Iterator.prototype.toArray and Iterator.from (bnoordhuis) 2025-09-20 16:27:45 +02:00
Fabrice Bellard
982b7aa14f added the Iterator object 2025-09-20 16:05:36 +02:00
Fabrice Bellard
0377dab4f2 removed uninitialized values - removed useless init 2025-09-20 14:31:14 +02:00
Fabrice Bellard
0cef7f0ddb set methods: removed memory leaks - fixed ordering of property access - fixed conversion to integer of 'size' in GetSetRecord() - added missing iterator close - factorized code 2025-09-20 14:21:39 +02:00
Fabrice Bellard
a1e073e444 added set methods (bnoordhuis) 2025-09-20 12:19:50 +02:00
Fabrice Bellard
de4d3927b8 removed memory leak (#441) 2025-09-18 10:42:13 +02:00
Fabrice Bellard
391cd3feff Fix crash on failure to read bytecode (penneryu) 2025-09-13 10:22:24 +02:00
Fabrice Bellard
9f6c190731 more efficient handling of strings in JSON.stringify() 2025-09-10 18:40:10 +02:00
Fabrice Bellard
8a0a6e92d2 better pretty printing of strings - removed String.prototype.__quote() 2025-09-10 18:25:34 +02:00
Fabrice Bellard
0b3c73ed9c removed function cast warnings (initial patch by saghul) 2025-08-27 15:16:52 +02:00
Fabrice Bellard
d9ec8f102e limit function and regexp bytecode to 1G to avoid buffer overflows (the bytecode generators assume that bytecode offsets can fit a 32 bit signed integer 2025-08-25 17:14:47 +02:00
Fabrice Bellard
4e0d0b7f80 avoid side effects in JS_PrintValue() which may lead to crashes in print() and js_std_promise_rejection_check() 2025-08-25 16:48:36 +02:00
Fabrice Bellard
c927eca49a fixed buffer overflow in TypedArray.prototype.lastIndexOf() 2025-08-25 15:25:41 +02:00
Fabrice Bellard
9ce544289f fixed buffer overflow in js_bigint_to_string1() 2025-08-25 15:06:19 +02:00
Fabrice Bellard
1168c215d1 fixed crash in OP_add_loc if the variable is modified in JS_ToPrimitiveFree() 2025-08-25 14:50:04 +02:00
Fabrice Bellard
e1c18befb8 fixed buffer overflow in js_bigint_from_string() 2025-08-25 14:24:06 +02:00
Fabrice Bellard
c942978927 TypedArray.prototype.subarray: fixed the step at which '[[ByteOffset]]' is read 2025-08-25 14:01:43 +02: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