Commit graph

118 commits

Author SHA1 Message Date
Ben Noordhuis
7c9cf46f97
Make Date methods argument coercion spec compliant (#104) 2023-11-21 15:04:38 +01:00
Divy Srivastava
7aabea9db0
Implement Error causes (#103) 2023-11-21 14:59:26 +01:00
Ben Noordhuis
d8ea7df950
Reject date strings with negative year zero (#100) 2023-11-21 11:43:45 +01:00
Saúl Ibarra Corretgé
5ce2957e23 Make JS_NewClassID thread aware
It's as thread-safe as JSRuntime, which isn't thread-safe, but multiple
threads can now allocate them on different runtimes without a problem.
2023-11-21 07:02:34 +01:00
Ben Noordhuis
b56a82d19f
Normalize inputs to String.prototype.localeCompare (#97)
NFC-normalize the inputs, otherwise strings like "Å" and "A\u030A"
(latin A with combining diacritical mark) don't compare equal.
2023-11-21 00:00:54 +01:00
Saúl Ibarra Corretgé
a721bda7b5 Drop CONFIG_ALL_UNICODE and enable it by default 2023-11-20 10:52:04 +01:00
Ben Noordhuis
bef2a12566
DRY surrogate pair handling (#95) 2023-11-20 09:46:02 +01:00
Ben Noordhuis
d1960d1bfe
Implement RegExp 'd' flag (#86) 2023-11-20 09:45:44 +01:00
Ben Noordhuis
e2bc6441f8
Optimize RegExp ASCII literal matching (#94)
Add REOP_char8 that matches single bytes. Compresses bytecode for the
ASCII common case by 33% and reduces regexp_ascii benchmark running time
by 4%. The regexp_utf16 benchmark is unaffected.
2023-11-19 17:26:45 +01:00
Ben Noordhuis
e49da8e96f
Unbreak microbench, add os.now() (#93)
The removal of the high-precision but non-standard clock source in
commit 5af98ca broke microbench because Date.now() is not granular
enough for the benchmark runner to make forward progress.

This commit adds a new method to the os module that returns time
with microsecond precision.
2023-11-19 17:26:25 +01:00
Ben Noordhuis
4727e40ac8
Retrieve RegExp 'g' flag in spec conformant way (#92) 2023-11-19 17:26:03 +01:00
Ben Noordhuis
b56cbb143c
Implement extended named capture group identifiers (#90)
Perfectly reasonable and not at all uncommon regular expressions like
/(?<𝑓𝑜𝑥>fox).*(?<𝓓𝓸𝓰>dog)/ are now accepted.
2023-11-19 11:01:38 +01:00
Ben Noordhuis
20b3aca5a2
Update to Unicode 15.0.0 (#89) 2023-11-18 22:29:53 +01:00
Ben Noordhuis
5af98ca858
Remove non-standard Date.__date_clock method (#88) 2023-11-18 19:15:05 +01:00
Ben Noordhuis
8ba4f4b824
Remove dead code (#87) 2023-11-18 19:14:24 +01:00
Divy Srivastava
5d2e74fbbd Add -DBUILD_QJS_LIBC option 2023-11-18 12:34:59 +01:00
Saúl Ibarra Corretgé
ea068d9a70 Add performance.{now,timeOrigin}
Ref: https://github.com/quickjs-ng/quickjs/issues/16
2023-11-18 11:16:35 +01:00
Saúl Ibarra Corretgé
f03ab48a85 Drop "LTO mode" from qjsc 2023-11-18 00:31:31 +01:00
Saúl Ibarra Corretgé
bebdfcea48
Drop ability to generate executables from qjsc (#76)
It's too brittle, and compiling the result is one command away.
2023-11-17 23:56:22 +01:00
Saúl Ibarra Corretgé
d6a334233c Remove old project files 2023-11-17 23:55:43 +01:00
Saúl Ibarra Corretgé
c4e732e049 Add Linux 32bits target to CI 2023-11-17 23:55:22 +01:00
Saúl Ibarra Corretgé
36fbc88c54 Update .gitignore 2023-11-17 23:01:40 +01:00
Saúl Ibarra Corretgé
54a4f2907e Refactor build system to use CMake only 2023-11-17 13:10:18 +01:00
Saúl Ibarra Corretgé
f162a181b5 Add ability to set CMake options with env variables 2023-11-17 13:10:18 +01:00
Ben Noordhuis
d88e9df9de
Implement TypedArray.prototype.findLast{Index} (#73) 2023-11-17 11:56:22 +01:00
Ben Noordhuis
7e955f6f4c
Implement Array.prototype.findLast{Index} (#70) 2023-11-17 11:54:21 +01:00
Saúl Ibarra Corretgé
da3688f33d
Build examples on CMake (#67) 2023-11-17 10:45:04 +01:00
Ben Noordhuis
90d8c6bae0
Fix uninitialized memory access (#68)
An alternative fix is to zero the `values` and `count` fields in
JS_NewObjectFromShape() irrespective of the object's class_id but
handling it in JS_GetPropertyValue() feels cleaner.

Fixes: https://github.com/quickjs-ng/quickjs/issues/63
2023-11-17 00:12:10 +01:00
Saúl Ibarra Corretgé
98d9147fb2 Fix hello_module example 2023-11-16 13:59:03 +01:00
Ben Noordhuis
48fc4bb26d
Update Array.prototype[Symbol.unscopables] (#65)
Add change-array-by-copy methods to Array.prototype[Symbol.unscopables].
2023-11-16 13:05:51 +01:00
Ben Noordhuis
feebfbc6ee
Add Array.prototype.toSpliced (#64) 2023-11-16 13:04:53 +01:00
Saúl Ibarra Corretgé
ab534123a6 Add CMake install targets 2023-11-16 11:02:18 +01:00
Saúl Ibarra Corretgé
e0170867b4 Set dev as the current version suffix 2023-11-16 09:24:43 +01:00
Ben Noordhuis
d2e632e77a
Allow symbols as WeakMap and WeakSet keys (#58) 2023-11-16 09:07:59 +01:00
Saúl Ibarra Corretgé
0b09109151
Add shared library target to CMake (#60) 2023-11-14 22:29:00 +01:00
Saúl Ibarra Corretgé
cc3e062484 Simplify NAN boxing macro setting 2023-11-14 21:57:24 +01:00
Saúl Ibarra Corretgé
9749a90cc6 Skip stack checks whenbuilding with ASAN 2023-11-14 12:44:16 +01:00
Saúl Ibarra Corretgé
b98df4d994 Run 262 tests when building with {a,ub}san 2023-11-14 12:44:16 +01:00
Saúl Ibarra Corretgé
7926755704 Leave symbols in for Release CMake builds too 2023-11-13 13:02:44 +01:00
Ben Noordhuis
f404980ec0
Add fused get_loc0_loc1 opcode (#55)
get_loc0 and get_loc1 are individually very frequent opcodes _and_ they
are very often paired together, making them ideal candidates for opcode
fusion.

Reduces microbench.js running time by about 4%.
2023-11-13 00:54:13 +01:00
Saúl Ibarra Corretgé
ba9569c76f Drop MinGW CI using Makefile 2023-11-12 23:15:41 +01:00
Saúl Ibarra Corretgé
1ccb36eee8 Add ASAN/MSAN/UBSAN support to CMake 2023-11-12 23:15:41 +01:00
Saúl Ibarra Corretgé
94b85a0784
Test Debug and Release CMake build types on CI (#52) 2023-11-12 23:04:46 +01:00
Ben Noordhuis
920cfc679a
Add copyright notices (#51)
I believe we made enough substantial changes to have a credible claim to
copyright holdership.
2023-11-12 22:42:07 +01:00
Ben Noordhuis
1e3893d25e
Remove duplicate test (#50) 2023-11-12 13:35:52 +01:00
Ben Noordhuis
e8ff1f4a3a
Remove broken SHORT_OPCODES=0 build mode (#49) 2023-11-12 13:35:41 +01:00
Ben Noordhuis
a92e74acac
Remove broken OPTIMIZE=0 build mode (#47) 2023-11-12 13:34:08 +01:00
Ben Noordhuis
162a8b7409
Remove trailing whitespace (#46)
Not purely cosmetic because it breaks navigation with { and } in the
One True Editor.
2023-11-12 10:01:40 +01:00
Ben Noordhuis
15f798db27
Implement Array.prototype.with (#45) 2023-11-11 23:35:46 +01:00
Ben Noordhuis
a19b07af37
Implement Array.prototype.toSorted (#44) 2023-11-11 21:51:02 +01:00