Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable createWasm to use async/await with closure and babel #23704

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Feb 19, 2025

I really which we had a better solution here, but this makes the use of async/await independent of closure usage.

This is a workaround for #23158, but it also happens to fix #23687
which stems from the same issue.

Fixes: #23687

@kleisauke
Copy link
Collaborator

FWIW, I once successfully implemented a better solution for this, but it turned out to be a large change, see:
#17915 (comment)

@sbc100
Copy link
Collaborator Author

sbc100 commented Feb 19, 2025

FWIW, I once successfully implemented a better solution for this, but it turned out to be a large change, see: #17915 (comment)

I also implemented another approach in #23261 which actually fixes #23158, but sadly it causes code size regressions, because closure doesn't seem to be able to reason about code inside of functions the same way it can about top level code.

@sbc100 sbc100 changed the title Enable createWasm to use async/await with closure Enable createWasm to use async/await with closure and babel Feb 19, 2025
@sbc100 sbc100 force-pushed the async_createWasm branch 2 times, most recently from f23ca44 to 821b11c Compare February 19, 2025 21:06
I really which we had a better solution here, but this makes the use
of async/await independent of closure usage.

This is a workaround for emscripten-core#23158, but it also happens to fix emscripten-core#23687
which stems from the same issue.

Fixes: emscripten-core#23687
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: 'await' is only allowed within async functions and at the top levels of modules.
3 participants