]> git.kaiwu.me - quickjs.git/log
quickjs.git
2 years agohandle missing test262 gracefully
Charlie Gordon [Sat, 17 Feb 2024 21:56:54 +0000 (22:56 +0100)]
handle missing test262 gracefully

2 years agoImprove tests
Charlie Gordon [Sat, 17 Feb 2024 20:54:19 +0000 (21:54 +0100)]
Improve tests

- split test_bigfloat.js from test_bignum.js
- make test_date() compatible with node
- document Date constructor string argument format:
  should add test cases for invalid strings
- test_argument_scope(): only test this syntax error in strict mode:
  `var f = function(a = eval("var arguments")) {};`

2 years agoFix UB signed integer overflow in js_math_imul
Charlie Gordon [Sat, 17 Feb 2024 20:15:29 +0000 (21:15 +0100)]
Fix UB signed integer overflow in js_math_imul

- Use uint32_t arithmetics and Standard conformant conversion to
  avoid UB in js_math_imul.
- add builtin tests
- use specific object directories for SAN targets

2 years agoFix UB left shift of negative number
Ben Noordhuis [Wed, 1 Nov 2023 05:53:16 +0000 (06:53 +0100)]
Fix UB left shift of negative number

2 years agoRemove unnecessary ssize_t posix-ism
Ben Noordhuis [Fri, 16 Feb 2024 09:25:29 +0000 (10:25 +0100)]
Remove unnecessary ssize_t posix-ism

ssize_t is not always available and the cast it was used in wasn't
necessary in the first place, the value already has the right type.

Note that the field malloc_limit is an int64_t in JSMemoryUsage whereas it
is a size_t in JSMallocState.

2 years agoImprove string concatenation hack
Charlie Gordon [Thu, 15 Feb 2024 09:30:04 +0000 (10:30 +0100)]
Improve string concatenation hack

- add more cases of in place string concatenation
  this temporary hack improves the microbench timing by 30% but
  has little impact on the test262 timings.

2 years agopass node-js command line arguments to microbench
Charlie Gordon [Thu, 15 Feb 2024 08:59:50 +0000 (09:59 +0100)]
pass node-js command line arguments to microbench

2 years agoReverse e140122202cc24728b394f8f90fa2f4a2d7c397e
Charlie Gordon [Tue, 13 Feb 2024 08:45:58 +0000 (09:45 +0100)]
Reverse e140122202cc24728b394f8f90fa2f4a2d7c397e

- remove temporary fix for MemorySanitizer:
  setting p->u.array.count to 0 silenced a warning in JS_GetPropertyValue on a
  hacky test agains the length of fast_array object.
  This hack was removed by commit c3635861f63931255c7a953bccbb0e2e90cc75aa.

2 years agoFix test262 error
Charlie Gordon [Mon, 12 Feb 2024 17:37:37 +0000 (18:37 +0100)]
Fix test262 error

- force evaluation order in `set_date_fields`
- fix evaluation error in test262/test/built-ins/Date/UTC/fp-evaluation-order.js:19:
  unexpected error: Test262Error: precision in MakeDate Expected SameValue(«34448384», «34447360») to be true

2 years agoFix compiler warnings
Charlie Gordon [Mon, 12 Feb 2024 17:35:27 +0000 (18:35 +0100)]
Fix compiler warnings

2 years agoSimplify and clarify URL quoting js_std_urlGet
Charlie Gordon [Mon, 12 Feb 2024 17:34:52 +0000 (18:34 +0100)]
Simplify and clarify URL quoting js_std_urlGet

