You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add --panic-unwind flag to build and test commands (#1572)
Adds a new --panic-unwind option to `wasm-pack build` and `wasm-pack test`
that builds with `-Cpanic=unwind` instead of the default `panic=abort`.
When the flag is set, cargo is invoked via `+nightly` with
`-Z build-std=std,panic_unwind` and `RUSTFLAGS` is augmented with
`-Cpanic=unwind` (preserving any user-provided `RUSTFLAGS`). The nightly
toolchain, `rust-src` component, and nightly `wasm32-unknown-unknown`
target are auto-installed via `rustup` if not already present. The stable
rustc and wasm-target preflight checks are skipped when --panic-unwind is
set, since they are irrelevant for the nightly invocation.
This is a build-tool-level enabler: it produces a wasm artifact compiled
with unwinding semantics. The actual conversion of caught panics into
JavaScript exceptions is the responsibility of the consuming bindings layer
(e.g. wasm-bindgen's catch-unwind support).
0 commit comments