[quickjs-devel] QuickJS Feature requests and corresponding patches

  • From: Koushik Dutta <koush@xxxxxxxxxxxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Thu, 14 Nov 2019 23:47:27 -0800

Support for exotic constructors (similar to Proxy handler construct trap).
https://github.com/koush/quickjs/commit/4a9a73ab16d91947fb7383353780e53926ebf6cf
I'm building Java bindings to QuickJS, and this is necessary to be able to
instantiate Java classes from QuickJS via a 'new' invocation in a clean
fashion, without having to resort to using a JS Proxy shim instead. Ie, all
Java objects are under a single class ID, including java.lang.Class
objects, which can be instantiated with new on the QuickJS side.

JS_IsArrayBuffer:
https://gist.github.com/koush/ecd9f1a65708f15bc1f71307ba3fd966
This isn't quite necessary, as it's possible to do this in a roundabout way
by getting the ArrayBuffer prototype via evaluation, but it's nice to have.

JS_NewAtomLenPrivate
https://github.com/koush/quickjs/commit/d0a24eb6ad967f8f2d2ce151be8cae6f06035bc2#diff-8561242cf01b9394bd9d00e57a0f7db3L2596
I'm not sure if there's a way to do this already, but I needed a way to add
private/internal properties to a JSValue, that would not show up in
getOwnPropertyNames when called on the script side.

Koush

Other related posts:

  • » [quickjs-devel] QuickJS Feature requests and corresponding patches - Koushik Dutta