BridgeJS: Remove JSException storage boxing once swiftlang/swift#89715 lands
@krodak já está trabalhando nisso.
Desde 11/6/2026.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
Tracks removal of the JSException storage boxing introduced in #766.
Context
swiftlang/swift#89320 miscompiles Wasm calls to captureless async throws(JSException) closure values when the typed error exceeds the direct error convention: the thrown error is corrupted across the async unwind, so the rejected Promise receives garbage. JSException (~36 bytes) always took the affected indirect-error path.
#766 works around this at the library level by boxing JSException's stored properties (thrownValue, description, stack) into a private final class, shrinking the struct to a single stored reference so it travels in the direct error convention and the broken path is never taken. The public API is unchanged; the cost is one heap allocation per thrown exception. The original exploration is in https://github.com/PassiveLogic/JavaScriptKit/pull/13.
The codegen-level counterpart for zero-parameter async throwing exports is tracked separately in #761.
What to do once the compiler fix ships
The proper fix is swiftlang/swift#89715 (IRGen: fix async typed throws miscompiles on Wasm). Once it is available in the oldest Swift toolchain JavaScriptKit supports:
- Move
thrownValue,description, andstackback to stored properties onJSExceptionand delete theStorageclass. This is a library-internal layout change only, not a breaking API change. - Keep the async closure reject end-to-end tests as the regression guard that the reject path still works without the boxing.
- Linguagem predominante
- Swift
- Estrelas
- 986
- Forks
- 76
- Merge médio
- 21h 11min
- PRs com merge (30d)
- 4
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de swiftwasm/JavaScriptKit
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
swiftwasm/JavaScriptKit#793 ·
-
swiftwasm/JavaScriptKit#785 · 1 responsável ·
-
[SwiftBuild] Preserve duplicate archive members when SwiftBuild expands static archives for linking Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
swiftwasm/JavaScriptKit#781 · 3 comentários ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
swiftwasm/JavaScriptKit#773 ·
-
swiftwasm/JavaScriptKit#761 · 1 responsável ·
Todas as issues de swiftwasm/JavaScriptKit
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
maxgoedjen/secretive#840 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
manaflow-ai/cmux#13763 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
openwallet-foundation/multipaz#2028 ·