]> git.kaiwu.me - quickjs.git/log
quickjs.git
8 months agoinlined fast path for get_field, get_field2 and put_field
Fabrice Bellard [Fri, 3 Oct 2025 13:41:21 +0000 (15:41 +0200)]
inlined fast path for get_field, get_field2 and put_field

8 months ago- optimized global variable access
Fabrice Bellard [Fri, 3 Oct 2025 12:26:13 +0000 (14:26 +0200)]
- 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).

8 months agooptimize the create of arrays - optimized the rest and array_from opcodes
Fabrice Bellard [Fri, 3 Oct 2025 10:25:05 +0000 (12:25 +0200)]
optimize the create of arrays - optimized the rest and array_from opcodes

8 months agoImprove error handling in Promise.withResolvers (bnoordhuis)
Fabrice Bellard [Fri, 3 Oct 2025 10:00:26 +0000 (12:00 +0200)]
Improve error handling in Promise.withResolvers (bnoordhuis)

8 months agoupdated test262
Fabrice Bellard [Fri, 3 Oct 2025 09:55:50 +0000 (11:55 +0200)]
updated test262

9 months agoMerge pull request #408 from nickva/run-test262-in-ci
bellard [Tue, 30 Sep 2025 08:35:00 +0000 (10:35 +0200)]
Merge pull request #408 from nickva/run-test262-in-ci

Run test262 tests in CI

9 months agoRun test262 tests in CI
Nick Vatamaniuc [Tue, 13 May 2025 03:35:22 +0000 (23:35 -0400)]
Run test262 tests in CI

Run test262 tests for Linux, macOS and Cosmopolitan

Add a Makefile `test2-bootstrap` helper to clone and patch test262 tests at
a particular commit. Running with the latest commit noticed a few tests were
failing and added them to the errors list.

The CI environment, especially for macOS, was a bit more unpredictable and was
failing in atomics tests due to lower timeouts in the `atomicsHelper` so double
the timeouts. The time didn't worsen too much. It still takes about 2-3 min.

9 months agosimplified math.sumPrecise()
Fabrice Bellard [Mon, 29 Sep 2025 14:12:23 +0000 (16:12 +0200)]
simplified math.sumPrecise()

9 months agofixed Date parsing: "1997-03-08 11:19:10-0700" is a valid date and "1997-03-08T11...
Fabrice Bellard [Mon, 29 Sep 2025 13:13:04 +0000 (15:13 +0200)]
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

9 months agofixed Atomics.pause() in the NaN boxing case (32 bit cpu)
Fabrice Bellard [Mon, 29 Sep 2025 10:10:36 +0000 (12:10 +0200)]
fixed Atomics.pause() in the NaN boxing case (32 bit cpu)

9 months agoadded Math.sumPrecise()
Fabrice Bellard [Sat, 27 Sep 2025 16:44:19 +0000 (18:44 +0200)]
added Math.sumPrecise()

9 months agoadded Map and WeakMap upsert methods (bnoordhuis)
Fabrice Bellard [Sat, 27 Sep 2025 08:24:48 +0000 (10:24 +0200)]
added Map and WeakMap upsert methods (bnoordhuis)

9 months ago- added Atomics.pause (bnoordhuis)
Fabrice Bellard [Mon, 22 Sep 2025 16:58:18 +0000 (18:58 +0200)]
- added Atomics.pause (bnoordhuis)
- use the pause instruction for x86 and ARM64 in Atomics.pause()

9 months ago- added resizable array buffers (bnoordhuis)
Fabrice Bellard [Mon, 22 Sep 2025 16:37:41 +0000 (18:37 +0200)]
- added resizable array buffers (bnoordhuis)
- fixed Atomics.wait, Atomics.notify, TypedArray.prototype.lastIndexOf
- fixed JS_PreventExtensions() with resizable typed arrays

