Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Dec 30, 2025

This decorator automatically generates the Asyncify.handleAsync wrapper code. Hopefully we can transition all out __async functions soon and just make this the default.

src/jsifier.mjs Outdated
}

const isAsyncFunction = LibraryManager.library[symbol + '__async'];
if (ASYNCIFY && isAsyncFunction == 'auto') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For JSPI, I don't think we even need the handleAsync. Though there still may be some issues with balanced runtimeKeepalivePush runtimeKeepalivePop. Maybe worth a try?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think handleAsync is used to keep the runtime alive using runtimeKeepalivePush which I think this currently important. We can look at further simplification are followups perhaps, but for now I'd rather leave the semantics as matching.

@sbc100 sbc100 force-pushed the auto_async branch 2 times, most recently from b030f31 to 7309c65 Compare December 31, 2025 13:00
This decorator automatically generates the Asyncify.handleAsync wrapper
code.  Hopefully we can transition all out `__async` functions soon and
just make this the default.
@sbc100 sbc100 merged commit bc217ce into emscripten-core:main Jan 13, 2026
35 checks passed
@sbc100 sbc100 deleted the auto_async branch January 13, 2026 19:39
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.

2 participants