]> git.kaiwu.me - quickjs.git/log
quickjs.git
14 months agofixed the handling of unicode identifiers
Fabrice Bellard [Thu, 10 Apr 2025 08:34:40 +0000 (10:34 +0200)]
fixed the handling of unicode identifiers

14 months agofixed break statement in the presence of labels (bnoordhuis) (#275)
Fabrice Bellard [Mon, 7 Apr 2025 17:01:30 +0000 (19:01 +0200)]
fixed break statement in the presence of labels (bnoordhuis) (#275)

14 months agoadded JS_GetAnyOpaque() (oleavr)
Fabrice Bellard [Mon, 7 Apr 2025 16:45:11 +0000 (18:45 +0200)]
added JS_GetAnyOpaque() (oleavr)

14 months agofixed buffer overflow in BJSON String and BigInt reader (#399)
Fabrice Bellard [Mon, 7 Apr 2025 16:40:49 +0000 (18:40 +0200)]
fixed buffer overflow in BJSON String and BigInt reader (#399)

14 months agofixed and improved Map/Set hashing
Fabrice Bellard [Mon, 7 Apr 2025 12:42:07 +0000 (14:42 +0200)]
fixed and improved Map/Set hashing

14 months agoqjs: added performance.now()
Fabrice Bellard [Mon, 7 Apr 2025 12:33:30 +0000 (14:33 +0200)]
qjs: added performance.now()

14 months agoremoved unused slack in hash_map_resize() (saghul)
Fabrice Bellard [Mon, 7 Apr 2025 10:05:40 +0000 (12:05 +0200)]
removed unused slack in hash_map_resize() (saghul)

14 months agoFix UB in BigInt left shift (saghul)
Fabrice Bellard [Mon, 7 Apr 2025 10:02:01 +0000 (12:02 +0200)]
Fix UB in BigInt left shift (saghul)

14 months agoFix leak in BigInt unary plus (saghul)
Fabrice Bellard [Mon, 7 Apr 2025 10:00:08 +0000 (12:00 +0200)]
Fix leak in BigInt unary plus (saghul)

14 months agoqjs: allow SI suffixes in memory sizes - set default stack size to 1 MB
Fabrice Bellard [Mon, 7 Apr 2025 09:47:57 +0000 (11:47 +0200)]
qjs: allow SI suffixes in memory sizes - set default stack size to 1 MB

14 months agofixed weakmap gc (#398)
Fabrice Bellard [Mon, 7 Apr 2025 09:44:28 +0000 (11:44 +0200)]
fixed weakmap gc (#398)

14 months agoupdated Changelog
Fabrice Bellard [Mon, 7 Apr 2025 08:21:17 +0000 (10:21 +0200)]
updated Changelog

14 months agoflush stdout in console.log() (#309)
Fabrice Bellard [Sat, 5 Apr 2025 16:22:34 +0000 (18:22 +0200)]
flush stdout in console.log() (#309)

14 months agofixed module cyclic imports (#329)
Fabrice Bellard [Sat, 5 Apr 2025 16:05:15 +0000 (18:05 +0200)]
fixed module cyclic imports (#329)

14 months agoworkaround for overflow test in JS_GetOwnPropertyNamesInternal() (#111)
Fabrice Bellard [Sat, 5 Apr 2025 14:19:25 +0000 (16:19 +0200)]
workaround for overflow test in JS_GetOwnPropertyNamesInternal() (#111)

14 months ago'undefined' is a valid let/const variable name. It gives a SyntaxError at top level...
Fabrice Bellard [Sat, 5 Apr 2025 13:52:55 +0000 (15:52 +0200)]
'undefined' is a valid let/const variable name. It gives a SyntaxError at top level because it is already defined (#370)

14 months agoadded forgotten js_weakref_is_live() tests
Fabrice Bellard [Sat, 5 Apr 2025 13:41:51 +0000 (15:41 +0200)]
added forgotten js_weakref_is_live() tests

14 months agoavoid freeing an object structure in js_weakref_free() if it is about to be freed...
Fabrice Bellard [Sat, 5 Apr 2025 13:21:57 +0000 (15:21 +0200)]
avoid freeing an object structure in js_weakref_free() if it is about to be freed in free_zero_refcount()

14 months agoreworked weak references so that cycles are (hopefully) correctly handled - added...
Fabrice Bellard [Sat, 5 Apr 2025 10:49:29 +0000 (12:49 +0200)]
reworked weak references so that cycles are (hopefully) correctly handled - added Symbol as WeakMap key, WeakRef and FinalizationRegistry

15 months agofixed eval with empty argument scope (#249)
Fabrice Bellard [Mon, 31 Mar 2025 16:33:22 +0000 (18:33 +0200)]
fixed eval with empty argument scope (#249)

15 months agoremoved useless printf() (#257)
Fabrice Bellard [Mon, 31 Mar 2025 16:00:27 +0000 (18:00 +0200)]
removed useless printf() (#257)

15 months agoensure that JS_IteratorNext() returns JS_UNDEFINED when done = TRUE (#394)
Fabrice Bellard [Mon, 31 Mar 2025 11:37:37 +0000 (13:37 +0200)]
ensure that JS_IteratorNext() returns JS_UNDEFINED when done = TRUE (#394)

15 months agoremoved invalid tests
Fabrice Bellard [Fri, 28 Mar 2025 09:19:28 +0000 (10:19 +0100)]
removed invalid tests

15 months agofixed exception handling in AsyncFromSyncIterator and async for of
Fabrice Bellard [Fri, 28 Mar 2025 09:11:15 +0000 (10:11 +0100)]
fixed exception handling in AsyncFromSyncIterator and async for of

15 months agofixed typed array set operation when obj != receiver
Fabrice Bellard [Thu, 27 Mar 2025 16:06:26 +0000 (17:06 +0100)]
fixed typed array set operation when obj != receiver

15 months agofixed set_date_field()
Fabrice Bellard [Thu, 27 Mar 2025 15:28:56 +0000 (16:28 +0100)]
fixed set_date_field()

15 months agodisable rejection tracker in the repl - repl cleanup
Fabrice Bellard [Thu, 27 Mar 2025 14:34:20 +0000 (15:34 +0100)]
disable rejection tracker in the repl - repl cleanup

15 months agoremoved memory leak in string padding (issue #274)
Fabrice Bellard [Thu, 27 Mar 2025 13:43:25 +0000 (14:43 +0100)]
removed memory leak in string padding (issue #274)

15 months agoexit by default on unhandled promise rejections (issue #305)
Fabrice Bellard [Thu, 27 Mar 2025 13:22:58 +0000 (14:22 +0100)]
exit by default on unhandled promise rejections (issue #305)

15 months agoupdate test262_errors.txt
Fabrice Bellard [Tue, 25 Mar 2025 18:17:19 +0000 (19:17 +0100)]
update test262_errors.txt

15 months agoupdated to unicode 16.0.0 (bnoordhuis) - updated test262
Fabrice Bellard [Tue, 25 Mar 2025 18:08:19 +0000 (19:08 +0100)]
updated to unicode 16.0.0 (bnoordhuis) - updated test262

15 months agoadded missing header
Fabrice Bellard [Tue, 25 Mar 2025 15:49:41 +0000 (16:49 +0100)]
added missing header

15 months agoadded -Wno-infinite-recursion
Fabrice Bellard [Tue, 25 Mar 2025 15:42:05 +0000 (16:42 +0100)]
added -Wno-infinite-recursion

15 months agomore use of js_new_string8 - inlined JS_NewString() (initial patch by Charlie Gordon)
Fabrice Bellard [Tue, 25 Mar 2025 15:33:47 +0000 (16:33 +0100)]
more use of js_new_string8 - inlined JS_NewString() (initial patch by Charlie Gordon)

15 months agoadded string ropes for faster concatenation of long strings (issue #67)
Fabrice Bellard [Tue, 25 Mar 2025 15:01:40 +0000 (16:01 +0100)]
added string ropes for faster concatenation of long strings (issue #67)

15 months agomore dtoa bench (Charlie Gordon)
Fabrice Bellard [Sat, 22 Mar 2025 11:50:11 +0000 (12:50 +0100)]
more dtoa bench (Charlie Gordon)

15 months agoenable dtoa tests on win32
Fabrice Bellard [Sat, 22 Mar 2025 11:40:37 +0000 (12:40 +0100)]
enable dtoa tests on win32

15 months agoreduced memory usage of Map hash table
Fabrice Bellard [Sat, 22 Mar 2025 10:28:23 +0000 (11:28 +0100)]
reduced memory usage of Map hash table

15 months agofixed hash_map_resize() - added Map/WeakMap in microbench
Fabrice Bellard [Sat, 22 Mar 2025 09:54:21 +0000 (10:54 +0100)]
fixed hash_map_resize() - added Map/WeakMap in microbench

15 months agosimplified and fixed backtrace_barrier (#306)
Fabrice Bellard [Thu, 20 Mar 2025 12:37:07 +0000 (13:37 +0100)]
simplified and fixed backtrace_barrier (#306)

15 months agoprotect against printf errors (#319)
Fabrice Bellard [Thu, 20 Mar 2025 10:47:07 +0000 (11:47 +0100)]
protect against printf errors (#319)

15 months agoadded new dtoa library to print and parse float64 numbers. It is necessary to fix...
Fabrice Bellard [Wed, 19 Mar 2025 18:07:57 +0000 (19:07 +0100)]
added new dtoa library to print and parse float64 numbers. It is necessary to fix corner cases (e.g. radix != 10) and to have correct behavior regardless of the libc implementation.

15 months agomsan fix (#389)
Fabrice Bellard [Wed, 19 Mar 2025 13:27:01 +0000 (14:27 +0100)]
msan fix (#389)

15 months agosimplified js_bigint_from_float64()
Fabrice Bellard [Wed, 19 Mar 2025 12:56:10 +0000 (13:56 +0100)]
simplified js_bigint_from_float64()

15 months agofixed examples/hello_module compilation (#240)
Fabrice Bellard [Wed, 19 Mar 2025 12:29:54 +0000 (13:29 +0100)]
fixed examples/hello_module compilation (#240)

15 months agofixed BigInt hashing - removed -fno-bigint in qjsc and JS_AddIntrinsicBigInt() (BigIn...
Fabrice Bellard [Wed, 19 Mar 2025 11:33:54 +0000 (12:33 +0100)]
fixed BigInt hashing - removed -fno-bigint in qjsc and JS_AddIntrinsicBigInt() (BigInt is now considered as a base object)

15 months agofixed JS_DumpValue() for BigInt
Fabrice Bellard [Wed, 19 Mar 2025 10:59:47 +0000 (11:59 +0100)]
fixed JS_DumpValue() for BigInt

15 months agomore bignum cleanup
Fabrice Bellard [Wed, 19 Mar 2025 10:43:31 +0000 (11:43 +0100)]
more bignum cleanup

15 months agoremoved the ability to do simultaneous 64 and 32 bit x86 builds in order to simplify...
Fabrice Bellard [Wed, 19 Mar 2025 09:54:04 +0000 (10:54 +0100)]
removed the ability to do simultaneous 64 and 32 bit x86 builds in order to simplify the Makefile

15 months agoMerge pull request #391 from nickva/try-to-fix-multiplatform-builds
bellard [Wed, 19 Mar 2025 09:33:03 +0000 (10:33 +0100)]
Merge pull request #391 from nickva/try-to-fix-multiplatform-builds

Fix multiarch CI builds

15 months agoFix multiarch CI builds
Nick Vatamaniuc [Tue, 18 Mar 2025 23:29:55 +0000 (19:29 -0400)]
Fix multiarch CI builds

Fix: https://github.com/bellard/quickjs/issues/390

15 months agocompilation fix
Fabrice Bellard [Tue, 18 Mar 2025 17:45:21 +0000 (18:45 +0100)]
compilation fix

15 months agoadded missing variable
Fabrice Bellard [Tue, 18 Mar 2025 17:34:05 +0000 (18:34 +0100)]
added missing variable

15 months agoremoved bignum support and qjscalc - added optimized BigInt implementation
Fabrice Bellard [Tue, 18 Mar 2025 17:29:10 +0000 (18:29 +0100)]
removed bignum support and qjscalc - added optimized BigInt implementation

15 months agoregexp: allow [\-] in unicode mode (#373)
Fabrice Bellard [Thu, 13 Mar 2025 18:00:25 +0000 (19:00 +0100)]
regexp: allow [\-] in unicode mode (#373)

15 months agofixed CONFIG_ALL_UNICODE compilation
Fabrice Bellard [Thu, 13 Mar 2025 17:13:25 +0000 (18:13 +0100)]
fixed CONFIG_ALL_UNICODE compilation

15 months agosimplified the handling of closures
Fabrice Bellard [Thu, 13 Mar 2025 16:44:55 +0000 (17:44 +0100)]
simplified the handling of closures

15 months agoadded missing stack overflow check in JSON.stringify()
Fabrice Bellard [Thu, 13 Mar 2025 16:27:38 +0000 (17:27 +0100)]
added missing stack overflow check in JSON.stringify()

15 months agoallow regexp interruption (e.g. with Ctrl-C in the REPL)
Fabrice Bellard [Thu, 13 Mar 2025 16:17:51 +0000 (17:17 +0100)]
allow regexp interruption (e.g. with Ctrl-C in the REPL)

15 months agofix crash when add_property() fails on build arguments (penneryu)
Fabrice Bellard [Thu, 13 Mar 2025 15:30:02 +0000 (16:30 +0100)]
fix crash when add_property()  fails on build arguments (penneryu)

15 months agomicrobench: use toFixed()
Fabrice Bellard [Thu, 13 Mar 2025 15:23:13 +0000 (16:23 +0100)]
microbench: use toFixed()

15 months agoJS_SetPropertyInternal(): avoid recursing thru the prototypes if the property is...
Fabrice Bellard [Thu, 13 Mar 2025 15:04:38 +0000 (16:04 +0100)]
JS_SetPropertyInternal(): avoid recursing thru the prototypes if the property is found in a prototype

15 months agofixed date parsing in case there is more than nine initial digits (initial patch...
Fabrice Bellard [Thu, 13 Mar 2025 14:52:53 +0000 (15:52 +0100)]
fixed date parsing in case there is more than nine initial digits (initial patch by nickva)

23 months agoFix termination in Worker test
Akos Kiss [Sat, 27 Jul 2024 09:34:49 +0000 (11:34 +0200)]
Fix termination in Worker test

Function names are case sensitive, `onMessage` is not the same as
`onmessage`.

Related to #98

23 months agoDefine a fallback PATH_MAX if not available
Pino Toscano [Sun, 9 Jun 2024 07:23:49 +0000 (09:23 +0200)]
Define a fallback PATH_MAX if not available

PATH_MAX is optional in POSIX, and it is not available on GNU/Hurd.
While it could be possible to not rely on PATH_MAX, for now provide a
fallback definition (which should be safe enough) to get quickjs built
on GNU/Hurd.

23 months agoUse ftello() & fseeko() on any OS based on GNU libc
Pino Toscano [Sun, 9 Jun 2024 07:21:01 +0000 (09:21 +0200)]
Use ftello() & fseeko() on any OS based on GNU libc

Strictly speaking, they are available in POSIX.1-2008 [1][2], so they
could be used on more platforms/OSes. To be cautious, enable them when
using GNU libc, since they have been available with that libc for a
very long time.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftell.html
[2] https://pubs.opengroup.org/onlinepubs/9699919799/functions/fseek.html

23 months agoUse malloc_usable_size() on any OS based on GNU libc
Pino Toscano [Sun, 9 Jun 2024 07:18:38 +0000 (09:18 +0200)]
Use malloc_usable_size() on any OS based on GNU libc

malloc_usable_size() is a GNU extension in GNU libc; hence, use it
every time GNU libc is used, rather than only on Linux.

23 months agoFix `JS_HasException()` when `null` is thrown (#313)
Kasper Isager Dalsgarð [Wed, 17 Jul 2024 11:58:08 +0000 (13:58 +0200)]
Fix `JS_HasException()` when `null` is thrown (#313)

Use `JS_UNINITIALIZED` instead of `JS_NULL` when no exception is pending, so `null` can be thrown and distinguished from no exception pending.

23 months agoFix GC leak in `js_proxy_get()` (#302)
Dmitry Volyntsev [Sun, 14 Jul 2024 22:08:40 +0000 (15:08 -0700)]
Fix GC leak in `js_proxy_get()` (#302)

Fixes #277

2 years agoregexp: fix non greedy quantizers with zero length matches
Fabrice Bellard [Thu, 30 May 2024 14:41:37 +0000 (16:41 +0200)]
regexp: fix non greedy quantizers with zero length matches

2 years agoupdated test262.patch
Fabrice Bellard [Thu, 30 May 2024 13:49:31 +0000 (15:49 +0200)]
updated test262.patch

2 years agofixed test of test262 directory
Fabrice Bellard [Thu, 30 May 2024 13:36:20 +0000 (15:36 +0200)]
fixed test of test262 directory

2 years agoImprove `js_os_exec` (#295)
Charlie Gordon [Thu, 9 May 2024 23:57:55 +0000 (01:57 +0200)]
Improve `js_os_exec` (#295)

- use $(shell) make command to test if closefrom() is available
- use closefrom() if available in js_os_exec()
- limit the fallback loop to 1024 handles to avoid costly loop on linux alpine.
PR inspired by @nicolas-duteil-nova

2 years agoAdd `js_resolve_proxy` (#293)
Charlie Gordon [Thu, 9 May 2024 12:14:50 +0000 (14:14 +0200)]
Add `js_resolve_proxy` (#293)

- simplify `JS_IsArray` for proxy chains
- remove `js_proxy_isArray`

2 years agoAdd `JS_StrictEq()`, `JS_SameValue()`, and `JS_SameValueZero()` (#264)
Kasper Isager Dalsgarð [Thu, 9 May 2024 11:07:40 +0000 (13:07 +0200)]
Add `JS_StrictEq()`, `JS_SameValue()`, and `JS_SameValueZero()` (#264)

* add `JS_StrictEq()`, `JS_SameValue()`, and `JS_SameValueZero()` all accepting `JSValueConst`
* make `js_strict_eq` accept `JSValueConst`, remove uses of this function internally and replace them with
`js_strict_eq2` instead.

2 years agoExpose `JS_SetUncatchableError()` (#262)
Kasper Isager Dalsgarð [Thu, 9 May 2024 10:45:47 +0000 (12:45 +0200)]
Expose `JS_SetUncatchableError()` (#262)

* Expose `JS_SetUncatchableError()`

* Remove unnecessary `JS_SetUncatchableError` declaration

2 years agoAdd the missing fuzz_common.c (#292)
Renáta Hodován [Thu, 9 May 2024 10:36:12 +0000 (12:36 +0200)]
Add the missing fuzz_common.c (#292)

2 years agoAdd `JS_HasException()` (#265)
Kasper Isager Dalsgarð [Wed, 8 May 2024 21:19:15 +0000 (23:19 +0200)]
Add `JS_HasException()` (#265)

2 years agoAdd `JS_NewTypedArray()` (#272)
Dmitry Volyntsev [Wed, 8 May 2024 21:17:00 +0000 (14:17 -0700)]
Add `JS_NewTypedArray()` (#272)

2 years agoOSS-Fuzz targets improvements (#267)
Renáta Hodován [Wed, 8 May 2024 16:19:48 +0000 (18:19 +0200)]
OSS-Fuzz targets improvements (#267)

* Move fuzz target sources from the oss-fuzz repository here

* Add support to build libFuzzer targets
* Simplify the fuzz_eval and fuzz_compile targets

The use of JS_NewContext instead of JS_NewContextRaw spares to call
JS_AddIntrinsic<XYZ> functions from the fuzz target, since the public
JS_NewContext API does exactly the same.

* Simplify the fuzz_regexp target

fuzz_regexp doesn't need to be dependant on libquickjs since the
runtime and the context - that were provided by libquickjs - were
only created to call two simple functions implemented in libquickjs
which could be mimicked by the fuzzer.
The removal of runtime and context objects implicated further
simplifications, like the omission of their one-time creation.
Finally, writing the result of the regexp operations into a file
is also superfluous, since it's not used by anybody.

* Recreate and destroy JS runtime and context in fuzz_eval and fuzz_compile targets

Before this patch, the test executions were not independent,
since all the executed tests used the same JavaScript runtime and
context, causing irreproducible failure reports.

* Enable bignumber support in eval and compile targets

Big numbers are used by the input corpus, but the targets were not
able to interpret them since they were not compiled into them.
This change improved the inital coverage of the fuzz_eval target with
21% and the coverage of the fuzz_compile target with 25% when using
the official corpus.

* Ensure std and os modules are available in the fuzz_eval and fuzz_compile targets
* Add fuzzer dictionary with builtin and variable names. Furthermore, added a JS script that collects all the builtin
names from the executing engine.
* Move common fuzzer code into one place
* Enable to define the LIB_FUZZING_ENGINE variable to ease the oss-fuzz integration
* Add README to fuzzers

2 years agoImprove class parser (#289)
Charlie Gordon [Sun, 5 May 2024 17:54:47 +0000 (19:54 +0200)]
Improve class parser (#289)

- accept `class P { async = 1 }}`
- accept `class P { static = 1 }}` etc.
- Fixes #261

2 years agofix class method with name get (#258)
Richard Davison [Sun, 5 May 2024 16:46:30 +0000 (18:46 +0200)]
fix class method with name get (#258)

Co-authored-by: Richard Davison <ridaviso@amazon.com>
2 years agoImprove libunicode and libregexp headers (#288)
Charlie Gordon [Sun, 5 May 2024 15:47:40 +0000 (17:47 +0200)]
Improve libunicode and libregexp headers (#288)

- move all `lre_xxx` functions to libunicode
- use flags table `lre_ctype_bits` instead of bitmaps
- simplify `lre_is_space`, `lre_js_is_ident_first` and `lre_js_is_ident_next`
- simplify `simple_next_token`, handle UTF-8 correctly
- simplify `is_let`, remove dead code

2 years agoImprove unicode table handling (#286)
Charlie Gordon [Sun, 5 May 2024 10:10:24 +0000 (12:10 +0200)]
Improve unicode table handling (#286)

- Document table and index formats
- Add size statistics
- Fix UBSAN issue in `get_le24()`

Fixes #285

2 years agoFix endianness handling in `js_dataview_getValue` / `js_dataview_setValue`
Charlie Gordon [Sat, 23 Mar 2024 12:19:04 +0000 (13:19 +0100)]
Fix endianness handling in `js_dataview_getValue` / `js_dataview_setValue`

2 years agoImprove error handling
Charlie Gordon [Sat, 23 Mar 2024 11:58:53 +0000 (12:58 +0100)]
Improve error handling

- detect and report invalid duplicate parameter names
- throw RangeError for too many function arguments
- throw RangeError for invalid string length
- prevent `-Wcast-function-type` warnings

2 years agoImprove `JSON.stringify`
Charlie Gordon [Sat, 23 Mar 2024 11:43:45 +0000 (12:43 +0100)]
Improve `JSON.stringify`

- changed error messages
- clarify `toJSON` method usage
- simplify boxed objects handling
- for ECMA conformity, BigInt objects need a toJSON method in the prototype chain
  including boxed objects

2 years agoUse more explicit magic values for array methods
Charlie Gordon [Sat, 23 Mar 2024 08:52:23 +0000 (09:52 +0100)]
Use more explicit magic values for array methods

2 years agoSimplify redundant initializers for `JS_NewBool()`
Charlie Gordon [Sat, 23 Mar 2024 08:28:38 +0000 (09:28 +0100)]
Simplify redundant initializers for `JS_NewBool()`

2 years agoFix compilation with -DCONFIG_BIGNUM
Charlie Gordon [Fri, 22 Mar 2024 10:23:33 +0000 (11:23 +0100)]
Fix compilation with -DCONFIG_BIGNUM

- disable BigDecimal convertion in `JS_ReadBigNum`
- fix some error messages

2 years agoImprove Date.parse, small fixes
Charlie Gordon [Thu, 21 Mar 2024 23:47:17 +0000 (00:47 +0100)]
Improve Date.parse, small fixes

- add `minimum_length` to enforce array length validation
- add `JS_NewDate()` API
- add `[Symbol.toStringTag]` property in the global object
- simplify `string_get_milliseconds`
- support more timezone abbrevs using `string_get_tzabbr` and array

2 years agoAdd CI targets, fix test_std.js (#247)
Charlie Gordon [Sun, 3 Mar 2024 20:57:38 +0000 (21:57 +0100)]
Add CI targets, fix test_std.js (#247)

This switches the exec test to `SIGTERM` rather than `SIGQUIT` since the
latter didn’t seem to work in QEMU, and the distinction doesn’t really
matter for this test.

This also makes the `isatty()` check smarter by checking whether `STDIN`
is, in fact, a terminal.

Added qemu-alpine targets i386, arm32v6, arm32v7, arm64v8, s390x

Co-authored-by: Felipe Gasper <felipe@felipegasper.com>
2 years agoFix build: use LRE_BOOL in libunicode.h (#244)
Kanstantsin Sokal [Sun, 3 Mar 2024 14:36:00 +0000 (06:36 -0800)]
Fix build: use LRE_BOOL in libunicode.h (#244)

2 years agoprevent 0 length allocation in `js_worker_postMessage`
Charlie Gordon [Sun, 3 Mar 2024 13:42:01 +0000 (14:42 +0100)]
prevent 0 length allocation in `js_worker_postMessage`

2 years agoAdd github CI tests
Ben Noordhuis [Sun, 3 Mar 2024 13:14:23 +0000 (14:14 +0100)]
Add github CI tests

- disable `isatty()` test in `test_os()`
- add `.github/workflows/ci.yml` with 8 targets

2 years agoPrevent UB on memcpy and floating point conversions
Charlie Gordon [Sun, 3 Mar 2024 13:05:40 +0000 (14:05 +0100)]
Prevent UB on memcpy and floating point conversions

- add `memcpy_no_ub` that accepts null pointers for 0 count
- prevent 0 length allocation in `js_worker_postMessage`
- use safer test for `int` value in `JS_NewFloat64`,
  `JS_ToArrayLengthFree` and `js_typed_array_indexOf`

2 years agofix microbench when microbench.txt is missing (#246)
Charlie Gordon [Sun, 3 Mar 2024 02:38:49 +0000 (03:38 +0100)]
fix microbench when microbench.txt is missing (#246)

2 years agoImprove Date.parse
Charlie Gordon [Sun, 3 Mar 2024 01:59:08 +0000 (02:59 +0100)]
Improve Date.parse

- accept many more alternative date/time formats
- add test cases in tests/test_builtin.js
- match month and timezone names case insensitively
- accept AM and PM markers
- recognize US timezone names
- skip parenthesized stuff
- fix almost all v8 test cases

2 years agoImprove Number.prototype.toString for radix other than 10
Charlie Gordon [Sat, 2 Mar 2024 14:13:18 +0000 (15:13 +0100)]
Improve Number.prototype.toString for radix other than 10

- fix the conversions for integers and exact fractions
- approximate approach for other cases.
- bypass floating point conversions for JS_TAG_INT values
- avoid divisions for base 10 integer conversions

2 years agoImprove repl regexp handling
Charlie Gordon [Sat, 2 Mar 2024 13:36:44 +0000 (14:36 +0100)]
Improve repl regexp handling

- handle regexp with flags in repl completion
- group config_jscalc customisations