Skip to content

Commit 9ca7955

Browse files
committed
Always use disabled function for backtrace on wasm
1 parent 5ee44a5 commit 9ca7955

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/std/src/errors/backtrace.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ pub struct BT(Box<dyn Printable>);
1010
impl BT {
1111
#[track_caller]
1212
pub fn capture() -> Self {
13-
BT(Box::new(std::backtrace::Backtrace::capture()))
13+
#[cfg(target_arch = "wasm32")]
14+
return BT(Box::new(std::backtrace::Backtrace::disabled()));
15+
#[cfg(not(target_arch = "wasm32"))]
16+
return BT(Box::new(std::backtrace::Backtrace::capture()));
1417
}
1518
}
1619

0 commit comments

Comments
 (0)