BridgeJS: Remove JSException storage boxing once swiftlang/swift#89715 lands
@krodak đang làm issue này rồi.
Từ ngày 11/6/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- Swift
- Star
- 986
- Fork
- 76
- Merge trung bình
- 21 giờ 11 phút
- Pull request đã merge (30 ngày)
- 4
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của swiftwasm/JavaScriptKit
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
swiftwasm/JavaScriptKit#793 ·
-
swiftwasm/JavaScriptKit#785 · 1 người được giao ·
-
[SwiftBuild] Preserve duplicate archive members when SwiftBuild expands static archives for linking Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
swiftwasm/JavaScriptKit#781 · 3 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
swiftwasm/JavaScriptKit#773 ·
-
swiftwasm/JavaScriptKit#761 · 1 người được giao ·
Tất cả issue của swiftwasm/JavaScriptKit
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
manaflow-ai/cmux#13763 ·
-
type: feature request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
googleapis/google-cloud-swift#1036 · 1 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
wultra/mtoken-sdk-ios#253 ·
-
The correction-threshold rationale says 17 restraint cases collide; the current corpus has 16 Đang mởarea:dictation documentation P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
uttrflow/uttrflow-swift#1180 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100