Open
Description
#975 adds Array.fromAsync
as a lazy-loaded bytecode function.
It's actually implemented as a bytecode module with a single exported function that returns the actual Array.fromAsync
function.
I did it in this roundabout fashion because JS_WriteObject
does not seem capable of directly serializing a bytecode function1, only when it's embedded in something else, like a script or module.
Things to improve:
-
Support bytecode functions in
JS_WriteObject
-
Add a flag to qjsc to compile the input as a function instead of as a script or module.
1 It's possible ES classes don't work either but I didn't test that