Saúl Ibarra Corretgé
685a9bc171
Install qjsc as part of the install target
...
Fixes: https://github.com/quickjs-ng/quickjs/issues/730
2024-12-02 21:16:53 +01:00
Saúl Ibarra Corretgé
fd054b7231
Fix Date.prototype.set* when date is invalid
...
setYear required special handing since calling date.setYear(NaN) has
specific defined behavior.
2024-11-28 20:45:54 +01:00
Saúl Ibarra Corretgé
c351133dcc
Implement Error.captureStackTrace
2024-11-26 12:13:42 +01:00
Ben Noordhuis
0b0b794605
Simplify close_lexical_var ( #726 )
...
Its implementation was borderline wrong: calling it with is_arg=TRUE
segfaults because it looks up the var ref index in the wrong array.
Fortunately, there is only one caller and it only passes FALSE.
2024-11-26 00:34:46 +01:00
Saúl Ibarra Corretgé
aca0a09509
Drop GCC 4.8 CI
...
The workaround to use an old Node version no longer works: https://github.com/actions/checkout/issues/1590
2024-11-25 22:18:05 +01:00
Saúl Ibarra Corretgé
bda14ec9e1
Simplify release CI
...
In addition, run the release CI, except the upload step on each PR, to
make sure things don't break and we find about them right when doing a
release.
2024-11-25 22:09:11 +01:00
Saúl Ibarra Corretgé
f7f70fc579
Fix leak when interpreter exits due to exception
...
Fixes: https://github.com/quickjs-ng/quickjs/issues/720
2024-11-25 11:07:07 +01:00
Saúl Ibarra Corretgé
9631492534
Fix catching all exceptions from std.evalScript
...
In case of a syntax error, the function throws syncrnonously.
I'll admit I wondered when Promise.try would be useful... I guess I know
now!
Fixes: https://github.com/quickjs-ng/quickjs/issues/720#issuecomment-2495961142
2024-11-25 10:44:05 +01:00
Penner
61dae5d420
fix crash when add property maybe failed on build arguments
2024-11-25 07:59:23 +01:00
pancake
df44d66291
Do not depend on c99 for(int
...
NB: The project requires C11, but sicne this is the only occurrence of such kind, we let it slide. See the PR conversation.
2024-11-24 12:46:29 +01:00
Saúl Ibarra Corretgé
4ca6d9bba0
Don't share class functions across Set and Map
...
Map has groupBy and Set doesn't.
Fixes: https://github.com/quickjs-ng/quickjs/issues/714
2024-11-22 08:33:48 +01:00
Ben Noordhuis
81e50f3cae
Use closefrom() to close open file descriptors ( #712 )
...
Replace the naive close() loop in js_os_exec with closefrom().
On my system RLIMIT_NOFILE is set to 1 million and the delay from the
loop gets noticeable when I spawn many processes.
Use dlsym() to look up closefrom() because it's not available everywhere
(looking at you, musl.)
Fixes: https://github.com/quickjs-ng/quickjs/issues/711
2024-11-21 20:43:18 +01:00
Icemic
010777f259
Add quickjs-rusty
to projects using NG
2024-11-21 14:23:15 +01:00
morn-0
769e78ff7d
Remove unnecessary parameters
...
Enhanced msvc cross-compile compatibility
2024-11-20 15:52:52 +01:00
Saúl Ibarra Corretgé
ef15418807
Fix null deref in js_iterator_helper_next
...
Fixes: https://github.com/quickjs-ng/quickjs/issues/705
2024-11-19 19:21:34 +01:00
Saúl Ibarra Corretgé
0b9b6c1915
Simplify iterator helpers code, remove duplication
2024-11-18 23:43:39 +01:00
Saúl Ibarra Corretgé
55b67a6591
Bump CMake version to 3.10
...
Fixes a deprecation warning with new CMake versions.
2024-11-18 11:02:29 +01:00
Ben Noordhuis
f93dd58ea0
Work around msvc definition of NAN
...
NAN is reportedly no longer a compile-time expression in some versions
of MSVC. Work around that by minting a NaN from a uint64.
Fixes: https://github.com/quickjs-ng/quickjs/issues/622
Fixes: https://github.com/quickjs-ng/quickjs/issues/693
2024-11-18 10:49:30 +01:00
Saúl Ibarra Corretgé
bdadad97cd
Add Windows SDK CI
2024-11-18 10:49:30 +01:00
Ben Noordhuis
974f40a1a8
Fix harmless -Wsign-compare warning ( #699 )
...
`sizeof(buf) == 128` so the signed comparison is always within range.
2024-11-17 23:21:03 +01:00
Ben Noordhuis
e1a0f4f1cf
Add Math.sumPrecise ( #697 )
2024-11-16 11:34:14 +01:00
Saúl Ibarra Corretgé
428204b802
Align JS_SetOpaque with other similar APIs
...
Returns < 0 on failure. Also document it in the header file.
Fixes: https://github.com/quickjs-ng/quickjs/issues/695
2024-11-16 10:35:01 +01:00
Saúl Ibarra Corretgé
18b0b9a706
Update release CI action versions
...
actions/upload-artifact@v3 will be deprecated soon. Migrate to v4.
Ref: https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md
2024-11-16 09:26:06 +01:00
Saúl Ibarra Corretgé
706ba05fa6
Fix Linux release CI
...
There is no need to download git submodules when making releases.
2024-11-15 21:40:51 +01:00
Saúl Ibarra Corretgé
859267cc59
Set version to 0.7.0
2024-11-15 21:29:58 +01:00
Ben Noordhuis
407683bd98
Add Atomics.pause
2024-11-15 20:30:40 +01:00
bptato
42f0945114
Fix NULL deref in JS_NewRuntime2
...
The API allows for the malloc_usable_size callback to be NULL, so it
must not be dereferenced before the NULL check.
2024-11-15 15:02:59 +01:00
Saúl Ibarra Corretgé
284510f781
Make Iterator.from spec compliant
...
Create a proper wrapper around the inner iterator and proxy the calls to
next / return.
2024-11-15 13:35:25 +01:00
Saúl Ibarra Corretgé
204070a544
Fix broken link in README
2024-11-15 13:30:06 +01:00
Saúl Ibarra Corretgé
a7a614406d
Update README
2024-11-15 13:28:45 +01:00
Saúl Ibarra Corretgé
1350362ba6
Add cloning instructions to building section
2024-11-15 13:28:45 +01:00
Saúl Ibarra Corretgé
987afb7a52
Add list of projects using NG
2024-11-15 13:28:45 +01:00
Saúl Ibarra Corretgé
0575d10da7
Tweak intro and document differences with bellard/quickjs
2024-11-15 13:28:45 +01:00
Saúl Ibarra Corretgé
a365f18c98
Document how to create standalone executables
2024-11-15 13:28:45 +01:00
Saúl Ibarra Corretgé
559029baad
Fix Iterator.prototype
...
Make sure all descriptors are attached to the one and only iterator
prototype.
2024-11-15 13:16:28 +01:00
Ben Noordhuis
554907e88f
Add RegExp.escape ( #687 )
2024-11-15 12:17:38 +01:00
Ben Noordhuis
b5d41818e2
Fix bytecode stack frame printing ( #686 )
...
Handle OP_get_loc0_loc1 specially. Fixes an off-by-one when printing
variable names.
Fixes: https://github.com/quickjs-ng/quickjs/issues/683
2024-11-14 22:50:42 +01:00
Saúl Ibarra Corretgé
6d7448ed3e
Implement Iterator.prototype.flatMap
2024-11-14 19:48:41 +01:00
Ben Noordhuis
1cc19e4dbf
Fix detach check in ArrayBuffer.prototype.resize ( #681 )
2024-11-13 16:04:49 +01:00
Ben Noordhuis
fa4d2454aa
Add Error.isError ( #682 )
...
It's strictly speaking not at phase 3 yet (almost!) but it's very easy
to implement and quite useful.
2024-11-13 15:08:06 +01:00
Ben Noordhuis
2a78706484
Update test262 ( #680 )
...
test262 now tests Unicode 16 and that fixes a fair number of tests that
started failing after we upgraded to Unicode 16.
2024-11-13 14:36:07 +01:00
Saúl Ibarra Corretgé
17a8772379
Implement Iterator.prototype.map
2024-11-13 12:55:25 +01:00
Saúl Ibarra Corretgé
4933e17d1b
Remove error handling for JS_NewInt64, it's infallible
...
Also use js_int64(v) internally.
2024-11-12 22:33:22 +01:00
Saúl Ibarra Corretgé
c68c416e2e
Implement Iterator.prototype.filter
2024-11-12 22:01:45 +01:00
Ben Noordhuis
000061f635
Improve performance of variable resolver ( #672 )
...
Switch to a hash table when the number of variables grows beyond
a threshold.
Speeds up the test case from the linked issue by about 70%.
Fixes: https://github.com/quickjs-ng/quickjs/issues/456
2024-11-12 21:22:47 +01:00
Saúl Ibarra Corretgé
0362c0a4eb
Implement Iterator.prototype.take ( #676 )
2024-11-12 08:10:19 +01:00
Ben Noordhuis
487129055f
Work around broken atomics in tinycc ( #669 )
2024-11-12 01:01:52 +01:00
Saúl Ibarra Corretgé
c41ee4f15f
Implement Iterator.prototype.drop
...
Includes the scaffold for other iterator helper methods that require an
Iterator Helper object.
2024-11-11 22:25:24 +01:00
Ben Noordhuis
243b968ee1
Update to Unicode 16.0
2024-11-09 23:14:52 +01:00
Ben Noordhuis
416ab66f0b
Update to Unicode 15.1
2024-11-09 23:14:52 +01:00