55 Commits
Author SHA1 Message Date
Ben Noordhuis 05c5738fd1 Update copyright notices (#1353) 2026-02-15 23:15:11 +01:00
Ben Noordhuis bbcfcd5bc7 Add Iterator.zipKeyed (#1277) 2026-01-08 00:02:31 +01:00
Ben Noordhuis 210ecb2b27 Add Iterator.zip (#1274) 2026-01-07 23:07:34 +01:00
Zephyr Lykos 2d680a96c1 Update meson.build 2025-10-16 13:45:16 +02:00
Ben Noordhuis a9a8ece429 Move builtin-array-fromasync.h to toplevel (#1034)
Putting it in gen/ is inconvenient for downstream users that vendor or
repackage the source files.
2025-04-22 21:16:28 +02:00
Ben Noordhuis 97e6ef94c5 Simplify Array.fromAsync lazy loading (#982)
Store it as classic JS instead of an ES module that we need to pull
apart first.

Added benefit is that it shrinks the serialized representation by 5%.
2025-03-17 11:32:44 +01:00
Ben Noordhuis bfc9e3cc01 Add Array.fromAsync (#975)
Implement Array.fromAsync as a lazily loaded bytecode function.

Fixes: https://github.com/quickjs-ng/quickjs/issues/962
2025-03-15 22:44:30 +01:00
Ben Noordhuis 297a911b21 Add compile-time refcount bug hunt build mode (#952)
Reintroduce JSValueConst and add a JS_CHECK_JSVALUE build mode that
catches reference counting bugs by making JSValue and JSValueConst
different types.

The *vast* majority of this commit is rote work to make our own sources
compile cleanly in said mode.

Refs: https://github.com/quickjs-ng/quickjs/issues/944
2025-03-08 10:30:25 +01:00
Ben Noordhuis ccb996b334 Add amalgamation Makefile target (#949)
Also include quickjs-libc.h, otherwise downstream users can compile but
not call its functions.
2025-03-06 09:35:37 +01:00
Ben Noordhuis acf63fab4d Update copyright notices (#853) 2025-01-24 23:45:27 +01:00
Ben Noordhuis 291eb9c5db Remove test_conv.c (#800)
We only build it, we never run it, and it's fairly slow to build. It's
an almost verbatim copy of a sizable part of cutils.c that _is_ tested
so let's just remove it.

Fixes: https://github.com/quickjs-ng/quickjs/issues/788
2025-01-07 23:23:37 +01:00
Saúl Ibarra Corretgé 7e292050a2 Drop checks for no longer used files 2024-12-13 09:46:57 +01:00
Saúl Ibarra Corretgé ce03c998c4 Add ability to create standalone binaries with qjs
Ref: https://github.com/quickjs-ng/quickjs/issues/438
Closes: https://github.com/quickjs-ng/quickjs/pull/441
2024-12-03 22:59:11 +01:00
Saúl Ibarra Corretgé 06cd3da2fd Add INSTALL_PREFIX helper variable to Makefile 2024-12-02 21:16:53 +01:00
Ben Noordhuis d2bca87c64 Make quickjs.h -Wall -Wextra -pedantic clean (#628)
Fixes: https://github.com/quickjs-ng/quickjs/issues/585
2024-10-26 17:10:18 +02:00
Ben NoordhuisandSaúl Ibarra Corretgé 89883ae657 Add C++ compile test (#615)
Check that quickjs.h parses without error when fed to a C++ compiler.

Fixes: https://github.com/quickjs-ng/quickjs/issues/608
Co-authored-by: Saúl Ibarra Corretgé <[email protected]>
2024-10-26 14:01:45 +02:00
Ben Noordhuis bed51fab0a Allow turning on multiple sanitizers (#611)
Consolidate the ASan and UBSan buildbots and turn on both sanitizers
when fuzzing.
2024-10-20 12:41:17 +02:00
Ben Noordhuis a1d1bce0b7 Fix crash in deserializer (#602)
Check inside the deserializer that const atoms are indeed const, don't
trust the input. The serializer only writes type 0 records for const
atoms but the byte stream may have been corrupted or manipulated.

Overlooked during review of c25aad7 ("Add ability to (de)serialize
symbols")

Found with libfuzzer and it found it _really_ fast. Great tool.
2024-10-17 08:45:04 +02:00
Ben Noordhuis b9be6d4ff2 Run local tests with run-test262 2024-10-10 21:52:34 +02:00
Saúl Ibarra Corretgé 4b1a244d3b Run test262-update in a single thread
In order to guarantee the order of the results in the error file.
2024-10-05 12:39:04 +02:00
Saúl Ibarra Corretgé 6dd2ce308a Fix JS_DetectModule if the first statement is an await 2024-09-10 23:12:21 +02:00
Charlie Gordon 83726bb00c Add utility functions for string to integer conversions (#366)
* Add utility functions, improve integer conversion functions

- move `is_be()` to cutils.h
- add `is_upper_ascii()` and `to_upper_ascii()`
- add extensive benchmark for integer conversion variants in **tests/test_conv.c**
- add `u32toa()`, `i32toa()`, `u64toa()`, `i64toa()` based on register shift variant
- add  `u32toa_radix()`, `u64toa_radix()`, `i64toa_radix()` based on length_loop variant
- use direct converters instead of `snprintf()`
- copy NaN and Infinity directly in `js_dtoa1()`
- optimize `js_number_toString()` for small integers
- use `JS_NewStringLen()` instead of `JS_NewString()` when possible
- add more precise conversion tests in microbench.js
- disable some benchmark tests for gcc (they cause ASAN failures)
2024-04-19 11:35:44 +02:00
Charlie Gordon f326a7a195 Add strip option in qjsc to reduce object size (#388)
- `-s` strips the source code
- `-ss` strips source and line/column numbers information
- `qjsc repl.js` generates an object size of **105726** bytes
- `qjsc -s repl.js` generates an object size of **20853** bytes
- `qjsc -ss repl.js` generates an object size of only **16147** bytes
- compile repl.js with `-ss`
- bump byte code version to 12
2024-04-19 08:41:12 +02:00
Charlie Gordon b20aad8d1a Add faster test262 test target (#362)
* Add faster test262 test target
- add test262-fast.conf with lengthy tests disabled
- add test262-fast corresponding target
- make valgrind use test262-fast
2024-04-09 10:36:49 +02:00
Charlie Gordon 15c6a773b6 remove v8 output files in make clean (#357) 2024-04-07 16:22:54 +02:00
Saúl Ibarra Corretgé 7f928d289f Check-in all generated C files
Closes: https://github.com/quickjs-ng/quickjs/issues/262
2024-02-13 09:49:57 +01:00
Saúl Ibarra Corretgé de44a37ae9 Fix not rebuilding source 2023-12-11 09:59:32 +01:00
Saúl Ibarra Corretgé 7542b14c5b Fix Makefile rebuilding every target 2023-12-07 11:34:52 +01:00
Saúl Ibarra Corretgé 622ce2cc9d Detect JOBS in a more portable way 2023-12-07 10:59:11 +01:00
Saúl Ibarra Corretgé 3f66b08b9c Simplify Makefile 2023-12-07 09:38:09 +01:00
Saúl Ibarra Corretgé 331356625e Simplify CMake invocation 2023-11-28 09:30:45 +01:00
Saúl Ibarra Corretgé 0b920e7411 Fix make debug 2023-11-27 23:53:41 +01:00
Saúl Ibarra Corretgé 8d496b3e3c Add queueMicrotask
Ref: https://github.com/quickjs-ng/quickjs/issues/16
2023-11-21 23:43:17 +01:00
Saúl Ibarra Corretgé 54a4f2907e Refactor build system to use CMake only 2023-11-17 13:10:18 +01:00
Saúl Ibarra Corretgé 98d9147fb2 Fix hello_module example 2023-11-16 13:59:03 +01:00
Saúl Ibarra Corretgé 94b85a0784 Test Debug and Release CMake build types on CI (#52) 2023-11-12 23:04:46 +01:00
Ben Noordhuis 920cfc679a Add copyright notices (#51)
I believe we made enough substantial changes to have a credible claim to
copyright holdership.
2023-11-12 22:42:07 +01:00
Ben Noordhuis 1e3893d25e Remove duplicate test (#50) 2023-11-12 13:35:52 +01:00
Saúl Ibarra Corretgé 55e845c5dd Add JS_GetVersion 2023-11-10 16:48:49 +01:00
Ben Noordhuis 38f88c0898 Remove CONFIG_BIGNUM, always enable BigInt (#34)
Fixes: https://github.com/quickjs-ng/quickjs/issues/17
2023-11-10 16:09:54 +01:00
Ben Noordhuis ae17b8522d Remove operator overloading (#32)
Part of https://github.com/quickjs-ng/quickjs/issues/17
2023-11-10 10:23:40 +01:00
Ben Noordhuis e449cb08ef Remove BigFloat (#31)
Part of https://github.com/quickjs-ng/quickjs/issues/17
2023-11-08 22:23:06 +01:00
Ben Noordhuis 5d5b3cc21f Remove BigDecimal (#29)
Part of https://github.com/quickjs-ng/quickjs/issues/17
2023-11-08 21:07:16 +01:00
Ben Noordhuis 558a2ac761 Exit on sanitizer trap, don't recover
Fixes: https://github.com/quickjs-ng/quickjs/issues/22
2023-11-08 19:17:13 +01:00
Saúl Ibarra Corretgé 2f51cbc4e6 Add CI for MinGW on Windows 2023-11-08 11:12:54 +01:00
Saúl Ibarra Corretgé 1fb9a5010f Drop support for "use math"
Ref: https://github.com/quickjs-ng/quickjs/issues/20
2023-11-06 23:07:31 +01:00
Ben Noordhuis 83e6fca8be Add UndefinedBehaviorSanitizer support 2023-11-01 09:31:30 +01:00
Ben Noordhuis cd4579d106 Add MemorySanitizer support 2023-11-01 05:20:14 +01:00
Ben Noordhuis 2f7fd38f68 ci: add linux build+test workflow (#2) 2023-10-31 18:01:52 +01:00
bellard b5e62895c6 2021-03-27 release 2021-03-27 11:17:31 +01:00