2 years agoFreeBSD QuickJS Patch (#203)
Nick Vatamaniuc [Mon, 12 Feb 2024 10:28:00 +0000 (05:28 -0500)]
FreeBSD QuickJS Patch (#203)

2 years agoFix shell injection bug in std.urlGet (#61)
Felix S [Mon, 12 Feb 2024 10:20:25 +0000 (10:20 +0000)]
Fix shell injection bug in std.urlGet (#61)

2 years agoadd gitignore for build objects (#84)
Sam [Mon, 12 Feb 2024 09:28:38 +0000 (09:28 +0000)]
add gitignore for build objects (#84)

Signed-off-by: Samuel Hellawell <sshellawell@gmail.com>
Co-authored-by: Charlie Gordon <github@chqrlie.org>
2 years agoFix sloppy mode arguments uninitialized value use
Ben Noordhuis [Wed, 1 Nov 2023 03:24:42 +0000 (04:24 +0100)]
Fix sloppy mode arguments uninitialized value use

MemorySanitizer complained about uninitialized reads in
the indexed property code path in JS_GetPropertyValue()
with JS_CLASS_MAPPED_ARGUMENTS objects.

2 years agoRemove unsafe sprintf() and strcat() calls
Ben Noordhuis [Wed, 1 Nov 2023 21:16:59 +0000 (22:16 +0100)]
Remove unsafe sprintf() and strcat() calls

Prep work for enabling the sanitizers on macos CI since they are marked
as deprecated and cause the build to fail when -Werror is enabled.

2 years agoFix undefined behavior (UBSAN)
Charlie Gordon [Sun, 11 Feb 2024 20:32:36 +0000 (21:32 +0100)]
Fix undefined behavior (UBSAN)

2 years agoFix UB in js_dtoa1
Saúl Ibarra Corretgé [Fri, 22 Dec 2023 21:50:02 +0000 (22:50 +0100)]
Fix UB in js_dtoa1

2 years agoAdd UndefinedBehaviorSanitizer support
Ben Noordhuis [Wed, 1 Nov 2023 04:00:43 +0000 (05:00 +0100)]
Add UndefinedBehaviorSanitizer support

2 years agoAdd MemorySanitizer support
Ben Noordhuis [Wed, 1 Nov 2023 03:30:34 +0000 (04:30 +0100)]
Add MemorySanitizer support

2 years agoUnbroke tests/test_test_bjson.js
Ben Noordhuis [Wed, 29 Nov 2023 07:50:53 +0000 (08:50 +0100)]
Unbroke tests/test_test_bjson.js

2 years agoAdd more tests
Ben Noordhuis [Wed, 29 Nov 2023 07:50:53 +0000 (08:50 +0100)]
Add more tests

- add regexp tests in tests/microbench.js
- add bjson_test_regexp in tests/test_test_bjson.js

2 years agoFix runtime bugs
Charlie Gordon [Sun, 11 Feb 2024 11:49:40 +0000 (12:49 +0100)]
Fix runtime bugs

- fix string leak in `js_printf_internal` on errors
- read `errno` before potential side effects in `js_os_stat`

2 years agoImprove microbench
Charlie Gordon [Sun, 11 Feb 2024 11:11:53 +0000 (12:11 +0100)]
Improve microbench

- remove import statements (invoke with qjs --std)
- fix compatibility issues with node
- add more loop styles
- add more string concatenation tests
- use === and !=== where appropriate
- fix sort timing log
- add `-r ref_file` command line option to specify reference file
- add .gitignore file with target file patterns

2 years agoFix test262o error
Charlie Gordon [Sat, 10 Feb 2024 19:54:29 +0000 (20:54 +0100)]
Fix test262o error

- excude test262o/test/suite/ch15/15.5/15.5.4/15.5.4.9/15.5.4.9_CE.js:
  Test262 Error: String.prototype.localeCompare considers ö (\u006f\u0308) = ö (\u00f6).

2 years agoStrip trailing spaces
Charlie Gordon [Sat, 10 Feb 2024 15:18:11 +0000 (16:18 +0100)]
Strip trailing spaces

2 years agoavoid using INT64_MAX in double comparisons because it cannot be exactly represented...
Fabrice Bellard [Sat, 3 Feb 2024 14:48:57 +0000 (15:48 +0100)]
avoid using INT64_MAX in double comparisons because it cannot be exactly represented as a double (bnoordhuis)

2 years agofixed MingW64 install on Windows (absop) (github issue #230)
Fabrice Bellard [Sat, 3 Feb 2024 14:48:09 +0000 (15:48 +0100)]
fixed MingW64 install on Windows (absop) (github issue #230)

2 years agofixed Promise return in the REPL by using a wrapper object in async std.evalScript...
Fabrice Bellard [Sat, 3 Feb 2024 14:47:42 +0000 (15:47 +0100)]
fixed Promise return in the REPL by using a wrapper object in async std.evalScript() (github issue #231)

2 years agoexport JS_GetModuleNamespace (github issue #34)
Fabrice Bellard [Sat, 27 Jan 2024 12:27:32 +0000 (13:27 +0100)]
export JS_GetModuleNamespace (github issue #34)

2 years agosimplified and fixed arrow function parsing (github issue #226)
Fabrice Bellard [Sat, 27 Jan 2024 12:12:54 +0000 (13:12 +0100)]
simplified and fixed arrow function parsing (github issue #226)

2 years agoupdate test results
Fabrice Bellard [Sat, 27 Jan 2024 12:12:37 +0000 (13:12 +0100)]
update test results

2 years agofixed js_std_await() in case 'obj' is not a promise (github issue #222)
Fabrice Bellard [Mon, 22 Jan 2024 17:03:35 +0000 (18:03 +0100)]
fixed js_std_await() in case 'obj' is not a promise (github issue #222)

2 years agofixed and simplified setTimeout() by using an integer timer handle (github issue...
Fabrice Bellard [Fri, 19 Jan 2024 09:20:34 +0000 (10:20 +0100)]
fixed and simplified setTimeout() by using an integer timer handle (github issue #218)

2 years agoadded js_std_await() and use it to wait for the evaluation of a module (github issue...
Fabrice Bellard [Fri, 19 Jan 2024 09:19:58 +0000 (10:19 +0100)]
added js_std_await() and use it to wait for the evaluation of a module (github issue #219)

2 years agoupdate Changelog
Fabrice Bellard [Fri, 19 Jan 2024 09:18:32 +0000 (10:18 +0100)]
update Changelog

2 years agonew release
Fabrice Bellard [Sat, 13 Jan 2024 10:16:02 +0000 (11:16 +0100)]
new release

2 years agoallow override of PREFIX, CROSS_PREFIX, CFLAGS and LDFLAGS in Makefile (humenda)
Fabrice Bellard [Sat, 13 Jan 2024 10:15:28 +0000 (11:15 +0100)]
allow override of PREFIX, CROSS_PREFIX, CFLAGS and LDFLAGS in Makefile (humenda)

2 years agofixed JS_GetScriptOrModuleName() in direct or indirect eval code
Fabrice Bellard [Sat, 13 Jan 2024 10:15:06 +0000 (11:15 +0100)]
fixed JS_GetScriptOrModuleName() in direct or indirect eval code

2 years agonative cosmopolitan build
Fabrice Bellard [Thu, 11 Jan 2024 14:29:19 +0000 (15:29 +0100)]
native cosmopolitan build

2 years agofixed uninitialized harnessbuf
Fabrice Bellard [Thu, 11 Jan 2024 14:28:41 +0000 (15:28 +0100)]
fixed uninitialized harnessbuf

2 years agoupdate test results
Fabrice Bellard [Thu, 11 Jan 2024 14:28:12 +0000 (15:28 +0100)]
update test results

2 years agomore portable and Windows version for getTimezoneOffset() (github issue #122)
Fabrice Bellard [Thu, 11 Jan 2024 14:26:39 +0000 (15:26 +0100)]
more portable and Windows version for getTimezoneOffset() (github issue #122)

2 years agoadded os.getpid()
Fabrice Bellard [Thu, 11 Jan 2024 14:25:28 +0000 (15:25 +0100)]
added os.getpid()

2 years agoregexp: fixed the zero advance logic in quantifiers (github issue #158)
Fabrice Bellard [Wed, 10 Jan 2024 13:36:19 +0000 (14:36 +0100)]
regexp: fixed the zero advance logic in quantifiers (github issue #158)

2 years agooptional chaining fixes (github issue #103)
Fabrice Bellard [Tue, 9 Jan 2024 18:15:40 +0000 (19:15 +0100)]
optional chaining fixes (github issue #103)

2 years agofixed Date.toLocaleString() (kuzmas)
Fabrice Bellard [Mon, 8 Jan 2024 18:02:30 +0000 (19:02 +0100)]
fixed Date.toLocaleString() (kuzmas)

2 years agofixed regexp case insensitive flag
Fabrice Bellard [Mon, 8 Jan 2024 17:42:29 +0000 (18:42 +0100)]
fixed regexp case insensitive flag

2 years agofix worker termination in example (github issue #98)
Fabrice Bellard [Mon, 8 Jan 2024 17:41:03 +0000 (18:41 +0100)]
fix worker termination in example (github issue #98)

2 years agofixed next token parsing after a function definition (github issue #77)
Fabrice Bellard [Mon, 8 Jan 2024 17:40:35 +0000 (18:40 +0100)]
fixed next token parsing after a function definition (github issue #77)

2 years agofixed class name init in static initializers
Fabrice Bellard [Mon, 8 Jan 2024 17:39:58 +0000 (18:39 +0100)]
fixed class name init in static initializers

2 years agoavoid potentially undefined behavior and make valgrind happy (bnoordhuis) (github...
Fabrice Bellard [Mon, 8 Jan 2024 17:39:26 +0000 (18:39 +0100)]
avoid potentially undefined behavior and make valgrind happy (bnoordhuis) (github issue #153)

2 years agofixed run_test262_harness_test() with modules
Fabrice Bellard [Sat, 6 Jan 2024 13:43:47 +0000 (14:43 +0100)]
fixed run_test262_harness_test() with modules

2 years agomake for in faster and spec compliant (github issue #137)
Fabrice Bellard [Sat, 6 Jan 2024 13:43:29 +0000 (14:43 +0100)]
make for in faster and spec compliant (github issue #137)

2 years agofixed test262: derived-this-uninitialized-realm.js
Fabrice Bellard [Sat, 6 Jan 2024 13:42:43 +0000 (14:42 +0100)]
fixed test262: derived-this-uninitialized-realm.js

2 years agoadded a comment for non-initialized warning in Valgrind (github issue #153)
Fabrice Bellard [Sat, 6 Jan 2024 10:20:20 +0000 (11:20 +0100)]
added a comment for non-initialized warning in Valgrind (github issue #153)

2 years agoadded 'in' operator for private fields
Fabrice Bellard [Tue, 2 Jan 2024 15:11:20 +0000 (16:11 +0100)]
added 'in' operator for private fields

2 years agoclass static block (initial patch by bnoordhuis)
Fabrice Bellard [Tue, 2 Jan 2024 15:10:43 +0000 (16:10 +0100)]
class static block (initial patch by bnoordhuis)

2 years agoadded note about atomic operations
Fabrice Bellard [Tue, 2 Jan 2024 15:10:24 +0000 (16:10 +0100)]
added note about atomic operations

2 years agofixed crash in JS_DumpMemoryUsage (github issue #65)
Fabrice Bellard [Tue, 2 Jan 2024 15:09:55 +0000 (16:09 +0100)]
fixed crash in JS_DumpMemoryUsage (github issue #65)

2 years agoallow 'await' in the REPL and added os.sleepAsync()
Fabrice Bellard [Tue, 2 Jan 2024 15:09:30 +0000 (16:09 +0100)]
allow 'await' in the REPL and added os.sleepAsync()

2 years agomake JS_NewClassID thread safe
Fabrice Bellard [Tue, 2 Jan 2024 15:08:48 +0000 (16:08 +0100)]
make JS_NewClassID thread safe

2 years agoadded Error cause
Fabrice Bellard [Tue, 2 Jan 2024 15:08:08 +0000 (16:08 +0100)]
added Error cause

2 years agoadded os.now()
Fabrice Bellard [Wed, 27 Dec 2023 18:09:29 +0000 (19:09 +0100)]
added os.now()

2 years agodefine the same atoms with or without CONFIG_ATOMICS (github issue #76)
Fabrice Bellard [Wed, 27 Dec 2023 17:28:54 +0000 (18:28 +0100)]
define the same atoms with or without CONFIG_ATOMICS (github issue #76)

2 years agofixed JS module autodetection with shebang (github issue #91)
Fabrice Bellard [Wed, 27 Dec 2023 17:19:46 +0000 (18:19 +0100)]
fixed JS module autodetection with shebang (github issue #91)

2 years agofixed crash when resizing property shapes in case of OOM (github issue #129)
Fabrice Bellard [Wed, 27 Dec 2023 17:19:06 +0000 (18:19 +0100)]
fixed crash when resizing property shapes in case of OOM (github issue #129)

2 years agofixed the garbage collection of async functions with closures (github issue #156)
Fabrice Bellard [Wed, 27 Dec 2023 16:21:46 +0000 (17:21 +0100)]
fixed the garbage collection of async functions with closures (github issue #156)

2 years agoremoved memory leak
Fabrice Bellard [Wed, 27 Dec 2023 16:20:10 +0000 (17:20 +0100)]
removed memory leak

2 years agoadded RegExp 'd' flag (bnoordhuis)
Fabrice Bellard [Wed, 27 Dec 2023 16:19:44 +0000 (17:19 +0100)]
added RegExp 'd' flag (bnoordhuis)

2 years agoadded Promise.withResolvers
Fabrice Bellard [Wed, 27 Dec 2023 16:19:25 +0000 (17:19 +0100)]
added Promise.withResolvers

2 years agoadded Array.prototype.{with,toReversed,toSpliced,toSorted} and TypedArray.prototype...
Fabrice Bellard [Wed, 27 Dec 2023 16:19:00 +0000 (17:19 +0100)]
added Array.prototype.{with,toReversed,toSpliced,toSorted} and TypedArray.prototype.{with,toReversed,toSorted} (initial patch by bnoordhuis)

2 years agoadded Object.groupBy and Map.groupBy (initial patch by bnoordhuis)
Fabrice Bellard [Wed, 27 Dec 2023 16:18:39 +0000 (17:18 +0100)]
added Object.groupBy and Map.groupBy (initial patch by bnoordhuis)

2 years agoadded String.prototype.isWellFormed and String.prototype.toWellFormed
Fabrice Bellard [Wed, 27 Dec 2023 16:16:47 +0000 (17:16 +0100)]
added String.prototype.isWellFormed and String.prototype.toWellFormed

2 years agofixed detached TypedArray in sort()
Fabrice Bellard [Wed, 27 Dec 2023 16:13:44 +0000 (17:13 +0100)]
fixed detached TypedArray in sort()

2 years agotypos
Fabrice Bellard [Wed, 27 Dec 2023 16:11:25 +0000 (17:11 +0100)]
typos

2 years agotop-level-await support - follow the spec in the implementation of the module linking...
Fabrice Bellard [Wed, 27 Dec 2023 16:10:47 +0000 (17:10 +0100)]
top-level-await support - follow the spec in the implementation of the module linking and evaluation to avoid errors with cycling module dependencies

2 years agocall js_std_free_handlers() in the code generated by qjsc (github issue #96)
Fabrice Bellard [Fri, 22 Dec 2023 10:07:00 +0000 (11:07 +0100)]
call js_std_free_handlers() in the code generated by qjsc (github issue #96)

2 years agoreduced JS_MAX_LOCAL_VARS (github issue #123)
Fabrice Bellard [Fri, 22 Dec 2023 10:06:37 +0000 (11:06 +0100)]
reduced JS_MAX_LOCAL_VARS (github issue #123)

2 years agoremoved unused JSContext field
Fabrice Bellard [Fri, 22 Dec 2023 10:06:19 +0000 (11:06 +0100)]
removed unused JSContext field

2 years agouse Unicode normalization in String.prototype.localeCompare
Fabrice Bellard [Fri, 22 Dec 2023 10:05:49 +0000 (11:05 +0100)]
use Unicode normalization in String.prototype.localeCompare

2 years ago'for of' expression cannot start with 'async'
Fabrice Bellard [Fri, 22 Dec 2023 10:05:18 +0000 (11:05 +0100)]
'for of' expression cannot start with 'async'

2 years agoremoved incorrect await in async yield*
Fabrice Bellard [Fri, 22 Dec 2023 10:04:54 +0000 (11:04 +0100)]
removed incorrect await in async yield*

2 years agofixed define own property with writable=false on module namespace
Fabrice Bellard [Fri, 22 Dec 2023 10:04:22 +0000 (11:04 +0100)]
fixed define own property with writable=false on module namespace

2 years agoadded container_of macro
Fabrice Bellard [Fri, 22 Dec 2023 10:03:44 +0000 (11:03 +0100)]
added container_of macro

2 years agosafer typed array finalizer
Fabrice Bellard [Fri, 22 Dec 2023 10:03:13 +0000 (11:03 +0100)]
safer typed array finalizer

2 years agofixed js_strtod with large integers (github issue #206)
Fabrice Bellard [Fri, 22 Dec 2023 10:02:39 +0000 (11:02 +0100)]
fixed js_strtod with large integers (github issue #206)

2 years agotest 128 bit integer support (github issue #125)
Fabrice Bellard [Fri, 22 Dec 2023 10:02:05 +0000 (11:02 +0100)]
test 128 bit integer support (github issue #125)

2 years agofixed 'return' handling with 'yield' in 'for of' or with finally blocks (gihub ticket...
Fabrice Bellard [Wed, 13 Dec 2023 18:02:47 +0000 (19:02 +0100)]
fixed 'return' handling with 'yield' in 'for of' or with finally blocks (gihub ticket #166)

2 years agofixed async generator in case of exception in the implicit await in the 'return'...
Fabrice Bellard [Wed, 13 Dec 2023 18:01:59 +0000 (19:01 +0100)]
fixed async generator in case of exception in the implicit await in the 'return' statement

2 years agoFix AsyncGenerator.prototype.return error handling (bnoordhuis)
Fabrice Bellard [Wed, 13 Dec 2023 18:01:10 +0000 (19:01 +0100)]
Fix AsyncGenerator.prototype.return error handling (bnoordhuis)

2 years agoadded -fwrapv to CFLAGS to ensure that signed overflows have a well defined behavior
Fabrice Bellard [Wed, 13 Dec 2023 18:00:17 +0000 (19:00 +0100)]
added -fwrapv to CFLAGS to ensure that signed overflows have a well defined behavior

2 years agoraise an error if a private method is added twice to an object
Fabrice Bellard [Wed, 13 Dec 2023 17:59:47 +0000 (18:59 +0100)]
raise an error if a private method is added twice to an object

2 years agonew release
Fabrice Bellard [Sat, 9 Dec 2023 11:52:22 +0000 (12:52 +0100)]
new release

2 years agoadded Array.prototype.findLast{Index} and TypeArray.prototype.findLast{index} (initia...
Fabrice Bellard [Sat, 9 Dec 2023 11:33:05 +0000 (12:33 +0100)]
added Array.prototype.findLast{Index} and TypeArray.prototype.findLast{index} (initial patch by bnoordhuis)

2 years agofixed duplicate static private setter/getter test
Fabrice Bellard [Sat, 9 Dec 2023 11:32:32 +0000 (12:32 +0100)]
fixed duplicate static private setter/getter test

2 years agoSymbol.species is no longer used in TypedArray constructor from a TypedArray
Fabrice Bellard [Sat, 9 Dec 2023 11:32:00 +0000 (12:32 +0100)]
Symbol.species is no longer used in TypedArray constructor from a TypedArray

2 years agofixed delete super.x error
Fabrice Bellard [Sat, 9 Dec 2023 11:31:33 +0000 (12:31 +0100)]
fixed delete super.x error

2 years agoreworked set property and fixed corner cases of typed array set property
Fabrice Bellard [Sat, 9 Dec 2023 11:30:31 +0000 (12:30 +0100)]
reworked set property and fixed corner cases of typed array set property

2 years agoImplement extended named capture group identifiers (bnoordhuis)
Fabrice Bellard [Sat, 9 Dec 2023 11:28:51 +0000 (12:28 +0100)]
Implement extended named capture group identifiers (bnoordhuis)