Skip to content

QTS_ExecutePendingJob_MaybeAsync difference in DEBUG_ASYNC and RELEASE_ASYNC mode #239

@are

Description

@are

Hi, first of all thank you for all the hard work you put into this library!

I am using quickjs-emscripten for my own internal project and have run into an issue while using newAsyncifiedFunction in combination with QuickJS async runtime/context executePendingJob.

Firstly, after checking the FFI, the executePendingJob function has a corresponding _MaybeAsync version which is not exposed but necessary to resolve the issue.

However, in the @jitl/quickjs-wasmfile-release-asyncify, in the following file, the {async: true} option is missing (which is present in the @jitl/quickjs-wasmfile-debug-asyncify)

QTS_ExecutePendingJob_MaybeAsync: (
rt: JSRuntimePointer,
maxJobsToExecute: number,
lastJobContext: JSContextPointerPointer,
) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(
"QTS_ExecutePendingJob",
"number",
["number", "number", "number"],
)

QTS_ExecutePendingJob_MaybeAsync: (
rt: JSRuntimePointer,
maxJobsToExecute: number,
lastJobContext: JSContextPointerPointer,
) => JSValuePointer | Promise<JSValuePointer> = this.module.cwrap(
"QTS_ExecutePendingJob",
"number",
["number", "number", "number"],
{ async: true },
)

Is this intended? This results in a different behaviour between those builds. Additionally, is there a reason for the async version of executePendingJob not being available on the runtime?

Version number of all libraries involved is 0.31.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions