Commit graph

205 commits

Author SHA1 Message Date
d904850a06 update so that it actually isnt used by the code
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-25 12:28:35 -05:00
8a00e7417b comment out unused var
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-25 12:27:21 -05:00
edfcece1ae update qjs to always import std and os
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-25 12:23:19 -05:00
c0f750ef9e Add a better, more useful readme.
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-25 11:39:45 -05:00
af4c40ce41 modified: qjs.c
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-25 11:34:47 -05:00
5f280254fa Make the js "break" even better. 2024-10-25 11:34:45 -05:00
25dae54410 patch up timeout code
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-25 10:07:31 -05:00
d868f20e80 change qjs to donejs
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-24 17:00:00 -05:00
bb6621ce70 modified: qjs.c
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-24 16:57:26 -05:00
978a3f47f3 change printf to log
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-24 16:22:27 -05:00
24692fbb5f add validation checks, move polyfills so os and std functions work
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-24 16:21:29 -05:00
94d52bfdc6 forgot semicolons 2024-10-24 16:03:02 -05:00
807be22562 make polyfills aio
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-24 15:56:39 -05:00
d838e9cc47 fixes + cleartimeout 2024-10-24 15:50:48 -05:00
8f39c02ea6 bugsbug fix - global is readonly
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-24 15:46:45 -05:00
4fb5334ebc add more polyfill hax
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-24 15:43:37 -05:00
15ffddb20a unmove 2024-10-24 15:30:03 -05:00
63e1762670 move polyfills
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-24 15:27:46 -05:00
a951ae64da add copyright deets
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-24 15:15:15 -05:00
5e8d81c2a6 add donejs edition denotation
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-24 15:12:35 -05:00
c6c98a254c flix global 2024-10-24 15:10:12 -05:00
b0cc1aa457 fix strings missing quotes
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-24 15:09:06 -05:00
250647fd99 add global alias to globalThis
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-24 15:08:34 -05:00
63376913de add require to global 2024-10-24 15:07:45 -05:00
b2d3293a97 whoopsie oopsie 2024-10-24 15:05:20 -05:00
6930c1ef9d fix require polyfill 2024-10-24 15:04:42 -05:00
18c24ca20e update license
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-24 14:33:46 -05:00
abf99613fb Forgot to mention in previous commit - added a hacky polyfill 2024-10-24 14:29:28 -05:00
51ec4ed20b revert to previous version
Some checks are pending
ci / Linux (Ubuntu) (push) Waiting to run
ci / linux-asan (push) Waiting to run
ci / linux-msan (push) Waiting to run
ci / linux-ubsan (push) Waiting to run
ci / macOS (push) Waiting to run
ci / macos-asan (push) Waiting to run
ci / macos-ubsan (push) Waiting to run
ci / freebsd (push) Waiting to run
ci / qemu-alpine (arm32v6) (push) Waiting to run
ci / qemu-alpine (arm32v7) (push) Waiting to run
ci / qemu-alpine (arm64v8) (push) Waiting to run
ci / qemu-alpine (i386) (push) Waiting to run
ci / qemu-alpine (s390x) (push) Waiting to run
2024-10-24 14:25:35 -05:00
Akos Kiss
6e2e68fd08 Fix termination in Worker test
Function names are case sensitive, `onMessage` is not the same as
`onmessage`.

Related to #98
2024-07-27 23:40:48 +02:00
Pino Toscano
012451d5f3 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.
2024-07-21 10:24:01 +02:00
Pino Toscano
8624b5c6f0 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
2024-07-21 10:24:01 +02:00
Pino Toscano
34894936d8 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.
2024-07-21 10:24:01 +02:00
Kasper Isager Dalsgarð
5417ab0159
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.
2024-07-17 13:58:08 +02:00
Dmitry Volyntsev
b3715f7cb1
Fix GC leak in js_proxy_get() (#302)
Fixes #277
2024-07-15 00:08:40 +02:00
Fabrice Bellard
36911f0d3a regexp: fix non greedy quantizers with zero length matches 2024-05-30 16:41:37 +02:00
Fabrice Bellard
d86aaf0b8f updated test262.patch 2024-05-30 15:49:31 +02:00
Fabrice Bellard
adec734346 fixed test of test262 directory 2024-05-30 15:36:20 +02:00
Charlie Gordon
d378a9f3a5
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
2024-05-10 01:57:55 +02:00
Charlie Gordon
97be5a32af
Add js_resolve_proxy (#293)
- simplify `JS_IsArray` for proxy chains
- remove `js_proxy_isArray`
2024-05-09 14:14:50 +02:00
Kasper Isager Dalsgarð
f3f2f42717
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.
2024-05-09 13:07:40 +02:00
Kasper Isager Dalsgarð
6f9d05fd2b
Expose JS_SetUncatchableError() (#262)
* Expose `JS_SetUncatchableError()`

* Remove unnecessary `JS_SetUncatchableError` declaration
2024-05-09 12:45:47 +02:00
Renáta Hodován
d53aafe0f3
Add the missing fuzz_common.c (#292) 2024-05-09 12:36:12 +02:00
Kasper Isager Dalsgarð
db9dbd0a2b
Add JS_HasException() (#265) 2024-05-08 23:19:15 +02:00
Dmitry Volyntsev
6c43013140
Add JS_NewTypedArray() (#272) 2024-05-08 23:17:00 +02:00
Renáta Hodován
01454caf78
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
2024-05-08 18:19:48 +02:00
Charlie Gordon
0c8fecab23
Improve class parser (#289)
- accept `class P { async = 1 }}`
- accept `class P { static = 1 }}` etc.
- Fixes #261
2024-05-05 19:54:47 +02:00
Richard Davison
d9c699f528
fix class method with name get (#258)
Co-authored-by: Richard Davison <ridaviso@amazon.com>
2024-05-05 18:46:30 +02:00
Charlie Gordon
7a2c6f42d4
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
2024-05-05 17:47:40 +02:00
Charlie Gordon
1402478d8d
Improve unicode table handling (#286)
- Document table and index formats
- Add size statistics
- Fix UBSAN issue in `get_le24()`

Fixes #285
2024-05-05 12:10:24 +02:00