Commit graph

584 commits

Author SHA1 Message Date
Ben Noordhuis
0e5e9c2c49
Fix broken DUMP_BYTECODE debug option (#489)
Broken in commit 1baa6763f8 when unicode_from_utf8 was renamed to
utf8_decode_len.
2024-08-25 11:53:30 +02:00
Ben Noordhuis
568ac13ff5
Optimize js_map_write, don't loop twice (#488) 2024-08-23 17:53:17 +02:00
Ben Noordhuis
4e52027fe7
Fix invalid free() in run-test262 (#487) 2024-08-23 17:53:02 +02:00
Ben Noordhuis
cee3b88edb
Fix async iterator missing throw method behavior (#485) 2024-08-22 09:02:11 +02:00
Ben Noordhuis
408fed8fa5
Update test262 (#484)
test262/implementation-contributed/v8/mjsunit was removed upstream in
commit tc39/test262@a15874163e so this
commit also removes the v8 test runner; it's no longer functional.
2024-08-21 23:36:09 +02:00
Ben Noordhuis
3a58376485
Support (de)serializing Map and Set objects (#483)
Fixes: https://github.com/quickjs-ng/quickjs/issues/482
2024-08-19 12:20:42 +02:00
Saúl Ibarra Corretgé
5db156fb08 Use INT32_MAX instead of inline value 2024-08-13 12:56:11 +02:00
Ben Noordhuis
da1d3cb994
Accept more flags in bjson read/write methods (#479)
Change the last argument from a boolean to an integer and export the
JS_READ_* and JS_WRITE_* flags on the bjson module object.
2024-08-12 16:53:39 +02:00
Ben Noordhuis
5a50ce3b08
Export bjson module (#478)
I find it convenient to have access to JS_ReadObject and JS_WriteObject
from JS land. That's precisely the functionality that tests/bjson.c
provides, ergo, move it into quickjs-libc.c
2024-08-11 11:04:08 +02:00
Andrew Johnson
a959457309 Add recommended workaround for dlsym void* return cast 2024-07-30 11:09:21 +02:00
Andrew Johnson
1aa0020cce Guard int128_t typedef 2024-07-30 11:09:21 +02:00
Andrew Johnson
b65ed3bb73 Remove unnecessary forward reference for OpCodeEnum 2024-07-30 11:09:21 +02:00
Andrew Johnson
4bfffe8e12 Mark indirect goto and address-as-label as extensions 2024-07-30 11:09:21 +02:00
Andrew Johnson
8f1ac67ea9 Avoid void pointer to function pointer casts 2024-07-30 11:09:21 +02:00
Andrew Johnson
9ba23f269c Forward reference to enum type 2024-07-30 11:09:21 +02:00
Andrew Johnson
4dead002e4 Mark __int128 as extension 2024-07-30 11:09:21 +02:00
Andrew Johnson
7b0e05dea9 Use ISO C syntax for flexible array members 2024-07-30 11:09:21 +02:00
Kevin Wang
c4d3833966 Fix declaring property named get/set/async 2024-07-25 23:21:16 +02:00
Dmitry Volyntsev
da5b95dcaf Fix GC leak in js_proxy_get()
Fixes: https://github.com/bellard/quickjs/issues/277
2024-07-16 23:04:18 +02:00
Saúl Ibarra Corretgé
bc1e3cd009
Update README.md 2024-07-16 22:28:52 +02:00
Fabrice Bellard
009a60218f regexp: fix non greedy quantizers with zero length matches
Cherry-picked from:
36911f0d3a
2024-07-16 22:23:37 +02:00
Saúl Ibarra Corretgé
763010663b Add auxiliary structure for retrieving SAB tabs 2024-07-15 16:53:52 +02:00
Saúl Ibarra Corretgé
3ed591c02d Introduce JS_ReadObject2
Analogously to JS_WriteObject2, it allows the user to get a tab with all
the SAB objects that were read.

This can help adjust reference counts in a scenario where a SAB that was
written increased it and it's necessary to decrease it upon reading it.
2024-07-15 16:53:52 +02:00
Saúl Ibarra Corretgé
c011898ea0 Fix memory leak in JS_WriteObject2
If a SAB was written sab_tab will have been allocated. Free it if the
user didn't provide a way to retrieve it.
2024-07-15 08:59:20 +02:00
Andrew Johnson
7faef8680d Extern after windows.h 2024-07-15 00:23:49 +02:00
Andrew Johnson
af084de6f9 Add 'extern' statements to public headers for C++ compatibility 2024-07-15 00:23:49 +02:00
Saúl Ibarra Corretgé
f9d1029ea3 Fix Linux with GCC 4.8 CI
Complains in the post-ckeckout step:

```
 Post job cleanup.
/usr/bin/docker exec  f32fc88d37a181d710e2802cbad0646c9780efe4af35a093fe68d09d8201a74e sh -c "cat /etc/*release | grep ^ID"
/__e/node20/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /__e/node20/bin/node)
```
2024-07-12 16:42:00 +02:00
Nathan Rajlich
b071d36ab5 Rename qjsc -r to qjsc -b 2024-07-04 10:27:39 +02:00
Nathan Rajlich
aa5e4d2132
Add qjsc -r flag to output raw bytecode 2024-07-04 06:52:01 +02:00
Andrew Johnson
76f99007f7 Reduce duplication in Linux and MacOS CI file, improve flexibility 2024-07-03 09:52:00 +02:00
Nathan Rajlich
ba9b4a82ec
Add qjsc -n parameter to override script name stored in bytecode (#459) 2024-07-03 09:51:30 +02:00
Nathan Rajlich
193d1a864f Document qjsc -s flag in help output
The `-s` flag added in #388 was missing in the `-h` help output.
2024-07-03 09:49:13 +02:00
Andrew Johnson
07fa1cbc4a
Add js_dbuf_realloc to avoid ubsan error 2024-07-02 00:43:34 +02:00
Andrew Johnson
b9de2b0bf8 Ignore maybe-uninitialised on MacOS with GCC >= 11 2024-07-01 23:14:06 +02:00
Andrew Johnson
e8ef9d6072 Avoid function name collisions 2024-06-27 22:54:40 +02:00
Andrew Johnson
d489078ea1 Avoid macro and function name collisions between sources 2024-06-27 22:54:40 +02:00
Andrew Johnson
845150232f Remove quickjs-libc from sources when BUILD_QJS_LIBC enabled 2024-06-27 22:53:43 +02:00
Andrew Johnson
136f5a2c66 Cleanup unused-variable warnings 2024-06-24 17:35:01 +02:00
Saúl Ibarra Corretgé
2ea0848616 Add CI for Windows x86 + MSVC 2024-06-17 09:59:46 +02:00
startewho
a008f1c098 Fix the Windows x86 MSVC build
Fixes: https://github.com/quickjs-ng/quickjs/issues/430
2024-06-17 09:59:46 +02:00
Saúl Ibarra Corretgé
c98d445b63 Save cur_pc on delete OP
Fixes: https://github.com/quickjs-ng/quickjs/issues/431
2024-06-13 12:23:12 +02:00
Saúl Ibarra Corretgé
b09ad82622 Now working on 0.6.0 2024-06-07 22:26:48 +02:00
Saúl Ibarra Corretgé
e1e8112f98 Fix uploading all built artifacts to a release 2024-06-07 22:25:01 +02:00
Saúl Ibarra Corretgé
0827b37f8c Set version to 0.5.0 2024-06-07 22:11:28 +02:00
KaruroChori
ed8f73413c Add getter for GC threshold 2024-06-07 22:07:38 +02:00
Tom Lienard
d3da56b630 Sync TLA implementation with upstream
Fixes: https://github.com/quickjs-ng/quickjs/issues/339
2024-06-07 15:46:44 +02:00
Saúl Ibarra Corretgé
a4e48a6a65
Add riscv64 builds to CI 2024-06-07 08:29:50 +02:00
KaruroChori
6efe30b4b4
Improve macro compatibility with C++
Fixes: https://github.com/quickjs-ng/quickjs/issues/425
2024-06-07 08:29:12 +02:00
Charlie Gordon
e36f4bc4b6 add missing include files in headers 2024-06-06 21:09:10 +02:00
nekosu
22c10224ac fix: missing math.h for NAN 2024-06-06 10:26:02 +02:00