BridgeJS: Remove JSException storage boxing once swiftlang/swift#89715 lands
@krodak がすでに取り組んでいます。
2026年6月11日 から。
評価
この issue はまだ評価されていません。
説明
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.
- 主要言語
- Swift
- スター
- 986
- フォーク
- 76
- 平均マージ
- 21時間 11分
- マージ済み PR(30日)
- 4
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
swiftwasm/JavaScriptKit のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
swiftwasm/JavaScriptKit#793 ·
-
swiftwasm/JavaScriptKit#785 · 担当者 1 名 ·
-
[SwiftBuild] Preserve duplicate archive members when SwiftBuild expands static archives for linking オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
swiftwasm/JavaScriptKit#781 · コメント 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
swiftwasm/JavaScriptKit#773 ·
-
swiftwasm/JavaScriptKit#761 · 担当者 1 名 ·
swiftwasm/JavaScriptKit の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
manaflow-ai/cmux#13763 ·
-
type: feature request
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
googleapis/google-cloud-swift#1036 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
wultra/mtoken-sdk-ios#253 ·
-
area:dictation documentation P2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
uttrflow/uttrflow-swift#1180 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100