9 months agofixed parsing of computed property name
Fabrice Bellard [Mon, 22 Sep 2025 12:48:43 +0000 (14:48 +0200)]
fixed parsing of computed property name

9 months ago- added ArrayBuffer.prototype.transfer (Divy Srivastava)
Fabrice Bellard [Sun, 21 Sep 2025 14:41:02 +0000 (16:41 +0200)]
- added ArrayBuffer.prototype.transfer (Divy Srivastava)
- fixed transfer when the ArrayBuffer was allocated with a custom allocator

9 months agoIterator functions:
Fabrice Bellard [Sat, 20 Sep 2025 16:30:02 +0000 (18:30 +0200)]
Iterator functions:

- removed memory leak
- don't close iterator when IteratorStepValue fails
- fixed  Iterator Wrap next() and return() arguments
- fixed Iterator.from()

9 months agoIterator is an abstract class (bnoordhuis)
Fabrice Bellard [Sat, 20 Sep 2025 15:05:13 +0000 (17:05 +0200)]
Iterator is an abstract class (bnoordhuis)

9 months agofix Iterator.prototype.constructor (initial patch by bnoordhuis)
Fabrice Bellard [Sat, 20 Sep 2025 15:01:52 +0000 (17:01 +0200)]
fix Iterator.prototype.constructor (initial patch by bnoordhuis)

