Skip to content

Support multi-value returns in TS definitions#27332

Open
stephenduong1004 wants to merge 1 commit into
emscripten-core:mainfrom
stephenduong1004:multireturn
Open

Support multi-value returns in TS definitions#27332
stephenduong1004 wants to merge 1 commit into
emscripten-core:mainfrom
stephenduong1004:multireturn

Conversation

@stephenduong1004

Copy link
Copy Markdown
Collaborator

wasm-bindgen generates WebAssembly functions with multiple return values, so we need to remove the assertion that enforces a single return type in tools/emscripten.py. This PR removes the assertion and correctly maps multi-value returns to TypeScript tuples.

@sbc100 sbc100 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would it be hard to write a test code for this ?

@sbc100 sbc100 requested a review from brendandahl July 13, 2026 17:14
@stephenduong1004

Copy link
Copy Markdown
Collaborator Author

@brendandahl do you have any suggestions on writing tests for this? I am not very familiar with upstream tests...

@brendandahl

Copy link
Copy Markdown
Collaborator

I'd create new test based on a rust test like one of these and also ensure the tsd is emitted correctly (example here)

@sbc100

sbc100 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

I'd create new test based on a rust test like one of these and also ensure the tsd is emitted correctly (example here)

Or could we just modify one of the existing tests to add a multi-value return somehow?

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.

3 participants