Skip to content

Fix cwrap with returnType 'boolean' to return a JS boolean#27023

Open
esgott wants to merge 1 commit into
emscripten-core:mainfrom
esgott:fix-cwrap-boolean-return
Open

Fix cwrap with returnType 'boolean' to return a JS boolean#27023
esgott wants to merge 1 commit into
emscripten-core:mainfrom
esgott:fix-cwrap-boolean-return

Conversation

@esgott
Copy link
Copy Markdown

@esgott esgott commented May 28, 2026

The cwrap fast path returned the raw wasm export whenever the return type was not 'string', bypassing the Boolean() coercion that ccall applies. Exclude 'boolean' from the fast-path return check so boolean returns go through ccall, matching ccall's behavior.

Fixes: #27021

…n-core#27021)

The cwrap fast path returned the raw wasm export whenever the return
type was not 'string', bypassing the Boolean() coercion that ccall
applies. Exclude 'boolean' from the fast-path return check so boolean
returns go through ccall, matching ccall's behavior.
@sbc100
Copy link
Copy Markdown
Collaborator

sbc100 commented May 28, 2026

Thanks!

@sbc100 sbc100 changed the title Fix cwrap with returnType 'boolean' to return a JS boolean (#27021) Fix cwrap with returnType 'boolean' to return a JS boolean May 28, 2026
@sbc100 sbc100 enabled auto-merge (squash) May 28, 2026 16:16
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.

cwrap with returnType "boolean" returns a number when all args are numeric

2 participants