Skip to content

Support bytecode functions in JS_WriteObject #977

Open
@bnoordhuis

Description

@bnoordhuis

#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:

  1. Support bytecode functions in JS_WriteObject

  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions