-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove RuntimeError::raise #2998
Conversation
/// Raises a custom user Error | ||
#[deprecated(since = "2.1.1", note = "return a Result from host functions instead")] | ||
pub fn raise(error: Box<dyn Error + Send + Sync>) -> ! { | ||
unsafe { raise_user_trap(error) } | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good.
let error = Self::user(error); | ||
let js_error: JsValue = error.into(); | ||
wasm_bindgen::throw_val(js_error) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it private
Ok(Ok(result)) => return result.into_c_struct(), | ||
Ok(Err(trap)) => RuntimeError::raise(Box::new(trap)), | ||
Ok(Ok(result)) => HostFunctionResult::Ok(result.into_c_struct()), | ||
Ok(Err(trap)) => HostFunctionResult::Err(trap), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep this code as before
@@ -1000,6 +1000,14 @@ mod inner { | |||
} | |||
} | |||
|
|||
/// C-compatible `Result` with stable layout, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to change this file
Closed in favor of #3003 |
Removes
RuntimeError::raise
(function was already depreceated for a relatively long time).Review