fix(napi): ThreadsafeFunction with ErrorStrategy::Fatal should throw fatal exception

This commit is contained in:
LongYinan 2021-12-14 00:37:46 +08:00
parent 98791a40e6
commit 91d07810a2
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7
10 changed files with 58 additions and 4 deletions
crates/napi/src

View file

@ -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(