QuickJS, the Next Generation: a mighty JavaScript engine
Find a file
Charlie Gordon 9e67b47c0d
Improve number to string conversions (#400)
integer conversions:
- improve `u32toa_radix` and `u64toa_radix`, add `i32toa_radix`
- use `i32toa_radix` for small ints in `js_number_toString`

floating point conversions (`js_dtoa`):
- complete rewrite with fewer calls to `snprintf`
- remove `JS_DTOA_FORMAT`, define 4 possible modes for `js_dtoa`
- remove the radix argument in `js_dtoa`
- merge `js_dtoa1` into `js_dtoa`
- add `js_dtoa_infinite` for non finite values
- simplify sign handling
- handle locale specific decimal point transparently

helper function `js_fcvt`:
- simplify `js_fcvt`, remove `js_fcvt1`, reduce overhead
- round up manually instead of using `fesetround(FE_UPWARD)`.

helper function `js_ecvt`:
- document `js_ecvt` and `js_ecvt1` behavior
- avoid redundant `js_ecvt1` calls in `js_ecvt`
- fixed buffer contents, no buffer copies
- simplify decimal point handling
- round up manually instead of using `fesetround(FE_UPWARD)`.

miscellaneous:
- remove `CONFIG_PRINTF_RNDN`. This fixes some of the conversion errors
  on Windows. Updated the tests accordingly
- this fixes a v8.sh bug on macOS: `0.5.toFixed(0)` used to produce `0` instead of `1`
- add regression tests, update test_conv unit tests
- add benchmarks for `toFixed`, `toPrecision` and `toExponential` number methods
- benchmarks show all conversions are now 40 to 45% faster (M2)
2024-05-26 08:06:36 +02:00
.github/workflows Make sure repos are updated before installing valgrind in CI 2024-04-23 19:54:12 +02:00
doc Handle serialization endianness transparently (#152) 2023-11-28 22:49:01 +01:00
examples Replace JSValueConst with JSValue (#195) 2023-12-10 15:15:42 +01:00
gen Add util.inspect emulation in REPL (#387) 2024-04-21 08:46:17 +02:00
test262@c1281dba45 Enable test262 on CI (#11) 2023-11-04 10:27:57 +01:00
tests Improve number to string conversions (#400) 2024-05-26 08:06:36 +02:00
.gitignore Add support for compiling with Microsoft Visual Studio C++ (MSVC) (#246) 2024-01-16 12:42:05 +01:00
.gitmodules Enable test262 on CI (#11) 2023-11-04 10:27:57 +01:00
CMakeLists.txt Fixed CMakeLists.txt for Emscripten builds (#403) 2024-05-14 08:44:46 +02:00
cutils.c Improve number to string conversions (#400) 2024-05-26 08:06:36 +02:00
cutils.h Improve number to string conversions (#400) 2024-05-26 08:06:36 +02:00
dirent_compat.h Add support for building with ClangCL on Windows 2023-11-30 01:23:09 +01:00
getopt_compat.h Add support for building with ClangCL on Windows 2023-11-30 01:23:09 +01:00
libbf.c Fix UB in bf_set_ui() 2023-12-02 16:05:10 +01:00
libbf.h Fix building with tcc (#170) 2023-12-03 13:36:51 +01:00
libregexp-opcode.h Optimize RegExp ASCII literal matching (#94) 2023-11-19 17:26:45 +01:00
libregexp.c Improve UTF-8 decoding and encoding functions (#410) 2024-05-21 14:08:33 +02:00
libregexp.h Implement RegExp 'v' flag, part 1 (#229) 2023-12-21 19:37:31 +01:00
libunicode-table.h Drop CONFIG_ALL_UNICODE and enable it by default 2023-11-20 10:52:04 +01:00
libunicode.c Add NetBSD support (#177) 2023-12-07 15:48:31 +01:00
libunicode.h Drop CONFIG_ALL_UNICODE and enable it by default 2023-11-20 10:52:04 +01:00
LICENSE Update LICENSE 2023-12-06 00:00:15 +01:00
list.h Add container_of macro 2023-12-23 00:11:41 +01:00
Makefile Add utility functions for string to integer conversions (#366) 2024-04-19 11:35:44 +02:00
qjs.c Accept "kmg" suffixes for memory limits 2024-05-06 11:22:16 +02:00
qjsc.c Add strip option in qjsc to reduce object size (#388) 2024-04-19 08:41:12 +02:00
quickjs-atom.h Add cross-platform Atomics support 2024-04-02 21:50:42 +02:00
quickjs-c-atomics.h Enable support for GCC compler v < 4.9 2023-11-29 09:22:27 +01:00
quickjs-libc.c Improve UTF-8 decoding and encoding functions (#410) 2024-05-21 14:08:33 +02:00
quickjs-libc.h Replace JSValueConst with JSValue (#195) 2023-12-10 15:15:42 +01:00
quickjs-opcode.h Don't serialize IC opcodes (#334) 2024-03-27 12:07:11 +01:00
quickjs.c Improve number to string conversions (#400) 2024-05-26 08:06:36 +02:00
quickjs.h Improve internal string allocation methods (#398) 2024-05-10 12:43:35 +02:00
README.md Update README, add fork information 2024-03-12 20:00:41 +01:00
repl.js Add util.inspect emulation in REPL (#387) 2024-04-21 08:46:17 +02:00
run-test262.c Improve parsing error messages (#405) 2024-05-14 20:36:10 +02:00
test262-fast.conf Add faster test262 test target (#362) 2024-04-09 10:36:49 +02:00
test262.conf Add cross-platform Atomics support 2024-04-02 21:50:42 +02:00
test262_errors.txt Fix evaluation order of computed properties 2024-01-16 12:43:35 +01:00
unicode_download.sh updated to Unicode 14.0.0 2022-03-06 19:00:24 +01:00
unicode_gen.c Fix typo in #undef (#222) 2023-12-16 15:11:28 +01:00
unicode_gen_def.h Update to Unicode 15.0.0 (#89) 2023-11-18 22:29:53 +01:00
v8-tweak.js Improve string parsing and JSON parsing (#316) 2024-03-22 11:19:36 +01:00
v8.js Accept "kmg" suffixes for memory limits 2024-05-06 11:22:16 +02:00
v8.sh Fix more v8 errors (#336) 2024-03-30 13:11:37 +01:00
v8.txt Fix strict name conformity cases (#335) 2024-03-30 17:15:25 +01:00

QuickJS - A mighty JavaScript engine

Friendly QuickJS fork focused on reigniting the project.

Overview

In October 2023 @bnoordhuis and @saghul decided to fork the QuickJS project with the aim of reigniting it. They reached out to the original authors (@bellard and @chqrlie) about their intentions.

As of December 2023 the initial goal was somewhat accomplished. @bellard resumed working on the project and both parties have been pulling patches from each other since.

As of early 2024 both projects agree the proper path forward involves merging both projects and combining the efforts. While that may take a while, since both projects diverged in certain areas, there is willingness to go in this direction from both sides.