Skip to content

Asyncify + EM_ASM + async/await #8991

@davlhd

Description

@davlhd

Hello, I want to run a function that has await inside it:

async function loadStuff() {
    await stuffLoading();
}

if I use emscripten_run_script its telling me that await is only valid in async function

EM_ASM(
    await loadStuff();
)

Gives me an error SyntaxError: Unexpected token

How do I call async functions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions