quickjs-ng / quickjs

QuickJS, the Next Generation: a mighty JavaScript engine
https://quickjs-ng.github.io/quickjs/
MIT License
1.01k stars 83 forks source link

Add missing ES 2023+ features #54

Open saghul opened 11 months ago

saghul commented 11 months ago

ES2021 Or ES12

ES2022 Or ES13

ES2023 Or ES14

saghul commented 11 months ago

@bnoordhuis can you pl check if there is anything missing from the list?

bnoordhuis commented 11 months ago

Looking at https://github.com/tc39/proposals/blob/HEAD/finished-proposals.md#finished-proposals, I believe we're missing:

ammarahm-ed commented 11 months ago

You guys are doing awesome work here. Here is frida-gum that implements WeakRef for QuickJS like this:

https://github.com/frida/frida-gum/blob/ed4f17176f8671af93fbbb9afdbb584fb7825bf6/bindings/gumjs/runtime/entrypoint-quickjs.js#L12

  1. bind ref https://github.com/frida/frida-gum/blob/ed4f17176f8671af93fbbb9afdbb584fb7825bf6/bindings/gumjs/gumquickcore.c#L2261

  2. deref https://github.com/frida/frida-gum/blob/ed4f17176f8671af93fbbb9afdbb584fb7825bf6/bindings/gumjs/gumquickcore.c#L2371C24-L2371C47

  3. unbind ref https://github.com/frida/frida-gum/blob/ed4f17176f8671af93fbbb9afdbb584fb7825bf6/bindings/gumjs/gumquickcore.c#L2322

Which could make it easier to figure out the implementation for WeakRef possibly.

saghul commented 11 months ago

Thanks for sharing! I did lift a couple of commits from Frida already, but hadn't seen the gum part.

ammarahm-ed commented 11 months ago

Here's someone also implemented FinalizationRegistry for QuickJS: https://github.com/cashapp/zipline/blob/trunk/zipline/native/common/finalization-registry.c

I know this isn't the most perfect form but it almost gets you there.

leeoniya commented 10 months ago

new upstream release: https://github.com/bellard/quickjs/commit/daa35bc1e5d43192098af9b51caeb4f18f73f9f9

saghul commented 10 months ago

I'll backport some of the fixes, but there are no new ES features other than the ones he took from this project AFAICT :-)