9 months agoadded Iterator.prototype.[drop,filter,flatMap,map,take,every,find,forEach,some,reduce...
Fabrice Bellard [Sat, 20 Sep 2025 14:47:43 +0000 (16:47 +0200)]
added Iterator.prototype.[drop,filter,flatMap,map,take,every,find,forEach,some,reduce,[Symbol.toStringTag]] (saghul)

9 months agoadded Iterator.prototype.toArray and Iterator.from (bnoordhuis)
Fabrice Bellard [Sat, 20 Sep 2025 14:27:45 +0000 (16:27 +0200)]
added Iterator.prototype.toArray and Iterator.from (bnoordhuis)

9 months agoadded the Iterator object
Fabrice Bellard [Sat, 20 Sep 2025 14:05:36 +0000 (16:05 +0200)]
added the Iterator object

9 months agoremoved uninitialized values - removed useless init
Fabrice Bellard [Sat, 20 Sep 2025 12:31:14 +0000 (14:31 +0200)]
removed uninitialized values - removed useless init

9 months agoset methods: removed memory leaks - fixed ordering of property access - fixed convers...
Fabrice Bellard [Sat, 20 Sep 2025 12:21:39 +0000 (14:21 +0200)]
set methods: removed memory leaks - fixed ordering of property access - fixed conversion to integer of 'size' in GetSetRecord() - added missing iterator close - factorized code

9 months agoadded set methods (bnoordhuis)
Fabrice Bellard [Sat, 20 Sep 2025 10:19:50 +0000 (12:19 +0200)]
added set methods (bnoordhuis)

9 months agoremoved memory leak (#441)
Fabrice Bellard [Thu, 18 Sep 2025 08:42:13 +0000 (10:42 +0200)]
removed memory leak (#441)

9 months agoupdated release.sh
Fabrice Bellard [Thu, 18 Sep 2025 08:28:33 +0000 (10:28 +0200)]
updated release.sh

9 months agonew release
Fabrice Bellard [Sat, 13 Sep 2025 08:51:18 +0000 (10:51 +0200)]
new release

9 months agoFix crash on failure to read bytecode (penneryu)
Fabrice Bellard [Sat, 13 Sep 2025 08:22:24 +0000 (10:22 +0200)]
Fix crash on failure to read bytecode (penneryu)

9 months agomore efficient handling of strings in JSON.stringify()
Fabrice Bellard [Wed, 10 Sep 2025 16:40:10 +0000 (18:40 +0200)]
more efficient handling of strings in JSON.stringify()

9 months agobetter pretty printing of strings - removed String.prototype.__quote()
Fabrice Bellard [Wed, 10 Sep 2025 16:25:34 +0000 (18:25 +0200)]
better pretty printing of strings - removed String.prototype.__quote()

10 months agoqjsc: handle C name conflicts between scripts and modules (#432)
Fabrice Bellard [Wed, 27 Aug 2025 14:06:44 +0000 (16:06 +0200)]
qjsc: handle C name conflicts between scripts and modules (#432)

10 months agorun-test262: added --count_skipped_features option
Fabrice Bellard [Wed, 27 Aug 2025 13:19:45 +0000 (15:19 +0200)]
run-test262: added --count_skipped_features option

10 months agoremoved function cast warnings (initial patch by saghul)
Fabrice Bellard [Wed, 27 Aug 2025 13:16:52 +0000 (15:16 +0200)]
removed function cast warnings (initial patch by saghul)

10 months agofixed handling of 8 bit unicode strings in RegExp (regression introduced by commit...
Fabrice Bellard [Mon, 25 Aug 2025 16:20:58 +0000 (18:20 +0200)]
fixed handling of 8 bit unicode strings in RegExp (regression introduced by commit a4ac84d)

10 months agoAdjust lastIndex to leading surrogate when inside a surrogate pair in unicode RegExp...
Fabrice Bellard [Mon, 25 Aug 2025 15:54:19 +0000 (17:54 +0200)]
Adjust lastIndex to leading surrogate when inside a surrogate pair in unicode RegExp (initial patch by auvred)

10 months agolimit function and regexp bytecode to 1G to avoid buffer overflows (the bytecode...
Fabrice Bellard [Mon, 25 Aug 2025 15:14:47 +0000 (17:14 +0200)]
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

10 months agoavoid side effects in JS_PrintValue() which may lead to crashes in print() and js_std...
Fabrice Bellard [Mon, 25 Aug 2025 14:48:36 +0000 (16:48 +0200)]
avoid side effects in JS_PrintValue() which may lead to crashes in print() and js_std_promise_rejection_check()

10 months agofixed buffer overflow in TypedArray.prototype.lastIndexOf()
Fabrice Bellard [Mon, 25 Aug 2025 13:25:41 +0000 (15:25 +0200)]
fixed buffer overflow in TypedArray.prototype.lastIndexOf()

10 months agofixed buffer overflow in js_bigint_to_string1()
Fabrice Bellard [Mon, 25 Aug 2025 13:06:19 +0000 (15:06 +0200)]
fixed buffer overflow in js_bigint_to_string1()

10 months agofixed crash in OP_add_loc if the variable is modified in JS_ToPrimitiveFree()
Fabrice Bellard [Mon, 25 Aug 2025 12:50:04 +0000 (14:50 +0200)]
fixed crash in OP_add_loc if the variable is modified in JS_ToPrimitiveFree()

10 months agofixed buffer overflow in js_bigint_from_string()
Fabrice Bellard [Mon, 25 Aug 2025 12:24:06 +0000 (14:24 +0200)]
fixed buffer overflow in js_bigint_from_string()

10 months agoTypedArray.prototype.subarray: fixed the step at which '[[ByteOffset]]' is read
Fabrice Bellard [Mon, 25 Aug 2025 12:01:43 +0000 (14:01 +0200)]
TypedArray.prototype.subarray: fixed the step at which '[[ByteOffset]]' is read

10 months agotest262 update
Fabrice Bellard [Mon, 25 Aug 2025 10:05:21 +0000 (12:05 +0200)]
test262 update

11 months agoremoved module leak in js_std_eval_binary() (#425)
Fabrice Bellard [Wed, 9 Jul 2025 12:39:19 +0000 (14:39 +0200)]
removed module leak in js_std_eval_binary() (#425)

12 months agofixed GC logic so that a module can live after a JSContext is destroyed (#280) -...
Fabrice Bellard [Sat, 28 Jun 2025 15:41:58 +0000 (17:41 +0200)]
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

12 months agofixed module async evaluation logic - added DUMP_MODULE_EXEC
Fabrice Bellard [Sat, 28 Jun 2025 15:25:54 +0000 (17:25 +0200)]
fixed module async evaluation logic - added DUMP_MODULE_EXEC

12 months agoupdate test262
Fabrice Bellard [Sat, 28 Jun 2025 08:43:26 +0000 (10:43 +0200)]
update test262

12 months agoupdate Changelog
Fabrice Bellard [Sat, 14 Jun 2025 09:51:48 +0000 (11:51 +0200)]
update Changelog

12 months agoadded Error.isError() (bnoordhuis)
Fabrice Bellard [Sat, 14 Jun 2025 09:42:54 +0000 (11:42 +0200)]
added Error.isError() (bnoordhuis)

12 months agoMerge pull request #418 from nickva/fix-byteoffset-for-detached-array-buffers
bellard [Sat, 14 Jun 2025 09:30:13 +0000 (11:30 +0200)]
Merge pull request #418 from nickva/fix-byteoffset-for-detached-array-buffers

Fix byteOffset for detached array buffers

12 months agoFix Windows MinGW CI Build
Nick Vatamaniuc [Sat, 7 Jun 2025 05:12:54 +0000 (01:12 -0400)]
Fix Windows MinGW CI Build

```
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Error: Process completed with exit code 100.
```

As the error suggests `apt update` seems to fix it

12 months agoRead byteOffset for detached buffers
Nick Vatamaniuc [Sat, 7 Jun 2025 04:42:50 +0000 (00:42 -0400)]
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

13 months agofixed js_bigint_to_string1() (#412)
Fabrice Bellard [Thu, 29 May 2025 18:01:24 +0000 (20:01 +0200)]
fixed js_bigint_to_string1() (#412)

13 months agoupdate tests
Fabrice Bellard [Sat, 24 May 2025 13:43:14 +0000 (15:43 +0200)]
update tests

13 months agoadded missing 'Unknown' unicode Script
Fabrice Bellard [Sat, 24 May 2025 13:36:08 +0000 (15:36 +0200)]
added missing 'Unknown' unicode Script

13 months agoupdate tests
Fabrice Bellard [Sat, 24 May 2025 11:26:36 +0000 (13:26 +0200)]
update tests

13 months agonew keyword cannot be used with an optional chain
Fabrice Bellard [Sat, 24 May 2025 11:01:50 +0000 (13:01 +0200)]
new keyword cannot be used with an optional chain

13 months agofixed parsing of function definition
Fabrice Bellard [Sat, 24 May 2025 10:47:35 +0000 (12:47 +0200)]
fixed parsing of function definition

13 months agomore robust out of memory handling (#406)
Fabrice Bellard [Sat, 24 May 2025 10:09:46 +0000 (12:09 +0200)]
more robust out of memory handling (#406)

13 months agoavoid win32 crash in getTimezoneOffset() if time is < 1970 (#238)
Fabrice Bellard [Sat, 24 May 2025 09:32:22 +0000 (11:32 +0200)]
avoid win32 crash in getTimezoneOffset() if time is < 1970 (#238)

13 months agosupport JSON modules in qjsc - added support of JSON5 modules (using type = "json5")
Fabrice Bellard [Sat, 24 May 2025 08:24:01 +0000 (10:24 +0200)]
support JSON modules in qjsc - added support of JSON5 modules (using type = "json5")

13 months agoimproved compatibility of std.parseExtJSON() with JSON5
Fabrice Bellard [Sat, 24 May 2025 08:16:10 +0000 (10:16 +0200)]
improved compatibility of std.parseExtJSON() with JSON5

13 months agofixed Regexp.prototype[Symbol.match]
Fabrice Bellard [Sat, 24 May 2025 08:12:51 +0000 (10:12 +0200)]
fixed Regexp.prototype[Symbol.match]

13 months agouse Object.is() in tests
Fabrice Bellard [Sat, 24 May 2025 08:02:50 +0000 (10:02 +0200)]
use Object.is() in tests

13 months agoadded JSON modules and import attributes
Fabrice Bellard [Tue, 20 May 2025 16:27:23 +0000 (18:27 +0200)]
added JSON modules and import attributes

13 months agoadded JS_AtomToCStringLen()
Fabrice Bellard [Tue, 20 May 2025 16:03:29 +0000 (18:03 +0200)]
added JS_AtomToCStringLen()

13 months agoexport JS_FreePropertyEnum()
Fabrice Bellard [Tue, 20 May 2025 15:59:48 +0000 (17:59 +0200)]
export JS_FreePropertyEnum()

13 months agoimproved JSON parser conformity (chqrlie) (#250)
Fabrice Bellard [Mon, 19 May 2025 15:23:25 +0000 (17:23 +0200)]
improved JSON parser conformity (chqrlie) (#250)

13 months agoProxy: fixed prototype comparison in setPrototypeOf() and getPrototypeOf() (#410)
Fabrice Bellard [Mon, 19 May 2025 11:35:06 +0000 (13:35 +0200)]
Proxy: fixed prototype comparison in setPrototypeOf() and getPrototypeOf() (#410)

13 months agocompilation fix
Fabrice Bellard [Fri, 16 May 2025 18:48:01 +0000 (20:48 +0200)]
compilation fix

13 months agoupdate test results
Fabrice Bellard [Fri, 16 May 2025 18:38:56 +0000 (20:38 +0200)]
update test results

13 months agoadded regexp modifiers
Fabrice Bellard [Fri, 16 May 2025 18:34:18 +0000 (20:34 +0200)]
added regexp modifiers

13 months agoadded Promise.try (saghul)
Fabrice Bellard [Fri, 16 May 2025 16:02:14 +0000 (18:02 +0200)]
added Promise.try (saghul)

13 months agobetter promise rejection tracker heuristics (#112)
Fabrice Bellard [Fri, 16 May 2025 15:47:41 +0000 (17:47 +0200)]
better promise rejection tracker heuristics (#112)

13 months agoregexp: added v flag support - fixed corner cases of case insensitive matching
Fabrice Bellard [Fri, 16 May 2025 15:43:03 +0000 (17:43 +0200)]
regexp: added v flag support - fixed corner cases of case insensitive matching

13 months agoadded Float16Array (bnoordhuis) - optimized float16 conversion functions
Fabrice Bellard [Mon, 5 May 2025 17:12:32 +0000 (19:12 +0200)]
added Float16Array (bnoordhuis) - optimized float16 conversion functions

13 months agoadded RegExp.escape (bnoordhuis)
Fabrice Bellard [Mon, 5 May 2025 14:46:21 +0000 (16:46 +0200)]
added RegExp.escape (bnoordhuis)

13 months agoavoid relying on 'FILE *' in JS_PrintValue() API
Fabrice Bellard [Mon, 5 May 2025 13:59:04 +0000 (15:59 +0200)]
avoid relying on 'FILE *' in JS_PrintValue() API

14 months agoadded get_array_el3 opcode - removed to_propkey2 opcode
Fabrice Bellard [Wed, 30 Apr 2025 12:12:10 +0000 (14:12 +0200)]
added get_array_el3 opcode - removed to_propkey2 opcode

14 months agofixed use of JS_DumpValue()
Fabrice Bellard [Wed, 30 Apr 2025 12:09:31 +0000 (14:09 +0200)]
fixed use of JS_DumpValue()

14 months agoadded JS_PrintValue() and use it in console.log(), print() and the REPL (#256)
Fabrice Bellard [Wed, 30 Apr 2025 11:40:15 +0000 (13:40 +0200)]
added JS_PrintValue() and use it in console.log(), print() and the REPL (#256)

14 months agoObject.prototype has an immutable prototype
Fabrice Bellard [Tue, 29 Apr 2025 17:03:36 +0000 (19:03 +0200)]
Object.prototype has an immutable prototype

14 months agosimplified uncatchable exception handling
Fabrice Bellard [Tue, 29 Apr 2025 16:48:58 +0000 (18:48 +0200)]
simplified uncatchable exception handling

14 months agohandle strings as module import and export names
Fabrice Bellard [Tue, 29 Apr 2025 12:54:57 +0000 (14:54 +0200)]
handle strings as module import and export names

14 months agoupdate tests
Fabrice Bellard [Mon, 28 Apr 2025 14:37:51 +0000 (16:37 +0200)]
update tests

14 months agofixed operation order in js_obj_to_desc()
Fabrice Bellard [Mon, 28 Apr 2025 14:33:14 +0000 (16:33 +0200)]
fixed operation order in js_obj_to_desc()

14 months agofixed the delete operator with global variables
Fabrice Bellard [Mon, 28 Apr 2025 14:32:23 +0000 (16:32 +0200)]
fixed the delete operator with global variables

14 months agofixed js_std_await() so that it behaves the same way as js_std_loop() (#402)
Fabrice Bellard [Mon, 28 Apr 2025 14:28:01 +0000 (16:28 +0200)]
fixed js_std_await() so that it behaves the same way as js_std_loop() (#402)

14 months agonew release
Fabrice Bellard [Sat, 26 Apr 2025 10:30:26 +0000 (12:30 +0200)]
new release

14 months agoadded more C callbacks for exotic objects (#324)
Fabrice Bellard [Sat, 26 Apr 2025 10:25:42 +0000 (12:25 +0200)]
added more C callbacks for exotic objects (#324)

14 months agomore precise error location reporting
Fabrice Bellard [Sat, 26 Apr 2025 10:25:00 +0000 (12:25 +0200)]
more precise error location reporting

14 months agoMerge pull request #393 from nickva/more-ci-targets-and-windows-fixes
bellard [Tue, 22 Apr 2025 17:18:16 +0000 (19:18 +0200)]
Merge pull request #393 from nickva/more-ci-targets-and-windows-fixes

More CI tragets: Linux 32bit, Windows and Cosmopolitan

14 months agoupdate tests
Fabrice Bellard [Tue, 22 Apr 2025 17:16:19 +0000 (19:16 +0200)]
update tests

14 months agorun-test262: added $262.gc()
Fabrice Bellard [Tue, 22 Apr 2025 17:09:26 +0000 (19:09 +0200)]
run-test262: added $262.gc()

14 months agofixed TypedArray.prototype.slice() when the buffers overlap
Fabrice Bellard [Tue, 22 Apr 2025 17:07:47 +0000 (19:07 +0200)]
fixed TypedArray.prototype.slice() when the buffers overlap

14 months agofixed TypedArray.prototype.with with detached ArrayBuffer
Fabrice Bellard [Tue, 22 Apr 2025 17:05:36 +0000 (19:05 +0200)]
fixed TypedArray.prototype.with with detached ArrayBuffer

14 months agofixed GeneratorFunction prototype
Fabrice Bellard [Tue, 22 Apr 2025 17:03:18 +0000 (19:03 +0200)]
fixed GeneratorFunction prototype

14 months agofixed RegExp.prototype[Symbol.split]
Fabrice Bellard [Tue, 22 Apr 2025 17:01:43 +0000 (19:01 +0200)]
fixed RegExp.prototype[Symbol.split]

14 months agofixed operation order in Object.prototype.propertyIsEnumerable()
Fabrice Bellard [Tue, 22 Apr 2025 16:59:21 +0000 (18:59 +0200)]
fixed operation order in Object.prototype.propertyIsEnumerable()