Skip to content

Commit

Permalink
feat(wasm): output panic info to console (#5238)
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz authored Aug 27, 2024
1 parent 30ecbf6 commit 1af7f04
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/oxc_wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ serde = { workspace = true }
wasm-bindgen = { workspace = true }
serde-wasm-bindgen = { workspace = true }
tsify = { workspace = true }
console_error_panic_hook = "0.1.7"
2 changes: 2 additions & 0 deletions crates/oxc_wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ impl Oxc {
source_text: &str,
options: OxcOptions,
) -> Result<(), serde_wasm_bindgen::Error> {
console_error_panic_hook::set_once();

self.diagnostics = RefCell::default();

let OxcOptions {
Expand Down

0 comments on commit 1af7f04

Please sign in to comment.