Claude/quickjs upstream rebase ynm6eo#1
Merged
Conversation
…zed. It is slightly slower but avoids several nasty bugs (bellard#471)
…he comparison function. Fixed buffer overflow when the array is resized (bellard#477)
…eference cleanup (bellard#494)
Some newer compilers emit this warning:
```
warning: initializer-string for character array is too long, array size is 36
but initializer has size 37 (including the null terminating character);
did you mean to use the 'nonstring' attribute? [-Wunterminated-string-initialization]
12146 | static char const digits[36] = "0123456789abcdefghijklmnopqrstuvwxyz";
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
To avoid the warning initialize the array as individual characters
In other engines, 0x0.toString() returns '0', but QJS would try to parse it as a float and then throw. Also removes remnants of hex float parsing which is no longer supported anyway. (Port of quickjs-ng/quickjs#377)
…ning Avoid initializer-string warning for the digits array
Fix member access on non-decimal numeric literals
…unction name as quickjs-ng for js_atomics_get_buf() (bellard#508)
The flag is needed to pass the two CanBlockIsFalse tests from test262 when running individual preprocessed tests via run-test262 -N.
… in case the allocation of the new array buffer fails. Also avoid setting opaque = NULL for the custom array buffer free function
…huis) - fixed unsafe thread termination in show_progress() - use the number of physical cores by default - added -T option to force the number of threads - avoid hardcoding the maximum number of threads
…spection and profiling
…#512) * Add fuzz targets for ES6 modules, JSON, RegExp, and bytecode Adds 4 new fuzzers targeting high-complexity, low-coverage functions: - fuzz_module_export: Tests ES6 module export/import parsing (complexity 6727) - fuzz_json: Tests JSON stringify/parse (complexity ~5000) - fuzz_regexp_compile: Tests RegExp compilation (complexity 5528) - fuzz_bytecode: Tests bytecode execution (complexity 5383) Identified by Fuzz Introspector as having 0% runtime coverage. Build integration for fuzz/Makefile and build.sh included. * Convert fuzz targets from C++ to C and use standard C headers
Port of quickjs-ng/quickjs#1409 (bnoordhuis). I modified it to prevent an atom leak in js_parse_statement_or_decl, otherwise it's the same.
…e result with several threads
…y base64/hex Merge the latest upstream master (53 commits since the last sync, VERSION 2025-09-13 -> 2026-06-04). Conflict resolutions: - Makefile: kept the custom WASI/Hako build; upstream's standard-build changes (sanitizers, test targets, test262 bootstrap) do not apply. - quickjs.c: took upstream's standard __EMSCRIPTEN__ macro over the fork's non-standard EMSCRIPTEN spelling (behaviour is identical for the WASI build). - quickjs-libc.c: added upstream's <poll.h> include for poll() support; placed outside the !__wasi__ guard since wasi-libc provides poll.h and the JSThreadState.poll_fds field is compiled for WASI. Uint8Array base64/hex: Replaced the fork's home-grown implementation with upstream's (commit e182e3d, "Add Uint8Array base64/hex methods"). The fork had registered toBase64/toHex/fromBase64/fromHex/setFromBase64/setFromHex on the generic %TypedArray%; upstream correctly exposes them on Uint8Array only. Removed the fork's js_typed_array_*Base64/Hex functions and their entries in js_typed_array_base_funcs / js_typed_array_base_proto_funcs, keeping upstream's js_uint8array_* implementation and Uint8Array-specific registration. Verified: quickjs.c and quickjs-libc.c compile cleanly natively, and a C-API test confirms toBase64/fromBase64/toHex/fromHex/setFromHex round-trip and that the methods are absent from generic typed arrays (Int8Array/Float64Array). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YMggTo4MS7PTA69XhKJ1TY
The fork changed the JSInterruptHandler typedef in quickjs.h to take a JSContext *ctx, but the stock interrupt_handler in quickjs-libc.c still used the 2-arg signature, producing an incompatible-pointer-type warning at the JS_SetInterruptHandler call. Add the ctx parameter to match the typedef. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YMggTo4MS7PTA69XhKJ1TY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.