fix(napi): ThreadsafeFunction with ErrorStrategy::Fatal should throw fatal exception
This commit is contained in:
parent
98791a40e6
commit
91d07810a2
10 changed files with 58 additions and 4 deletions
crates/napi/src
|
@ -382,7 +382,7 @@ unsafe extern "C" fn call_js_cb<T: 'static, V: NapiRaw, R, ES>(
|
|||
);
|
||||
}
|
||||
Err(e) if ES::VALUE == ErrorStrategy::Fatal::VALUE => {
|
||||
panic!("{}", e);
|
||||
status = sys::napi_fatal_exception(raw_env, JsError::from(e).into_value(raw_env));
|
||||
}
|
||||
Err(e) => {
|
||||
status = sys::napi_call_function(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue