65 Commits

Author SHA1 Message Date
Fabrice Bellard
a8b2d7c2b2 added Float16Array (bnoordhuis) - optimized float16 conversion functions 2025-05-05 19:12:32 +02:00
Fabrice Bellard
7645ce5f63 more precise error location reporting 2025-04-26 12:25:00 +02:00
Fabrice Bellard
8e9e8e86c5 update tests 2025-04-22 19:16:19 +02:00
Fabrice Bellard
e5e724829a added staging test262 tests 2025-04-21 16:23:42 +02:00
Fabrice Bellard
dbbca3dbf3 dtoa fix for minus zero 2025-04-21 15:33:47 +02:00
Fabrice Bellard
251a8b2211 added column number in error messages - simplified parser 2025-04-14 14:46:47 +02:00
Fabrice Bellard
9918c1206e workaround for #282 2025-04-10 17:38:28 +02:00
Fabrice Bellard
25ffdb418e fixed the handling of unicode identifiers 2025-04-10 10:34:40 +02:00
Fabrice Bellard
9d3776d0d4 fixed break statement in the presence of labels (bnoordhuis) (#275) 2025-04-07 19:01:30 +02:00
Fabrice Bellard
a151ce19e5 fixed and improved Map/Set hashing 2025-04-07 14:42:07 +02:00
Fabrice Bellard
159fe289e3 fixed module cyclic imports (#329) 2025-04-05 18:06:08 +02:00
Fabrice Bellard
f121cbdb5a added forgotten js_weakref_is_live() tests 2025-04-05 15:41:51 +02:00
Fabrice Bellard
b342502a31 avoid freeing an object structure in js_weakref_free() if it is about to be freed in free_zero_refcount() 2025-04-05 15:21:57 +02:00
Fabrice Bellard
8b5b1277ad reworked weak references so that cycles are (hopefully) correctly handled - added Symbol as WeakMap key, WeakRef and FinalizationRegistry 2025-04-05 12:49:29 +02:00
Fabrice Bellard
b31bb20666 updated to unicode 16.0.0 (bnoordhuis) - updated test262 2025-03-25 19:08:19 +01:00
Fabrice Bellard
156d981afe added string ropes for faster concatenation of long strings (issue #67) 2025-03-25 16:01:40 +01:00
Fabrice Bellard
372ad84e9a more dtoa bench (Charlie Gordon) 2025-03-22 12:50:11 +01:00
Fabrice Bellard
a44011ed5a enable dtoa tests on win32 2025-03-22 12:40:37 +01:00
Fabrice Bellard
49413985eb fixed hash_map_resize() - added Map/WeakMap in microbench 2025-03-22 10:54:21 +01:00
Fabrice Bellard
993660621a 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. 2025-03-19 19:07:57 +01:00
Fabrice Bellard
6d6893bfa3 fixed BigInt hashing - removed -fno-bigint in qjsc and JS_AddIntrinsicBigInt() (BigInt is now considered as a base object) 2025-03-19 12:33:54 +01:00
Fabrice Bellard
6de88859e7 more bignum cleanup 2025-03-19 11:43:31 +01:00
Fabrice Bellard
543897ab7b added missing variable 2025-03-18 18:34:05 +01:00
Fabrice Bellard
61e8b94428 removed bignum support and qjscalc - added optimized BigInt implementation 2025-03-18 18:29:10 +01:00
Fabrice Bellard
c739debf0f microbench: use toFixed() 2025-03-13 16:23:13 +01: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
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
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
6a89d7c270
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>
2024-03-03 21:57:38 +01:00
Ben Noordhuis
e17cb9fc7a Add github CI tests
- disable `isatty()` test in `test_os()`
- add `.github/workflows/ci.yml` with 8 targets
2024-03-03 14:14:23 +01:00
Charlie Gordon
3dd93eb4e4
fix microbench when microbench.txt is missing (#246) 2024-03-03 03:38:49 +01:00
Charlie Gordon
35b7b3c379 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
2024-03-03 02:59:08 +01:00
Charlie Gordon
8180d3dd87 Improve microbench.js
- ensure handler behavior does not depend on n argument
- load and save reference file in node.js
- add -s filename option to name the output reference file
- add targets in Makefile for tests and bencharks using node.js
- fix incorrect timings when not using high resolution timer
- use performance timer in node.js
- output performance factor instead of percentage
- use smaller threshold by default
- add benchmarks for:
    date_parse(), prop_update(), prop_clone(), array_slice()
    global_func_call(),
2024-02-26 00:14:31 +01:00
Charlie Gordon
78db49cf95 Improve Date.parse
- rewrite Date.parse() with separate parsers
- return `NaN` for out of bounds field values as specified
- accept up to 9 decimals for millisecond fraction but truncate at 3
- accept many more alternative date/time formats
- add test cases in tests/test_builtin.js
2024-02-25 23:47:26 +01:00
Charlie Gordon
27928ce491 Fix Map hash bug
- `map_hash_key` must generate the same key for JS_INT and JS_FLOAT64
   with the same value
- add test cases in tests/test_builtin.js
2024-02-22 19:31:57 +01:00
Charlie Gordon
b70e764427 Rewrite set_date_fields to match the ECMA specification
- use `double` arithmetic where necessary to match the spec
- use `volatile` to ensure correct order of evaluation
  and prevent FMA code generation
- reject some border cases.
- avoid undefined behavior in `double` -> `int64_t` conversions
- improved tests/test_builtin.js `assert` function to compare
  values more reliably.
- added some tests in `test_date()`
- disable some of these tests on win32 and cygwin targets
2024-02-21 21:22:10 +01:00
Charlie Gordon
74bdb4967c 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")) {};`
2024-02-17 21:54:19 +01:00
Charlie Gordon
85fb2caeae 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
2024-02-17 21:15:29 +01:00
Charlie Gordon
8e21b96738 pass node-js command line arguments to microbench 2024-02-15 09:59:50 +01:00
Ben Noordhuis
626e0d4e60 Unbroke tests/test_test_bjson.js 2024-02-11 18:38:47 +01:00
Ben Noordhuis
2e1013429a Add more tests
- add regexp tests in tests/microbench.js
- add bjson_test_regexp in tests/test_test_bjson.js
2024-02-11 16:20:39 +01:00
Charlie Gordon
c9e6c56c70 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
2024-02-11 12:11:53 +01:00
Charlie Gordon
37bd4ae62d Strip trailing spaces 2024-02-10 16:19:17 +01:00
Fabrice Bellard
cd666a851f simplified and fixed arrow function parsing (github issue #226) 2024-01-27 13:12:54 +01:00
Fabrice Bellard
10fc744ae4 regexp: fixed the zero advance logic in quantifiers (github issue #158) 2024-01-10 14:36:19 +01:00
Fabrice Bellard
f25e5d4094 optional chaining fixes (github issue #103) 2024-01-09 19:15:40 +01:00
Fabrice Bellard
aac24640b1 fix worker termination in example (github issue #98) 2024-01-08 18:41:03 +01:00
Fabrice Bellard
c06c399f4f fixed next token parsing after a function definition (github issue #77) 2024-01-08 18:40:35 +01:00