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
// Until that issue is fixed, we don't directly use `unwrap_throw()` and instead build our
107
+
// own error message.
108
+
// Convert to `self.into_js().unwrap_throw().into_abi()` when fixed.
109
+
matchself.into_js(){
110
+
Ok(js) => js.into_abi(),
111
+
Err(err) => {
112
+
let loc = core::panic::Location::caller();
113
+
let msg = format!("(Converting type failed) {} ({}:{}:{})", err, loc.file(), loc.line(), loc.column());
114
+
// In theory, `wasm_bindgen::throw_str(&msg)` should work, but the error emitted by `wasm_bindgen::throw_str` cannot be picked up by `#[should_panic(expect = ...)]` in tests, so we use a regular panic.
// Until that issue is fixed, we don't directly use `unwrap_throw()` and instead build our
134
+
// own error message.
135
+
// Convert to `value.into_js().unwrap_throw().into()` when fixed.
136
+
match value.into_js(){
137
+
Ok(js) => js.into(),
138
+
Err(err) => {
139
+
let loc = core::panic::Location::caller();
140
+
let msg = format!("(Converting type failed) {} ({}:{}:{})", err, loc.file(), loc.line(), loc.column());
141
+
// In theory, `wasm_bindgen::throw_str(&msg)` should work, but the error emitted by `wasm_bindgen::throw_str` cannot be picked up by `#[should_panic(expect = ...)]` in tests, so we use a regular panic.
0 commit comments