Skip to content

Fix error descriptions Embedded Swift compatibility#759

Merged
MaxDesiatov merged 2 commits into
mainfrom
maxd/embedded-swift-error
Jun 9, 2026
Merged

Fix error descriptions Embedded Swift compatibility#759
MaxDesiatov merged 2 commits into
mainfrom
maxd/embedded-swift-error

Conversation

@MaxDesiatov

Copy link
Copy Markdown
Member

The BridgeJS generator emits JSError(message: String(describing: error)) for throwing @JS exports, but String.init(describing:) is unavailable in Embedded Swift, so embedded Wasm builds of any package with a throwing export fail. The caught error is statically a JSException with a stored description, so the generated glue now uses error.description for identical output. Snapshots regenerated.

The BridgeJS generator emits `JSError(message: String(describing: error))` for throwing `@JS` exports, but `String.init(describing:)` is unavailable in Embedded Swift, so embedded Wasm builds of any package with a throwing export fail. The caught error is statically a `JSException` with a stored `description`, so the generated glue now uses `error.description` for identical output. Snapshots regenerated.
@MaxDesiatov MaxDesiatov added the bug Something isn't working label Jun 9, 2026
@MaxDesiatov MaxDesiatov requested a review from krodak June 9, 2026 19:25
@MaxDesiatov MaxDesiatov enabled auto-merge (squash) June 9, 2026 19:56
@MaxDesiatov MaxDesiatov merged commit 453b841 into main Jun 9, 2026
13 checks passed
@MaxDesiatov MaxDesiatov deleted the maxd/embedded-swift-error branch June 9, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants