diff --git a/crates/napi/src/js_values/deferred.rs b/crates/napi/src/js_values/deferred.rs index 0e32e812..b4dd4230 100644 --- a/crates/napi/src/js_values/deferred.rs +++ b/crates/napi/src/js_values/deferred.rs @@ -18,6 +18,7 @@ use crate::{NapiRaw, NapiValue}; /// See this issue for more details: /// https://github.com/nodejs/node-addon-api/issues/595 #[repr(transparent)] +#[derive(Clone)] struct DeferredTrace(sys::napi_ref); #[cfg(feature = "deferred_trace")] @@ -94,13 +95,29 @@ struct DeferredData Result> { } pub struct JsDeferred Result> { - tsfn: sys::napi_threadsafe_function, + pub(crate) tsfn: sys::napi_threadsafe_function, #[cfg(feature = "deferred_trace")] trace: DeferredTrace, _data: PhantomData, _resolver: PhantomData, } +// A trick to send the resolver into the `panic` handler +// Do not use clone in the other place besides the `fn execute_tokio_future` +impl Result> Clone + for JsDeferred +{ + fn clone(&self) -> Self { + Self { + tsfn: self.tsfn, + #[cfg(feature = "deferred_trace")] + trace: self.trace.clone(), + _data: PhantomData, + _resolver: PhantomData, + } + } +} + unsafe impl Result> Send for JsDeferred { diff --git a/crates/napi/src/tokio_runtime.rs b/crates/napi/src/tokio_runtime.rs index b612ddb4..b5437781 100644 --- a/crates/napi/src/tokio_runtime.rs +++ b/crates/napi/src/tokio_runtime.rs @@ -3,7 +3,7 @@ use std::{future::Future, marker::PhantomData, sync::RwLock}; use once_cell::sync::{Lazy, OnceCell}; use tokio::runtime::Runtime; -use crate::{sys, JsDeferred, JsUnknown, NapiValue, Result}; +use crate::{sys, Error, JsDeferred, JsUnknown, NapiValue, Result}; fn create_runtime() -> Option { #[cfg(not(target_family = "wasm"))] @@ -158,10 +158,11 @@ pub fn execute_tokio_future< resolver: Resolver, ) -> Result { let (deferred, promise) = JsDeferred::new(env)?; - + #[cfg(not(target_family = "wasm"))] + let deferred_for_panic = deferred.clone(); let sendable_resolver = SendableResolver::new(resolver); - let inner = async { + let inner = async move { match fut.await { Ok(v) => deferred.resolve(move |env| { sendable_resolver @@ -173,7 +174,23 @@ pub fn execute_tokio_future< }; #[cfg(not(target_family = "wasm"))] - spawn(inner); + { + let jh = spawn(inner); + spawn(async move { + if let Err(err) = jh.await { + if let Ok(reason) = err.try_into_panic() { + if let Some(s) = reason.downcast_ref::<&str>() { + deferred_for_panic.reject(Error::new(crate::Status::GenericFailure, s)); + } else { + deferred_for_panic.reject(Error::new( + crate::Status::GenericFailure, + "Panic in async function", + )); + } + } + } + }); + } #[cfg(target_family = "wasm")] { diff --git a/examples/napi/__tests__/__snapshots__/typegen.spec.ts.md b/examples/napi/__tests__/__snapshots__/typegen.spec.ts.md index 1d0ffc52..f67fab42 100644 --- a/examples/napi/__tests__/__snapshots__/typegen.spec.ts.md +++ b/examples/napi/__tests__/__snapshots__/typegen.spec.ts.md @@ -561,6 +561,8 @@ Generated by [AVA](https://avajs.dev). ␊ export function panic(): void␊ ␊ + export function panicInAsync(): Promise␊ + ␊ export function plusOne(this: Width): number␊ ␊ export function promiseInEither(input: number | Promise): Promise␊ diff --git a/examples/napi/__tests__/__snapshots__/typegen.spec.ts.snap b/examples/napi/__tests__/__snapshots__/typegen.spec.ts.snap index 54ed56dc..b768721c 100644 Binary files a/examples/napi/__tests__/__snapshots__/typegen.spec.ts.snap and b/examples/napi/__tests__/__snapshots__/typegen.spec.ts.snap differ diff --git a/examples/napi/__tests__/values.spec.ts b/examples/napi/__tests__/values.spec.ts index 18c74fbb..12c2cc71 100644 --- a/examples/napi/__tests__/values.spec.ts +++ b/examples/napi/__tests__/values.spec.ts @@ -175,6 +175,7 @@ import { createOptionalExternal, getOptionalExternal, mutateOptionalExternal, + panicInAsync, } from '../index.cjs' import { test } from './test.framework.js' @@ -810,6 +811,12 @@ test('async', async (t) => { t.is(name, '@examples/napi') await t.throwsAsync(() => readFileAsync('some_nonexist_path.file')) + + if (!process.env.SKIP_UNWIND_TEST) { + await t.throwsAsync(() => panicInAsync(), { + message: 'panic in async function', + }) + } }) test('async move', async (t) => { diff --git a/examples/napi/example.wasi-browser.js b/examples/napi/example.wasi-browser.js index c988e544..896db5fc 100644 --- a/examples/napi/example.wasi-browser.js +++ b/examples/napi/example.wasi-browser.js @@ -70,331 +70,332 @@ function __napi_rs_initialize_modules(__napiInstance) { __napiInstance.exports['__napi_register__get_nested_num_arr_7']?.() __napiInstance.exports['__napi_register__read_file_async_8']?.() __napiInstance.exports['__napi_register__async_multi_two_9']?.() - __napiInstance.exports['__napi_register__bigint_add_10']?.() - __napiInstance.exports['__napi_register__create_big_int_11']?.() - __napiInstance.exports['__napi_register__create_big_int_i64_12']?.() - __napiInstance.exports['__napi_register__bigint_get_u64_as_string_13']?.() - __napiInstance.exports['__napi_register__bigint_from_i64_14']?.() - __napiInstance.exports['__napi_register__bigint_from_i128_15']?.() - __napiInstance.exports['__napi_register__get_cwd_16']?.() - __napiInstance.exports['__napi_register__option_end_17']?.() - __napiInstance.exports['__napi_register__option_start_18']?.() - __napiInstance.exports['__napi_register__option_start_end_19']?.() - __napiInstance.exports['__napi_register__option_only_20']?.() - __napiInstance.exports['__napi_register__read_file_21']?.() - __napiInstance.exports['__napi_register__return_js_function_22']?.() - __napiInstance.exports['__napi_register__callback_return_promise_23']?.() + __napiInstance.exports['__napi_register__panic_in_async_10']?.() + __napiInstance.exports['__napi_register__bigint_add_11']?.() + __napiInstance.exports['__napi_register__create_big_int_12']?.() + __napiInstance.exports['__napi_register__create_big_int_i64_13']?.() + __napiInstance.exports['__napi_register__bigint_get_u64_as_string_14']?.() + __napiInstance.exports['__napi_register__bigint_from_i64_15']?.() + __napiInstance.exports['__napi_register__bigint_from_i128_16']?.() + __napiInstance.exports['__napi_register__get_cwd_17']?.() + __napiInstance.exports['__napi_register__option_end_18']?.() + __napiInstance.exports['__napi_register__option_start_19']?.() + __napiInstance.exports['__napi_register__option_start_end_20']?.() + __napiInstance.exports['__napi_register__option_only_21']?.() + __napiInstance.exports['__napi_register__read_file_22']?.() + __napiInstance.exports['__napi_register__return_js_function_23']?.() + __napiInstance.exports['__napi_register__callback_return_promise_24']?.() __napiInstance.exports[ - '__napi_register__callback_return_promise_and_spawn_24' + '__napi_register__callback_return_promise_and_spawn_25' ]?.() - __napiInstance.exports['__napi_register__capture_error_in_callback_25']?.() - __napiInstance.exports['__napi_register__Animal_struct_26']?.() - __napiInstance.exports['__napi_register__Animal_impl_38']?.() - __napiInstance.exports['__napi_register__Dog_struct_39']?.() - __napiInstance.exports['__napi_register__Bird_struct_40']?.() - __napiInstance.exports['__napi_register__Bird_impl_45']?.() - __napiInstance.exports['__napi_register__Blake2bHasher_struct_46']?.() - __napiInstance.exports['__napi_register__Blake2bHasher_impl_48']?.() - __napiInstance.exports['__napi_register__Blake2bHasher_impl_50']?.() - __napiInstance.exports['__napi_register__Blake2bKey_struct_51']?.() - __napiInstance.exports['__napi_register__Context_struct_52']?.() - __napiInstance.exports['__napi_register__Context_impl_57']?.() + __napiInstance.exports['__napi_register__capture_error_in_callback_26']?.() + __napiInstance.exports['__napi_register__Animal_struct_27']?.() + __napiInstance.exports['__napi_register__Animal_impl_39']?.() + __napiInstance.exports['__napi_register__Dog_struct_40']?.() + __napiInstance.exports['__napi_register__Bird_struct_41']?.() + __napiInstance.exports['__napi_register__Bird_impl_46']?.() + __napiInstance.exports['__napi_register__Blake2bHasher_struct_47']?.() + __napiInstance.exports['__napi_register__Blake2bHasher_impl_49']?.() + __napiInstance.exports['__napi_register__Blake2bHasher_impl_51']?.() + __napiInstance.exports['__napi_register__Blake2bKey_struct_52']?.() + __napiInstance.exports['__napi_register__Context_struct_53']?.() + __napiInstance.exports['__napi_register__Context_impl_58']?.() __napiInstance.exports[ - '__napi_register__AnimalWithDefaultConstructor_struct_58' + '__napi_register__AnimalWithDefaultConstructor_struct_59' ]?.() - __napiInstance.exports['__napi_register__NinjaTurtle_struct_59']?.() - __napiInstance.exports['__napi_register__NinjaTurtle_impl_66']?.() - __napiInstance.exports['__napi_register__JsAssets_struct_67']?.() - __napiInstance.exports['__napi_register__JsAssets_impl_70']?.() - __napiInstance.exports['__napi_register__JsAsset_struct_71']?.() - __napiInstance.exports['__napi_register__JsAsset_impl_74']?.() - __napiInstance.exports['__napi_register__Optional_struct_75']?.() - __napiInstance.exports['__napi_register__Optional_impl_80']?.() + __napiInstance.exports['__napi_register__NinjaTurtle_struct_60']?.() + __napiInstance.exports['__napi_register__NinjaTurtle_impl_67']?.() + __napiInstance.exports['__napi_register__JsAssets_struct_68']?.() + __napiInstance.exports['__napi_register__JsAssets_impl_71']?.() + __napiInstance.exports['__napi_register__JsAsset_struct_72']?.() + __napiInstance.exports['__napi_register__JsAsset_impl_75']?.() + __napiInstance.exports['__napi_register__Optional_struct_76']?.() + __napiInstance.exports['__napi_register__Optional_impl_81']?.() __napiInstance.exports[ - '__napi_register__ObjectFieldClassInstance_struct_81' + '__napi_register__ObjectFieldClassInstance_struct_82' ]?.() __napiInstance.exports[ - '__napi_register__create_object_with_class_field_82' + '__napi_register__create_object_with_class_field_83' ]?.() __napiInstance.exports[ - '__napi_register__receive_object_with_class_field_83' + '__napi_register__receive_object_with_class_field_84' ]?.() - __napiInstance.exports['__napi_register__NotWritableClass_struct_84']?.() - __napiInstance.exports['__napi_register__NotWritableClass_impl_86']?.() - __napiInstance.exports['__napi_register__CustomFinalize_struct_87']?.() - __napiInstance.exports['__napi_register__CustomFinalize_impl_89']?.() - __napiInstance.exports['__napi_register__Width_struct_90']?.() - __napiInstance.exports['__napi_register__plus_one_91']?.() + __napiInstance.exports['__napi_register__NotWritableClass_struct_85']?.() + __napiInstance.exports['__napi_register__NotWritableClass_impl_87']?.() + __napiInstance.exports['__napi_register__CustomFinalize_struct_88']?.() + __napiInstance.exports['__napi_register__CustomFinalize_impl_90']?.() + __napiInstance.exports['__napi_register__Width_struct_91']?.() + __napiInstance.exports['__napi_register__plus_one_92']?.() __napiInstance.exports[ - '__napi_register__GetterSetterWithClosures_struct_92' + '__napi_register__GetterSetterWithClosures_struct_93' ]?.() __napiInstance.exports[ - '__napi_register__GetterSetterWithClosures_impl_94' + '__napi_register__GetterSetterWithClosures_impl_95' ]?.() - __napiInstance.exports['__napi_register__CatchOnConstructor_struct_95']?.() - __napiInstance.exports['__napi_register__CatchOnConstructor_impl_97']?.() - __napiInstance.exports['__napi_register__CatchOnConstructor2_struct_98']?.() - __napiInstance.exports['__napi_register__CatchOnConstructor2_impl_100']?.() - __napiInstance.exports['__napi_register__ClassWithFactory_struct_101']?.() - __napiInstance.exports['__napi_register__ClassWithFactory_impl_106']?.() - __napiInstance.exports['__napi_register__Selector_struct_107']?.() - __napiInstance.exports['__napi_register__date_to_number_108']?.() - __napiInstance.exports['__napi_register__chrono_date_to_millis_109']?.() - __napiInstance.exports['__napi_register__chrono_date_add_1_minute_110']?.() - __napiInstance.exports['__napi_register__Dates_struct_111']?.() - __napiInstance.exports['__napi_register__chrono_native_date_time_112']?.() + __napiInstance.exports['__napi_register__CatchOnConstructor_struct_96']?.() + __napiInstance.exports['__napi_register__CatchOnConstructor_impl_98']?.() + __napiInstance.exports['__napi_register__CatchOnConstructor2_struct_99']?.() + __napiInstance.exports['__napi_register__CatchOnConstructor2_impl_101']?.() + __napiInstance.exports['__napi_register__ClassWithFactory_struct_102']?.() + __napiInstance.exports['__napi_register__ClassWithFactory_impl_107']?.() + __napiInstance.exports['__napi_register__Selector_struct_108']?.() + __napiInstance.exports['__napi_register__date_to_number_109']?.() + __napiInstance.exports['__napi_register__chrono_date_to_millis_110']?.() + __napiInstance.exports['__napi_register__chrono_date_add_1_minute_111']?.() + __napiInstance.exports['__napi_register__Dates_struct_112']?.() + __napiInstance.exports['__napi_register__chrono_native_date_time_113']?.() __napiInstance.exports[ - '__napi_register__chrono_native_date_time_return_113' + '__napi_register__chrono_native_date_time_return_114' ]?.() - __napiInstance.exports['__napi_register__either_string_or_number_114']?.() - __napiInstance.exports['__napi_register__return_either_115']?.() - __napiInstance.exports['__napi_register__either3_116']?.() - __napiInstance.exports['__napi_register__Obj_struct_117']?.() - __napiInstance.exports['__napi_register__either4_118']?.() - __napiInstance.exports['__napi_register__JsClassForEither_struct_119']?.() - __napiInstance.exports['__napi_register__JsClassForEither_impl_121']?.() + __napiInstance.exports['__napi_register__either_string_or_number_115']?.() + __napiInstance.exports['__napi_register__return_either_116']?.() + __napiInstance.exports['__napi_register__either3_117']?.() + __napiInstance.exports['__napi_register__Obj_struct_118']?.() + __napiInstance.exports['__napi_register__either4_119']?.() + __napiInstance.exports['__napi_register__JsClassForEither_struct_120']?.() + __napiInstance.exports['__napi_register__JsClassForEither_impl_122']?.() __napiInstance.exports[ - '__napi_register__AnotherClassForEither_struct_122' + '__napi_register__AnotherClassForEither_struct_123' ]?.() - __napiInstance.exports['__napi_register__AnotherClassForEither_impl_124']?.() - __napiInstance.exports['__napi_register__receive_class_or_number_125']?.() - __napiInstance.exports['__napi_register__receive_mut_class_or_number_126']?.() - __napiInstance.exports['__napi_register__receive_different_class_127']?.() - __napiInstance.exports['__napi_register__return_either_class_128']?.() - __napiInstance.exports['__napi_register__either_from_option_129']?.() - __napiInstance.exports['__napi_register__A_struct_130']?.() - __napiInstance.exports['__napi_register__B_struct_131']?.() - __napiInstance.exports['__napi_register__C_struct_132']?.() - __napiInstance.exports['__napi_register__either_from_objects_133']?.() - __napiInstance.exports['__napi_register__either_bool_or_function_134']?.() - __napiInstance.exports['__napi_register__promise_in_either_135']?.() - __napiInstance.exports['__napi_register__either_bool_or_tuple_136']?.() - __napiInstance.exports['__napi_register__Kind_137']?.() - __napiInstance.exports['__napi_register__Empty_138']?.() - __napiInstance.exports['__napi_register__Status_139']?.() - __napiInstance.exports['__napi_register__StringEnum_140']?.() - __napiInstance.exports['__napi_register__CustomNumEnum_141']?.() - __napiInstance.exports['__napi_register__enum_to_i32_142']?.() - __napiInstance.exports['__napi_register__SkippedEnums_143']?.() - __napiInstance.exports['__napi_register__run_script_144']?.() - __napiInstance.exports['__napi_register__get_module_file_name_145']?.() - __napiInstance.exports['__napi_register__throw_syntax_error_146']?.() - __napiInstance.exports['__napi_register__throw_error_147']?.() - __napiInstance.exports['__napi_register__panic_148']?.() - __napiInstance.exports['__napi_register__receive_string_149']?.() - __napiInstance.exports['__napi_register__custom_status_code_150']?.() - __napiInstance.exports['__napi_register__throw_async_error_151']?.() - __napiInstance.exports['__napi_register__create_external_152']?.() - __napiInstance.exports['__napi_register__create_external_string_153']?.() - __napiInstance.exports['__napi_register__get_external_154']?.() - __napiInstance.exports['__napi_register__mutate_external_155']?.() - __napiInstance.exports['__napi_register__create_optional_external_156']?.() - __napiInstance.exports['__napi_register__get_optional_external_157']?.() - __napiInstance.exports['__napi_register__mutate_optional_external_158']?.() - __napiInstance.exports['__napi_register__validate_array_159']?.() - __napiInstance.exports['__napi_register__validate_buffer_160']?.() - __napiInstance.exports['__napi_register__validate_typed_array_161']?.() - __napiInstance.exports['__napi_register__validate_typed_array_slice_162']?.() + __napiInstance.exports['__napi_register__AnotherClassForEither_impl_125']?.() + __napiInstance.exports['__napi_register__receive_class_or_number_126']?.() + __napiInstance.exports['__napi_register__receive_mut_class_or_number_127']?.() + __napiInstance.exports['__napi_register__receive_different_class_128']?.() + __napiInstance.exports['__napi_register__return_either_class_129']?.() + __napiInstance.exports['__napi_register__either_from_option_130']?.() + __napiInstance.exports['__napi_register__A_struct_131']?.() + __napiInstance.exports['__napi_register__B_struct_132']?.() + __napiInstance.exports['__napi_register__C_struct_133']?.() + __napiInstance.exports['__napi_register__either_from_objects_134']?.() + __napiInstance.exports['__napi_register__either_bool_or_function_135']?.() + __napiInstance.exports['__napi_register__promise_in_either_136']?.() + __napiInstance.exports['__napi_register__either_bool_or_tuple_137']?.() + __napiInstance.exports['__napi_register__Kind_138']?.() + __napiInstance.exports['__napi_register__Empty_139']?.() + __napiInstance.exports['__napi_register__Status_140']?.() + __napiInstance.exports['__napi_register__StringEnum_141']?.() + __napiInstance.exports['__napi_register__CustomNumEnum_142']?.() + __napiInstance.exports['__napi_register__enum_to_i32_143']?.() + __napiInstance.exports['__napi_register__SkippedEnums_144']?.() + __napiInstance.exports['__napi_register__run_script_145']?.() + __napiInstance.exports['__napi_register__get_module_file_name_146']?.() + __napiInstance.exports['__napi_register__throw_syntax_error_147']?.() + __napiInstance.exports['__napi_register__throw_error_148']?.() + __napiInstance.exports['__napi_register__panic_149']?.() + __napiInstance.exports['__napi_register__receive_string_150']?.() + __napiInstance.exports['__napi_register__custom_status_code_151']?.() + __napiInstance.exports['__napi_register__throw_async_error_152']?.() + __napiInstance.exports['__napi_register__create_external_153']?.() + __napiInstance.exports['__napi_register__create_external_string_154']?.() + __napiInstance.exports['__napi_register__get_external_155']?.() + __napiInstance.exports['__napi_register__mutate_external_156']?.() + __napiInstance.exports['__napi_register__create_optional_external_157']?.() + __napiInstance.exports['__napi_register__get_optional_external_158']?.() + __napiInstance.exports['__napi_register__mutate_optional_external_159']?.() + __napiInstance.exports['__napi_register__validate_array_160']?.() + __napiInstance.exports['__napi_register__validate_buffer_161']?.() + __napiInstance.exports['__napi_register__validate_typed_array_162']?.() + __napiInstance.exports['__napi_register__validate_typed_array_slice_163']?.() __napiInstance.exports[ - '__napi_register__validate_uint8_clamped_slice_163' + '__napi_register__validate_uint8_clamped_slice_164' ]?.() - __napiInstance.exports['__napi_register__validate_buffer_slice_164']?.() - __napiInstance.exports['__napi_register__validate_bigint_165']?.() - __napiInstance.exports['__napi_register__validate_boolean_166']?.() - __napiInstance.exports['__napi_register__validate_date_167']?.() - __napiInstance.exports['__napi_register__validate_date_time_168']?.() - __napiInstance.exports['__napi_register__validate_external_169']?.() - __napiInstance.exports['__napi_register__validate_function_170']?.() - __napiInstance.exports['__napi_register__validate_hash_map_171']?.() - __napiInstance.exports['__napi_register__validate_null_172']?.() - __napiInstance.exports['__napi_register__validate_undefined_173']?.() - __napiInstance.exports['__napi_register__validate_number_174']?.() - __napiInstance.exports['__napi_register__validate_promise_175']?.() - __napiInstance.exports['__napi_register__validate_string_176']?.() - __napiInstance.exports['__napi_register__validate_symbol_177']?.() - __napiInstance.exports['__napi_register__validate_optional_178']?.() - __napiInstance.exports['__napi_register__return_undefined_if_invalid_179']?.() + __napiInstance.exports['__napi_register__validate_buffer_slice_165']?.() + __napiInstance.exports['__napi_register__validate_bigint_166']?.() + __napiInstance.exports['__napi_register__validate_boolean_167']?.() + __napiInstance.exports['__napi_register__validate_date_168']?.() + __napiInstance.exports['__napi_register__validate_date_time_169']?.() + __napiInstance.exports['__napi_register__validate_external_170']?.() + __napiInstance.exports['__napi_register__validate_function_171']?.() + __napiInstance.exports['__napi_register__validate_hash_map_172']?.() + __napiInstance.exports['__napi_register__validate_null_173']?.() + __napiInstance.exports['__napi_register__validate_undefined_174']?.() + __napiInstance.exports['__napi_register__validate_number_175']?.() + __napiInstance.exports['__napi_register__validate_promise_176']?.() + __napiInstance.exports['__napi_register__validate_string_177']?.() + __napiInstance.exports['__napi_register__validate_symbol_178']?.() + __napiInstance.exports['__napi_register__validate_optional_179']?.() + __napiInstance.exports['__napi_register__return_undefined_if_invalid_180']?.() __napiInstance.exports[ - '__napi_register__return_undefined_if_invalid_promise_180' + '__napi_register__return_undefined_if_invalid_promise_181' ]?.() - __napiInstance.exports['__napi_register__ts_rename_181']?.() + __napiInstance.exports['__napi_register__ts_rename_182']?.() __napiInstance.exports[ - '__napi_register__override_individual_arg_on_function_182' + '__napi_register__override_individual_arg_on_function_183' ]?.() __napiInstance.exports[ - '__napi_register__override_individual_arg_on_function_with_cb_arg_183' + '__napi_register__override_individual_arg_on_function_with_cb_arg_184' ]?.() - __napiInstance.exports['__napi_register__call0_184']?.() - __napiInstance.exports['__napi_register__call1_185']?.() - __napiInstance.exports['__napi_register__call2_186']?.() - __napiInstance.exports['__napi_register__apply0_187']?.() - __napiInstance.exports['__napi_register__apply1_188']?.() - __napiInstance.exports['__napi_register__call_function_189']?.() - __napiInstance.exports['__napi_register__call_function_with_arg_190']?.() + __napiInstance.exports['__napi_register__call0_185']?.() + __napiInstance.exports['__napi_register__call1_186']?.() + __napiInstance.exports['__napi_register__call2_187']?.() + __napiInstance.exports['__napi_register__apply0_188']?.() + __napiInstance.exports['__napi_register__apply1_189']?.() + __napiInstance.exports['__napi_register__call_function_190']?.() + __napiInstance.exports['__napi_register__call_function_with_arg_191']?.() __napiInstance.exports[ - '__napi_register__create_reference_on_function_191' + '__napi_register__create_reference_on_function_192' ]?.() __napiInstance.exports[ - '__napi_register__call_function_with_arg_and_ctx_192' + '__napi_register__call_function_with_arg_and_ctx_193' ]?.() - __napiInstance.exports['__napi_register__reference_as_callback_193']?.() + __napiInstance.exports['__napi_register__reference_as_callback_194']?.() __napiInstance.exports[ - '__napi_register__build_threadsafe_function_from_function_194' + '__napi_register__build_threadsafe_function_from_function_195' ]?.() - __napiInstance.exports['__napi_register__Fib_struct_195']?.() - __napiInstance.exports['__napi_register__Fib_impl_196']?.() - __napiInstance.exports['__napi_register__Fib_impl_198']?.() - __napiInstance.exports['__napi_register__Fib2_struct_199']?.() - __napiInstance.exports['__napi_register__Fib2_impl_200']?.() - __napiInstance.exports['__napi_register__Fib2_impl_202']?.() - __napiInstance.exports['__napi_register__Fib3_struct_203']?.() - __napiInstance.exports['__napi_register__Fib3_impl_204']?.() - __napiInstance.exports['__napi_register__ALIGNMENT_205']?.() - __napiInstance.exports['__napi_register__xxh64_206']?.() - __napiInstance.exports['__napi_register__xxh128_207']?.() - __napiInstance.exports['__napi_register__Xxh3_struct_208']?.() - __napiInstance.exports['__napi_register__Xxh3_impl_212']?.() - __napiInstance.exports['__napi_register__xxh2_plus_213']?.() - __napiInstance.exports['__napi_register__xxh3_xxh64_alias_214']?.() - __napiInstance.exports['__napi_register__xxh64_alias_215']?.() - __napiInstance.exports['__napi_register__get_mapping_216']?.() - __napiInstance.exports['__napi_register__sum_mapping_217']?.() - __napiInstance.exports['__napi_register__get_btree_mapping_218']?.() - __napiInstance.exports['__napi_register__sum_btree_mapping_219']?.() - __napiInstance.exports['__napi_register__get_index_mapping_220']?.() - __napiInstance.exports['__napi_register__sum_index_mapping_221']?.() - __napiInstance.exports['__napi_register__indexmap_passthrough_222']?.() - __napiInstance.exports['__napi_register__map_option_223']?.() - __napiInstance.exports['__napi_register__return_null_224']?.() - __napiInstance.exports['__napi_register__return_undefined_225']?.() - __napiInstance.exports['__napi_register__UseNullableStruct_struct_226']?.() - __napiInstance.exports['__napi_register__NotUseNullableStruct_struct_227']?.() + __napiInstance.exports['__napi_register__Fib_struct_196']?.() + __napiInstance.exports['__napi_register__Fib_impl_197']?.() + __napiInstance.exports['__napi_register__Fib_impl_199']?.() + __napiInstance.exports['__napi_register__Fib2_struct_200']?.() + __napiInstance.exports['__napi_register__Fib2_impl_201']?.() + __napiInstance.exports['__napi_register__Fib2_impl_203']?.() + __napiInstance.exports['__napi_register__Fib3_struct_204']?.() + __napiInstance.exports['__napi_register__Fib3_impl_205']?.() + __napiInstance.exports['__napi_register__ALIGNMENT_206']?.() + __napiInstance.exports['__napi_register__xxh64_207']?.() + __napiInstance.exports['__napi_register__xxh128_208']?.() + __napiInstance.exports['__napi_register__Xxh3_struct_209']?.() + __napiInstance.exports['__napi_register__Xxh3_impl_213']?.() + __napiInstance.exports['__napi_register__xxh2_plus_214']?.() + __napiInstance.exports['__napi_register__xxh3_xxh64_alias_215']?.() + __napiInstance.exports['__napi_register__xxh64_alias_216']?.() + __napiInstance.exports['__napi_register__get_mapping_217']?.() + __napiInstance.exports['__napi_register__sum_mapping_218']?.() + __napiInstance.exports['__napi_register__get_btree_mapping_219']?.() + __napiInstance.exports['__napi_register__sum_btree_mapping_220']?.() + __napiInstance.exports['__napi_register__get_index_mapping_221']?.() + __napiInstance.exports['__napi_register__sum_index_mapping_222']?.() + __napiInstance.exports['__napi_register__indexmap_passthrough_223']?.() + __napiInstance.exports['__napi_register__map_option_224']?.() + __napiInstance.exports['__napi_register__return_null_225']?.() + __napiInstance.exports['__napi_register__return_undefined_226']?.() + __napiInstance.exports['__napi_register__UseNullableStruct_struct_227']?.() + __napiInstance.exports['__napi_register__NotUseNullableStruct_struct_228']?.() __napiInstance.exports[ - '__napi_register__DefaultUseNullableStruct_struct_228' + '__napi_register__DefaultUseNullableStruct_struct_229' ]?.() - __napiInstance.exports['__napi_register__UseNullableClass_struct_229']?.() - __napiInstance.exports['__napi_register__NotUseNullableClass_struct_230']?.() + __napiInstance.exports['__napi_register__UseNullableClass_struct_230']?.() + __napiInstance.exports['__napi_register__NotUseNullableClass_struct_231']?.() __napiInstance.exports[ - '__napi_register__DefaultUseNullableClass_struct_231' + '__napi_register__DefaultUseNullableClass_struct_232' ]?.() - __napiInstance.exports['__napi_register__add_232']?.() - __napiInstance.exports['__napi_register__fibonacci_233']?.() - __napiInstance.exports['__napi_register__list_obj_keys_234']?.() - __napiInstance.exports['__napi_register__create_obj_235']?.() - __napiInstance.exports['__napi_register__get_global_236']?.() - __napiInstance.exports['__napi_register__get_undefined_237']?.() - __napiInstance.exports['__napi_register__get_null_238']?.() - __napiInstance.exports['__napi_register__AllOptionalObject_struct_239']?.() - __napiInstance.exports['__napi_register__receive_all_optional_object_240']?.() - __napiInstance.exports['__napi_register__AliasedEnum_241']?.() + __napiInstance.exports['__napi_register__add_233']?.() + __napiInstance.exports['__napi_register__fibonacci_234']?.() + __napiInstance.exports['__napi_register__list_obj_keys_235']?.() + __napiInstance.exports['__napi_register__create_obj_236']?.() + __napiInstance.exports['__napi_register__get_global_237']?.() + __napiInstance.exports['__napi_register__get_undefined_238']?.() + __napiInstance.exports['__napi_register__get_null_239']?.() + __napiInstance.exports['__napi_register__AllOptionalObject_struct_240']?.() + __napiInstance.exports['__napi_register__receive_all_optional_object_241']?.() + __napiInstance.exports['__napi_register__AliasedEnum_242']?.() __napiInstance.exports[ - '__napi_register__StructContainsAliasedEnum_struct_242' + '__napi_register__StructContainsAliasedEnum_struct_243' ]?.() - __napiInstance.exports['__napi_register__fn_received_aliased_243']?.() - __napiInstance.exports['__napi_register__StrictObject_struct_244']?.() - __napiInstance.exports['__napi_register__receive_strict_object_245']?.() - __napiInstance.exports['__napi_register__get_str_from_object_246']?.() - __napiInstance.exports['__napi_register__TsTypeChanged_struct_247']?.() - __napiInstance.exports['__napi_register__create_obj_with_property_248']?.() - __napiInstance.exports['__napi_register__getter_from_obj_249']?.() - __napiInstance.exports['__napi_register__ObjectOnlyFromJs_struct_250']?.() - __napiInstance.exports['__napi_register__receive_object_only_from_js_251']?.() + __napiInstance.exports['__napi_register__fn_received_aliased_244']?.() + __napiInstance.exports['__napi_register__StrictObject_struct_245']?.() + __napiInstance.exports['__napi_register__receive_strict_object_246']?.() + __napiInstance.exports['__napi_register__get_str_from_object_247']?.() + __napiInstance.exports['__napi_register__TsTypeChanged_struct_248']?.() + __napiInstance.exports['__napi_register__create_obj_with_property_249']?.() + __napiInstance.exports['__napi_register__getter_from_obj_250']?.() + __napiInstance.exports['__napi_register__ObjectOnlyFromJs_struct_251']?.() + __napiInstance.exports['__napi_register__receive_object_only_from_js_252']?.() __napiInstance.exports[ - '__napi_register__object_get_named_property_should_perform_typecheck_252' + '__napi_register__object_get_named_property_should_perform_typecheck_253' ]?.() - __napiInstance.exports['__napi_register__ObjectOnlyToJs_struct_253']?.() - __napiInstance.exports['__napi_register__return_object_only_to_js_254']?.() - __napiInstance.exports['__napi_register__async_plus_100_255']?.() - __napiInstance.exports['__napi_register__JsRepo_struct_256']?.() - __napiInstance.exports['__napi_register__JsRepo_impl_259']?.() - __napiInstance.exports['__napi_register__JsRemote_struct_260']?.() - __napiInstance.exports['__napi_register__JsRemote_impl_263']?.() - __napiInstance.exports['__napi_register__CSSRuleList_struct_264']?.() - __napiInstance.exports['__napi_register__CSSRuleList_impl_268']?.() - __napiInstance.exports['__napi_register__CSSStyleSheet_struct_269']?.() - __napiInstance.exports['__napi_register__AnotherCSSStyleSheet_struct_270']?.() - __napiInstance.exports['__napi_register__AnotherCSSStyleSheet_impl_272']?.() - __napiInstance.exports['__napi_register__CSSStyleSheet_impl_276']?.() - __napiInstance.exports['__napi_register__PackageJson_struct_277']?.() - __napiInstance.exports['__napi_register__read_package_json_278']?.() - __napiInstance.exports['__napi_register__get_package_json_name_279']?.() - __napiInstance.exports['__napi_register__test_serde_roundtrip_280']?.() + __napiInstance.exports['__napi_register__ObjectOnlyToJs_struct_254']?.() + __napiInstance.exports['__napi_register__return_object_only_to_js_255']?.() + __napiInstance.exports['__napi_register__async_plus_100_256']?.() + __napiInstance.exports['__napi_register__JsRepo_struct_257']?.() + __napiInstance.exports['__napi_register__JsRepo_impl_260']?.() + __napiInstance.exports['__napi_register__JsRemote_struct_261']?.() + __napiInstance.exports['__napi_register__JsRemote_impl_264']?.() + __napiInstance.exports['__napi_register__CSSRuleList_struct_265']?.() + __napiInstance.exports['__napi_register__CSSRuleList_impl_269']?.() + __napiInstance.exports['__napi_register__CSSStyleSheet_struct_270']?.() + __napiInstance.exports['__napi_register__AnotherCSSStyleSheet_struct_271']?.() + __napiInstance.exports['__napi_register__AnotherCSSStyleSheet_impl_273']?.() + __napiInstance.exports['__napi_register__CSSStyleSheet_impl_277']?.() + __napiInstance.exports['__napi_register__PackageJson_struct_278']?.() + __napiInstance.exports['__napi_register__read_package_json_279']?.() + __napiInstance.exports['__napi_register__get_package_json_name_280']?.() + __napiInstance.exports['__napi_register__test_serde_roundtrip_281']?.() __napiInstance.exports[ - '__napi_register__test_serde_big_number_precision_281' + '__napi_register__test_serde_big_number_precision_282' ]?.() - __napiInstance.exports['__napi_register__return_from_shared_crate_282']?.() - __napiInstance.exports['__napi_register__contains_283']?.() - __napiInstance.exports['__napi_register__concat_str_284']?.() - __napiInstance.exports['__napi_register__concat_utf16_285']?.() - __napiInstance.exports['__napi_register__concat_latin1_286']?.() - __napiInstance.exports['__napi_register__roundtrip_str_287']?.() - __napiInstance.exports['__napi_register__set_symbol_in_obj_288']?.() - __napiInstance.exports['__napi_register__create_symbol_289']?.() - __napiInstance.exports['__napi_register__create_symbol_for_290']?.() - __napiInstance.exports['__napi_register__DelaySum_impl_291']?.() - __napiInstance.exports['__napi_register__without_abort_controller_292']?.() - __napiInstance.exports['__napi_register__with_abort_controller_293']?.() - __napiInstance.exports['__napi_register__AsyncTaskVoidReturn_impl_294']?.() - __napiInstance.exports['__napi_register__async_task_void_return_295']?.() + __napiInstance.exports['__napi_register__return_from_shared_crate_283']?.() + __napiInstance.exports['__napi_register__contains_284']?.() + __napiInstance.exports['__napi_register__concat_str_285']?.() + __napiInstance.exports['__napi_register__concat_utf16_286']?.() + __napiInstance.exports['__napi_register__concat_latin1_287']?.() + __napiInstance.exports['__napi_register__roundtrip_str_288']?.() + __napiInstance.exports['__napi_register__set_symbol_in_obj_289']?.() + __napiInstance.exports['__napi_register__create_symbol_290']?.() + __napiInstance.exports['__napi_register__create_symbol_for_291']?.() + __napiInstance.exports['__napi_register__DelaySum_impl_292']?.() + __napiInstance.exports['__napi_register__without_abort_controller_293']?.() + __napiInstance.exports['__napi_register__with_abort_controller_294']?.() + __napiInstance.exports['__napi_register__AsyncTaskVoidReturn_impl_295']?.() + __napiInstance.exports['__napi_register__async_task_void_return_296']?.() __napiInstance.exports[ - '__napi_register__AsyncTaskOptionalReturn_impl_296' + '__napi_register__AsyncTaskOptionalReturn_impl_297' ]?.() - __napiInstance.exports['__napi_register__async_task_optional_return_297']?.() - __napiInstance.exports['__napi_register__call_threadsafe_function_298']?.() + __napiInstance.exports['__napi_register__async_task_optional_return_298']?.() + __napiInstance.exports['__napi_register__call_threadsafe_function_299']?.() __napiInstance.exports[ - '__napi_register__call_long_threadsafe_function_299' + '__napi_register__call_long_threadsafe_function_300' ]?.() __napiInstance.exports[ - '__napi_register__threadsafe_function_throw_error_300' + '__napi_register__threadsafe_function_throw_error_301' ]?.() __napiInstance.exports[ - '__napi_register__threadsafe_function_fatal_mode_301' + '__napi_register__threadsafe_function_fatal_mode_302' ]?.() __napiInstance.exports[ - '__napi_register__threadsafe_function_fatal_mode_error_302' + '__napi_register__threadsafe_function_fatal_mode_error_303' ]?.() __napiInstance.exports[ - '__napi_register__threadsafe_function_closure_capture_303' + '__napi_register__threadsafe_function_closure_capture_304' ]?.() - __napiInstance.exports['__napi_register__tsfn_call_with_callback_304']?.() - __napiInstance.exports['__napi_register__tsfn_async_call_305']?.() - __napiInstance.exports['__napi_register__accept_threadsafe_function_306']?.() + __napiInstance.exports['__napi_register__tsfn_call_with_callback_305']?.() + __napiInstance.exports['__napi_register__tsfn_async_call_306']?.() + __napiInstance.exports['__napi_register__accept_threadsafe_function_307']?.() __napiInstance.exports[ - '__napi_register__accept_threadsafe_function_fatal_307' + '__napi_register__accept_threadsafe_function_fatal_308' ]?.() __napiInstance.exports[ - '__napi_register__accept_threadsafe_function_tuple_args_308' + '__napi_register__accept_threadsafe_function_tuple_args_309' ]?.() - __napiInstance.exports['__napi_register__tsfn_return_promise_309']?.() - __napiInstance.exports['__napi_register__tsfn_return_promise_timeout_310']?.() - __napiInstance.exports['__napi_register__tsfn_throw_from_js_311']?.() - __napiInstance.exports['__napi_register__get_buffer_312']?.() - __napiInstance.exports['__napi_register__append_buffer_313']?.() - __napiInstance.exports['__napi_register__get_empty_buffer_314']?.() - __napiInstance.exports['__napi_register__convert_u32_array_315']?.() - __napiInstance.exports['__napi_register__create_external_typed_array_316']?.() - __napiInstance.exports['__napi_register__mutate_typed_array_317']?.() - __napiInstance.exports['__napi_register__deref_uint8_array_318']?.() - __napiInstance.exports['__napi_register__buffer_pass_through_319']?.() - __napiInstance.exports['__napi_register__array_buffer_pass_through_320']?.() - __napiInstance.exports['__napi_register__accept_slice_321']?.() - __napiInstance.exports['__napi_register__u8_array_to_array_322']?.() - __napiInstance.exports['__napi_register__i8_array_to_array_323']?.() - __napiInstance.exports['__napi_register__u16_array_to_array_324']?.() - __napiInstance.exports['__napi_register__i16_array_to_array_325']?.() - __napiInstance.exports['__napi_register__u32_array_to_array_326']?.() - __napiInstance.exports['__napi_register__i32_array_to_array_327']?.() - __napiInstance.exports['__napi_register__f32_array_to_array_328']?.() - __napiInstance.exports['__napi_register__f64_array_to_array_329']?.() - __napiInstance.exports['__napi_register__u64_array_to_array_330']?.() - __napiInstance.exports['__napi_register__i64_array_to_array_331']?.() - __napiInstance.exports['__napi_register__accept_uint8_clamped_slice_332']?.() + __napiInstance.exports['__napi_register__tsfn_return_promise_310']?.() + __napiInstance.exports['__napi_register__tsfn_return_promise_timeout_311']?.() + __napiInstance.exports['__napi_register__tsfn_throw_from_js_312']?.() + __napiInstance.exports['__napi_register__get_buffer_313']?.() + __napiInstance.exports['__napi_register__append_buffer_314']?.() + __napiInstance.exports['__napi_register__get_empty_buffer_315']?.() + __napiInstance.exports['__napi_register__convert_u32_array_316']?.() + __napiInstance.exports['__napi_register__create_external_typed_array_317']?.() + __napiInstance.exports['__napi_register__mutate_typed_array_318']?.() + __napiInstance.exports['__napi_register__deref_uint8_array_319']?.() + __napiInstance.exports['__napi_register__buffer_pass_through_320']?.() + __napiInstance.exports['__napi_register__array_buffer_pass_through_321']?.() + __napiInstance.exports['__napi_register__accept_slice_322']?.() + __napiInstance.exports['__napi_register__u8_array_to_array_323']?.() + __napiInstance.exports['__napi_register__i8_array_to_array_324']?.() + __napiInstance.exports['__napi_register__u16_array_to_array_325']?.() + __napiInstance.exports['__napi_register__i16_array_to_array_326']?.() + __napiInstance.exports['__napi_register__u32_array_to_array_327']?.() + __napiInstance.exports['__napi_register__i32_array_to_array_328']?.() + __napiInstance.exports['__napi_register__f32_array_to_array_329']?.() + __napiInstance.exports['__napi_register__f64_array_to_array_330']?.() + __napiInstance.exports['__napi_register__u64_array_to_array_331']?.() + __napiInstance.exports['__napi_register__i64_array_to_array_332']?.() + __napiInstance.exports['__napi_register__accept_uint8_clamped_slice_333']?.() __napiInstance.exports[ - '__napi_register__accept_uint8_clamped_slice_and_buffer_slice_333' + '__napi_register__accept_uint8_clamped_slice_and_buffer_slice_334' ]?.() - __napiInstance.exports['__napi_register__AsyncBuffer_impl_334']?.() - __napiInstance.exports['__napi_register__async_reduce_buffer_335']?.() - __napiInstance.exports['__napi_register__async_buffer_to_array_336']?.() + __napiInstance.exports['__napi_register__AsyncBuffer_impl_335']?.() + __napiInstance.exports['__napi_register__async_reduce_buffer_336']?.() + __napiInstance.exports['__napi_register__async_buffer_to_array_337']?.() } export const Animal = __napiModule.exports.Animal export const AnimalWithDefaultConstructor = @@ -573,6 +574,7 @@ export const overrideIndividualArgOnFunction = export const overrideIndividualArgOnFunctionWithCbArg = __napiModule.exports.overrideIndividualArgOnFunctionWithCbArg export const panic = __napiModule.exports.panic +export const panicInAsync = __napiModule.exports.panicInAsync export const plusOne = __napiModule.exports.plusOne export const promiseInEither = __napiModule.exports.promiseInEither export const readFile = __napiModule.exports.readFile diff --git a/examples/napi/example.wasi.cjs b/examples/napi/example.wasi.cjs index 9ccef9bc..a9e658e9 100644 --- a/examples/napi/example.wasi.cjs +++ b/examples/napi/example.wasi.cjs @@ -86,271 +86,272 @@ function __napi_rs_initialize_modules(__napiInstance) { __napiInstance.exports['__napi_register__get_nested_num_arr_7']?.() __napiInstance.exports['__napi_register__read_file_async_8']?.() __napiInstance.exports['__napi_register__async_multi_two_9']?.() - __napiInstance.exports['__napi_register__bigint_add_10']?.() - __napiInstance.exports['__napi_register__create_big_int_11']?.() - __napiInstance.exports['__napi_register__create_big_int_i64_12']?.() - __napiInstance.exports['__napi_register__bigint_get_u64_as_string_13']?.() - __napiInstance.exports['__napi_register__bigint_from_i64_14']?.() - __napiInstance.exports['__napi_register__bigint_from_i128_15']?.() - __napiInstance.exports['__napi_register__get_cwd_16']?.() - __napiInstance.exports['__napi_register__option_end_17']?.() - __napiInstance.exports['__napi_register__option_start_18']?.() - __napiInstance.exports['__napi_register__option_start_end_19']?.() - __napiInstance.exports['__napi_register__option_only_20']?.() - __napiInstance.exports['__napi_register__read_file_21']?.() - __napiInstance.exports['__napi_register__return_js_function_22']?.() - __napiInstance.exports['__napi_register__callback_return_promise_23']?.() - __napiInstance.exports['__napi_register__callback_return_promise_and_spawn_24']?.() - __napiInstance.exports['__napi_register__capture_error_in_callback_25']?.() - __napiInstance.exports['__napi_register__Animal_struct_26']?.() - __napiInstance.exports['__napi_register__Animal_impl_38']?.() - __napiInstance.exports['__napi_register__Dog_struct_39']?.() - __napiInstance.exports['__napi_register__Bird_struct_40']?.() - __napiInstance.exports['__napi_register__Bird_impl_45']?.() - __napiInstance.exports['__napi_register__Blake2bHasher_struct_46']?.() - __napiInstance.exports['__napi_register__Blake2bHasher_impl_48']?.() - __napiInstance.exports['__napi_register__Blake2bHasher_impl_50']?.() - __napiInstance.exports['__napi_register__Blake2bKey_struct_51']?.() - __napiInstance.exports['__napi_register__Context_struct_52']?.() - __napiInstance.exports['__napi_register__Context_impl_57']?.() - __napiInstance.exports['__napi_register__AnimalWithDefaultConstructor_struct_58']?.() - __napiInstance.exports['__napi_register__NinjaTurtle_struct_59']?.() - __napiInstance.exports['__napi_register__NinjaTurtle_impl_66']?.() - __napiInstance.exports['__napi_register__JsAssets_struct_67']?.() - __napiInstance.exports['__napi_register__JsAssets_impl_70']?.() - __napiInstance.exports['__napi_register__JsAsset_struct_71']?.() - __napiInstance.exports['__napi_register__JsAsset_impl_74']?.() - __napiInstance.exports['__napi_register__Optional_struct_75']?.() - __napiInstance.exports['__napi_register__Optional_impl_80']?.() - __napiInstance.exports['__napi_register__ObjectFieldClassInstance_struct_81']?.() - __napiInstance.exports['__napi_register__create_object_with_class_field_82']?.() - __napiInstance.exports['__napi_register__receive_object_with_class_field_83']?.() - __napiInstance.exports['__napi_register__NotWritableClass_struct_84']?.() - __napiInstance.exports['__napi_register__NotWritableClass_impl_86']?.() - __napiInstance.exports['__napi_register__CustomFinalize_struct_87']?.() - __napiInstance.exports['__napi_register__CustomFinalize_impl_89']?.() - __napiInstance.exports['__napi_register__Width_struct_90']?.() - __napiInstance.exports['__napi_register__plus_one_91']?.() - __napiInstance.exports['__napi_register__GetterSetterWithClosures_struct_92']?.() - __napiInstance.exports['__napi_register__GetterSetterWithClosures_impl_94']?.() - __napiInstance.exports['__napi_register__CatchOnConstructor_struct_95']?.() - __napiInstance.exports['__napi_register__CatchOnConstructor_impl_97']?.() - __napiInstance.exports['__napi_register__CatchOnConstructor2_struct_98']?.() - __napiInstance.exports['__napi_register__CatchOnConstructor2_impl_100']?.() - __napiInstance.exports['__napi_register__ClassWithFactory_struct_101']?.() - __napiInstance.exports['__napi_register__ClassWithFactory_impl_106']?.() - __napiInstance.exports['__napi_register__Selector_struct_107']?.() - __napiInstance.exports['__napi_register__date_to_number_108']?.() - __napiInstance.exports['__napi_register__chrono_date_to_millis_109']?.() - __napiInstance.exports['__napi_register__chrono_date_add_1_minute_110']?.() - __napiInstance.exports['__napi_register__Dates_struct_111']?.() - __napiInstance.exports['__napi_register__chrono_native_date_time_112']?.() - __napiInstance.exports['__napi_register__chrono_native_date_time_return_113']?.() - __napiInstance.exports['__napi_register__either_string_or_number_114']?.() - __napiInstance.exports['__napi_register__return_either_115']?.() - __napiInstance.exports['__napi_register__either3_116']?.() - __napiInstance.exports['__napi_register__Obj_struct_117']?.() - __napiInstance.exports['__napi_register__either4_118']?.() - __napiInstance.exports['__napi_register__JsClassForEither_struct_119']?.() - __napiInstance.exports['__napi_register__JsClassForEither_impl_121']?.() - __napiInstance.exports['__napi_register__AnotherClassForEither_struct_122']?.() - __napiInstance.exports['__napi_register__AnotherClassForEither_impl_124']?.() - __napiInstance.exports['__napi_register__receive_class_or_number_125']?.() - __napiInstance.exports['__napi_register__receive_mut_class_or_number_126']?.() - __napiInstance.exports['__napi_register__receive_different_class_127']?.() - __napiInstance.exports['__napi_register__return_either_class_128']?.() - __napiInstance.exports['__napi_register__either_from_option_129']?.() - __napiInstance.exports['__napi_register__A_struct_130']?.() - __napiInstance.exports['__napi_register__B_struct_131']?.() - __napiInstance.exports['__napi_register__C_struct_132']?.() - __napiInstance.exports['__napi_register__either_from_objects_133']?.() - __napiInstance.exports['__napi_register__either_bool_or_function_134']?.() - __napiInstance.exports['__napi_register__promise_in_either_135']?.() - __napiInstance.exports['__napi_register__either_bool_or_tuple_136']?.() - __napiInstance.exports['__napi_register__Kind_137']?.() - __napiInstance.exports['__napi_register__Empty_138']?.() - __napiInstance.exports['__napi_register__Status_139']?.() - __napiInstance.exports['__napi_register__StringEnum_140']?.() - __napiInstance.exports['__napi_register__CustomNumEnum_141']?.() - __napiInstance.exports['__napi_register__enum_to_i32_142']?.() - __napiInstance.exports['__napi_register__SkippedEnums_143']?.() - __napiInstance.exports['__napi_register__run_script_144']?.() - __napiInstance.exports['__napi_register__get_module_file_name_145']?.() - __napiInstance.exports['__napi_register__throw_syntax_error_146']?.() - __napiInstance.exports['__napi_register__throw_error_147']?.() - __napiInstance.exports['__napi_register__panic_148']?.() - __napiInstance.exports['__napi_register__receive_string_149']?.() - __napiInstance.exports['__napi_register__custom_status_code_150']?.() - __napiInstance.exports['__napi_register__throw_async_error_151']?.() - __napiInstance.exports['__napi_register__create_external_152']?.() - __napiInstance.exports['__napi_register__create_external_string_153']?.() - __napiInstance.exports['__napi_register__get_external_154']?.() - __napiInstance.exports['__napi_register__mutate_external_155']?.() - __napiInstance.exports['__napi_register__create_optional_external_156']?.() - __napiInstance.exports['__napi_register__get_optional_external_157']?.() - __napiInstance.exports['__napi_register__mutate_optional_external_158']?.() - __napiInstance.exports['__napi_register__validate_array_159']?.() - __napiInstance.exports['__napi_register__validate_buffer_160']?.() - __napiInstance.exports['__napi_register__validate_typed_array_161']?.() - __napiInstance.exports['__napi_register__validate_typed_array_slice_162']?.() - __napiInstance.exports['__napi_register__validate_uint8_clamped_slice_163']?.() - __napiInstance.exports['__napi_register__validate_buffer_slice_164']?.() - __napiInstance.exports['__napi_register__validate_bigint_165']?.() - __napiInstance.exports['__napi_register__validate_boolean_166']?.() - __napiInstance.exports['__napi_register__validate_date_167']?.() - __napiInstance.exports['__napi_register__validate_date_time_168']?.() - __napiInstance.exports['__napi_register__validate_external_169']?.() - __napiInstance.exports['__napi_register__validate_function_170']?.() - __napiInstance.exports['__napi_register__validate_hash_map_171']?.() - __napiInstance.exports['__napi_register__validate_null_172']?.() - __napiInstance.exports['__napi_register__validate_undefined_173']?.() - __napiInstance.exports['__napi_register__validate_number_174']?.() - __napiInstance.exports['__napi_register__validate_promise_175']?.() - __napiInstance.exports['__napi_register__validate_string_176']?.() - __napiInstance.exports['__napi_register__validate_symbol_177']?.() - __napiInstance.exports['__napi_register__validate_optional_178']?.() - __napiInstance.exports['__napi_register__return_undefined_if_invalid_179']?.() - __napiInstance.exports['__napi_register__return_undefined_if_invalid_promise_180']?.() - __napiInstance.exports['__napi_register__ts_rename_181']?.() - __napiInstance.exports['__napi_register__override_individual_arg_on_function_182']?.() - __napiInstance.exports['__napi_register__override_individual_arg_on_function_with_cb_arg_183']?.() - __napiInstance.exports['__napi_register__call0_184']?.() - __napiInstance.exports['__napi_register__call1_185']?.() - __napiInstance.exports['__napi_register__call2_186']?.() - __napiInstance.exports['__napi_register__apply0_187']?.() - __napiInstance.exports['__napi_register__apply1_188']?.() - __napiInstance.exports['__napi_register__call_function_189']?.() - __napiInstance.exports['__napi_register__call_function_with_arg_190']?.() - __napiInstance.exports['__napi_register__create_reference_on_function_191']?.() - __napiInstance.exports['__napi_register__call_function_with_arg_and_ctx_192']?.() - __napiInstance.exports['__napi_register__reference_as_callback_193']?.() - __napiInstance.exports['__napi_register__build_threadsafe_function_from_function_194']?.() - __napiInstance.exports['__napi_register__Fib_struct_195']?.() - __napiInstance.exports['__napi_register__Fib_impl_196']?.() - __napiInstance.exports['__napi_register__Fib_impl_198']?.() - __napiInstance.exports['__napi_register__Fib2_struct_199']?.() - __napiInstance.exports['__napi_register__Fib2_impl_200']?.() - __napiInstance.exports['__napi_register__Fib2_impl_202']?.() - __napiInstance.exports['__napi_register__Fib3_struct_203']?.() - __napiInstance.exports['__napi_register__Fib3_impl_204']?.() - __napiInstance.exports['__napi_register__ALIGNMENT_205']?.() - __napiInstance.exports['__napi_register__xxh64_206']?.() - __napiInstance.exports['__napi_register__xxh128_207']?.() - __napiInstance.exports['__napi_register__Xxh3_struct_208']?.() - __napiInstance.exports['__napi_register__Xxh3_impl_212']?.() - __napiInstance.exports['__napi_register__xxh2_plus_213']?.() - __napiInstance.exports['__napi_register__xxh3_xxh64_alias_214']?.() - __napiInstance.exports['__napi_register__xxh64_alias_215']?.() - __napiInstance.exports['__napi_register__get_mapping_216']?.() - __napiInstance.exports['__napi_register__sum_mapping_217']?.() - __napiInstance.exports['__napi_register__get_btree_mapping_218']?.() - __napiInstance.exports['__napi_register__sum_btree_mapping_219']?.() - __napiInstance.exports['__napi_register__get_index_mapping_220']?.() - __napiInstance.exports['__napi_register__sum_index_mapping_221']?.() - __napiInstance.exports['__napi_register__indexmap_passthrough_222']?.() - __napiInstance.exports['__napi_register__map_option_223']?.() - __napiInstance.exports['__napi_register__return_null_224']?.() - __napiInstance.exports['__napi_register__return_undefined_225']?.() - __napiInstance.exports['__napi_register__UseNullableStruct_struct_226']?.() - __napiInstance.exports['__napi_register__NotUseNullableStruct_struct_227']?.() - __napiInstance.exports['__napi_register__DefaultUseNullableStruct_struct_228']?.() - __napiInstance.exports['__napi_register__UseNullableClass_struct_229']?.() - __napiInstance.exports['__napi_register__NotUseNullableClass_struct_230']?.() - __napiInstance.exports['__napi_register__DefaultUseNullableClass_struct_231']?.() - __napiInstance.exports['__napi_register__add_232']?.() - __napiInstance.exports['__napi_register__fibonacci_233']?.() - __napiInstance.exports['__napi_register__list_obj_keys_234']?.() - __napiInstance.exports['__napi_register__create_obj_235']?.() - __napiInstance.exports['__napi_register__get_global_236']?.() - __napiInstance.exports['__napi_register__get_undefined_237']?.() - __napiInstance.exports['__napi_register__get_null_238']?.() - __napiInstance.exports['__napi_register__AllOptionalObject_struct_239']?.() - __napiInstance.exports['__napi_register__receive_all_optional_object_240']?.() - __napiInstance.exports['__napi_register__AliasedEnum_241']?.() - __napiInstance.exports['__napi_register__StructContainsAliasedEnum_struct_242']?.() - __napiInstance.exports['__napi_register__fn_received_aliased_243']?.() - __napiInstance.exports['__napi_register__StrictObject_struct_244']?.() - __napiInstance.exports['__napi_register__receive_strict_object_245']?.() - __napiInstance.exports['__napi_register__get_str_from_object_246']?.() - __napiInstance.exports['__napi_register__TsTypeChanged_struct_247']?.() - __napiInstance.exports['__napi_register__create_obj_with_property_248']?.() - __napiInstance.exports['__napi_register__getter_from_obj_249']?.() - __napiInstance.exports['__napi_register__ObjectOnlyFromJs_struct_250']?.() - __napiInstance.exports['__napi_register__receive_object_only_from_js_251']?.() - __napiInstance.exports['__napi_register__object_get_named_property_should_perform_typecheck_252']?.() - __napiInstance.exports['__napi_register__ObjectOnlyToJs_struct_253']?.() - __napiInstance.exports['__napi_register__return_object_only_to_js_254']?.() - __napiInstance.exports['__napi_register__async_plus_100_255']?.() - __napiInstance.exports['__napi_register__JsRepo_struct_256']?.() - __napiInstance.exports['__napi_register__JsRepo_impl_259']?.() - __napiInstance.exports['__napi_register__JsRemote_struct_260']?.() - __napiInstance.exports['__napi_register__JsRemote_impl_263']?.() - __napiInstance.exports['__napi_register__CSSRuleList_struct_264']?.() - __napiInstance.exports['__napi_register__CSSRuleList_impl_268']?.() - __napiInstance.exports['__napi_register__CSSStyleSheet_struct_269']?.() - __napiInstance.exports['__napi_register__AnotherCSSStyleSheet_struct_270']?.() - __napiInstance.exports['__napi_register__AnotherCSSStyleSheet_impl_272']?.() - __napiInstance.exports['__napi_register__CSSStyleSheet_impl_276']?.() - __napiInstance.exports['__napi_register__PackageJson_struct_277']?.() - __napiInstance.exports['__napi_register__read_package_json_278']?.() - __napiInstance.exports['__napi_register__get_package_json_name_279']?.() - __napiInstance.exports['__napi_register__test_serde_roundtrip_280']?.() - __napiInstance.exports['__napi_register__test_serde_big_number_precision_281']?.() - __napiInstance.exports['__napi_register__return_from_shared_crate_282']?.() - __napiInstance.exports['__napi_register__contains_283']?.() - __napiInstance.exports['__napi_register__concat_str_284']?.() - __napiInstance.exports['__napi_register__concat_utf16_285']?.() - __napiInstance.exports['__napi_register__concat_latin1_286']?.() - __napiInstance.exports['__napi_register__roundtrip_str_287']?.() - __napiInstance.exports['__napi_register__set_symbol_in_obj_288']?.() - __napiInstance.exports['__napi_register__create_symbol_289']?.() - __napiInstance.exports['__napi_register__create_symbol_for_290']?.() - __napiInstance.exports['__napi_register__DelaySum_impl_291']?.() - __napiInstance.exports['__napi_register__without_abort_controller_292']?.() - __napiInstance.exports['__napi_register__with_abort_controller_293']?.() - __napiInstance.exports['__napi_register__AsyncTaskVoidReturn_impl_294']?.() - __napiInstance.exports['__napi_register__async_task_void_return_295']?.() - __napiInstance.exports['__napi_register__AsyncTaskOptionalReturn_impl_296']?.() - __napiInstance.exports['__napi_register__async_task_optional_return_297']?.() - __napiInstance.exports['__napi_register__call_threadsafe_function_298']?.() - __napiInstance.exports['__napi_register__call_long_threadsafe_function_299']?.() - __napiInstance.exports['__napi_register__threadsafe_function_throw_error_300']?.() - __napiInstance.exports['__napi_register__threadsafe_function_fatal_mode_301']?.() - __napiInstance.exports['__napi_register__threadsafe_function_fatal_mode_error_302']?.() - __napiInstance.exports['__napi_register__threadsafe_function_closure_capture_303']?.() - __napiInstance.exports['__napi_register__tsfn_call_with_callback_304']?.() - __napiInstance.exports['__napi_register__tsfn_async_call_305']?.() - __napiInstance.exports['__napi_register__accept_threadsafe_function_306']?.() - __napiInstance.exports['__napi_register__accept_threadsafe_function_fatal_307']?.() - __napiInstance.exports['__napi_register__accept_threadsafe_function_tuple_args_308']?.() - __napiInstance.exports['__napi_register__tsfn_return_promise_309']?.() - __napiInstance.exports['__napi_register__tsfn_return_promise_timeout_310']?.() - __napiInstance.exports['__napi_register__tsfn_throw_from_js_311']?.() - __napiInstance.exports['__napi_register__get_buffer_312']?.() - __napiInstance.exports['__napi_register__append_buffer_313']?.() - __napiInstance.exports['__napi_register__get_empty_buffer_314']?.() - __napiInstance.exports['__napi_register__convert_u32_array_315']?.() - __napiInstance.exports['__napi_register__create_external_typed_array_316']?.() - __napiInstance.exports['__napi_register__mutate_typed_array_317']?.() - __napiInstance.exports['__napi_register__deref_uint8_array_318']?.() - __napiInstance.exports['__napi_register__buffer_pass_through_319']?.() - __napiInstance.exports['__napi_register__array_buffer_pass_through_320']?.() - __napiInstance.exports['__napi_register__accept_slice_321']?.() - __napiInstance.exports['__napi_register__u8_array_to_array_322']?.() - __napiInstance.exports['__napi_register__i8_array_to_array_323']?.() - __napiInstance.exports['__napi_register__u16_array_to_array_324']?.() - __napiInstance.exports['__napi_register__i16_array_to_array_325']?.() - __napiInstance.exports['__napi_register__u32_array_to_array_326']?.() - __napiInstance.exports['__napi_register__i32_array_to_array_327']?.() - __napiInstance.exports['__napi_register__f32_array_to_array_328']?.() - __napiInstance.exports['__napi_register__f64_array_to_array_329']?.() - __napiInstance.exports['__napi_register__u64_array_to_array_330']?.() - __napiInstance.exports['__napi_register__i64_array_to_array_331']?.() - __napiInstance.exports['__napi_register__accept_uint8_clamped_slice_332']?.() - __napiInstance.exports['__napi_register__accept_uint8_clamped_slice_and_buffer_slice_333']?.() - __napiInstance.exports['__napi_register__AsyncBuffer_impl_334']?.() - __napiInstance.exports['__napi_register__async_reduce_buffer_335']?.() - __napiInstance.exports['__napi_register__async_buffer_to_array_336']?.() + __napiInstance.exports['__napi_register__panic_in_async_10']?.() + __napiInstance.exports['__napi_register__bigint_add_11']?.() + __napiInstance.exports['__napi_register__create_big_int_12']?.() + __napiInstance.exports['__napi_register__create_big_int_i64_13']?.() + __napiInstance.exports['__napi_register__bigint_get_u64_as_string_14']?.() + __napiInstance.exports['__napi_register__bigint_from_i64_15']?.() + __napiInstance.exports['__napi_register__bigint_from_i128_16']?.() + __napiInstance.exports['__napi_register__get_cwd_17']?.() + __napiInstance.exports['__napi_register__option_end_18']?.() + __napiInstance.exports['__napi_register__option_start_19']?.() + __napiInstance.exports['__napi_register__option_start_end_20']?.() + __napiInstance.exports['__napi_register__option_only_21']?.() + __napiInstance.exports['__napi_register__read_file_22']?.() + __napiInstance.exports['__napi_register__return_js_function_23']?.() + __napiInstance.exports['__napi_register__callback_return_promise_24']?.() + __napiInstance.exports['__napi_register__callback_return_promise_and_spawn_25']?.() + __napiInstance.exports['__napi_register__capture_error_in_callback_26']?.() + __napiInstance.exports['__napi_register__Animal_struct_27']?.() + __napiInstance.exports['__napi_register__Animal_impl_39']?.() + __napiInstance.exports['__napi_register__Dog_struct_40']?.() + __napiInstance.exports['__napi_register__Bird_struct_41']?.() + __napiInstance.exports['__napi_register__Bird_impl_46']?.() + __napiInstance.exports['__napi_register__Blake2bHasher_struct_47']?.() + __napiInstance.exports['__napi_register__Blake2bHasher_impl_49']?.() + __napiInstance.exports['__napi_register__Blake2bHasher_impl_51']?.() + __napiInstance.exports['__napi_register__Blake2bKey_struct_52']?.() + __napiInstance.exports['__napi_register__Context_struct_53']?.() + __napiInstance.exports['__napi_register__Context_impl_58']?.() + __napiInstance.exports['__napi_register__AnimalWithDefaultConstructor_struct_59']?.() + __napiInstance.exports['__napi_register__NinjaTurtle_struct_60']?.() + __napiInstance.exports['__napi_register__NinjaTurtle_impl_67']?.() + __napiInstance.exports['__napi_register__JsAssets_struct_68']?.() + __napiInstance.exports['__napi_register__JsAssets_impl_71']?.() + __napiInstance.exports['__napi_register__JsAsset_struct_72']?.() + __napiInstance.exports['__napi_register__JsAsset_impl_75']?.() + __napiInstance.exports['__napi_register__Optional_struct_76']?.() + __napiInstance.exports['__napi_register__Optional_impl_81']?.() + __napiInstance.exports['__napi_register__ObjectFieldClassInstance_struct_82']?.() + __napiInstance.exports['__napi_register__create_object_with_class_field_83']?.() + __napiInstance.exports['__napi_register__receive_object_with_class_field_84']?.() + __napiInstance.exports['__napi_register__NotWritableClass_struct_85']?.() + __napiInstance.exports['__napi_register__NotWritableClass_impl_87']?.() + __napiInstance.exports['__napi_register__CustomFinalize_struct_88']?.() + __napiInstance.exports['__napi_register__CustomFinalize_impl_90']?.() + __napiInstance.exports['__napi_register__Width_struct_91']?.() + __napiInstance.exports['__napi_register__plus_one_92']?.() + __napiInstance.exports['__napi_register__GetterSetterWithClosures_struct_93']?.() + __napiInstance.exports['__napi_register__GetterSetterWithClosures_impl_95']?.() + __napiInstance.exports['__napi_register__CatchOnConstructor_struct_96']?.() + __napiInstance.exports['__napi_register__CatchOnConstructor_impl_98']?.() + __napiInstance.exports['__napi_register__CatchOnConstructor2_struct_99']?.() + __napiInstance.exports['__napi_register__CatchOnConstructor2_impl_101']?.() + __napiInstance.exports['__napi_register__ClassWithFactory_struct_102']?.() + __napiInstance.exports['__napi_register__ClassWithFactory_impl_107']?.() + __napiInstance.exports['__napi_register__Selector_struct_108']?.() + __napiInstance.exports['__napi_register__date_to_number_109']?.() + __napiInstance.exports['__napi_register__chrono_date_to_millis_110']?.() + __napiInstance.exports['__napi_register__chrono_date_add_1_minute_111']?.() + __napiInstance.exports['__napi_register__Dates_struct_112']?.() + __napiInstance.exports['__napi_register__chrono_native_date_time_113']?.() + __napiInstance.exports['__napi_register__chrono_native_date_time_return_114']?.() + __napiInstance.exports['__napi_register__either_string_or_number_115']?.() + __napiInstance.exports['__napi_register__return_either_116']?.() + __napiInstance.exports['__napi_register__either3_117']?.() + __napiInstance.exports['__napi_register__Obj_struct_118']?.() + __napiInstance.exports['__napi_register__either4_119']?.() + __napiInstance.exports['__napi_register__JsClassForEither_struct_120']?.() + __napiInstance.exports['__napi_register__JsClassForEither_impl_122']?.() + __napiInstance.exports['__napi_register__AnotherClassForEither_struct_123']?.() + __napiInstance.exports['__napi_register__AnotherClassForEither_impl_125']?.() + __napiInstance.exports['__napi_register__receive_class_or_number_126']?.() + __napiInstance.exports['__napi_register__receive_mut_class_or_number_127']?.() + __napiInstance.exports['__napi_register__receive_different_class_128']?.() + __napiInstance.exports['__napi_register__return_either_class_129']?.() + __napiInstance.exports['__napi_register__either_from_option_130']?.() + __napiInstance.exports['__napi_register__A_struct_131']?.() + __napiInstance.exports['__napi_register__B_struct_132']?.() + __napiInstance.exports['__napi_register__C_struct_133']?.() + __napiInstance.exports['__napi_register__either_from_objects_134']?.() + __napiInstance.exports['__napi_register__either_bool_or_function_135']?.() + __napiInstance.exports['__napi_register__promise_in_either_136']?.() + __napiInstance.exports['__napi_register__either_bool_or_tuple_137']?.() + __napiInstance.exports['__napi_register__Kind_138']?.() + __napiInstance.exports['__napi_register__Empty_139']?.() + __napiInstance.exports['__napi_register__Status_140']?.() + __napiInstance.exports['__napi_register__StringEnum_141']?.() + __napiInstance.exports['__napi_register__CustomNumEnum_142']?.() + __napiInstance.exports['__napi_register__enum_to_i32_143']?.() + __napiInstance.exports['__napi_register__SkippedEnums_144']?.() + __napiInstance.exports['__napi_register__run_script_145']?.() + __napiInstance.exports['__napi_register__get_module_file_name_146']?.() + __napiInstance.exports['__napi_register__throw_syntax_error_147']?.() + __napiInstance.exports['__napi_register__throw_error_148']?.() + __napiInstance.exports['__napi_register__panic_149']?.() + __napiInstance.exports['__napi_register__receive_string_150']?.() + __napiInstance.exports['__napi_register__custom_status_code_151']?.() + __napiInstance.exports['__napi_register__throw_async_error_152']?.() + __napiInstance.exports['__napi_register__create_external_153']?.() + __napiInstance.exports['__napi_register__create_external_string_154']?.() + __napiInstance.exports['__napi_register__get_external_155']?.() + __napiInstance.exports['__napi_register__mutate_external_156']?.() + __napiInstance.exports['__napi_register__create_optional_external_157']?.() + __napiInstance.exports['__napi_register__get_optional_external_158']?.() + __napiInstance.exports['__napi_register__mutate_optional_external_159']?.() + __napiInstance.exports['__napi_register__validate_array_160']?.() + __napiInstance.exports['__napi_register__validate_buffer_161']?.() + __napiInstance.exports['__napi_register__validate_typed_array_162']?.() + __napiInstance.exports['__napi_register__validate_typed_array_slice_163']?.() + __napiInstance.exports['__napi_register__validate_uint8_clamped_slice_164']?.() + __napiInstance.exports['__napi_register__validate_buffer_slice_165']?.() + __napiInstance.exports['__napi_register__validate_bigint_166']?.() + __napiInstance.exports['__napi_register__validate_boolean_167']?.() + __napiInstance.exports['__napi_register__validate_date_168']?.() + __napiInstance.exports['__napi_register__validate_date_time_169']?.() + __napiInstance.exports['__napi_register__validate_external_170']?.() + __napiInstance.exports['__napi_register__validate_function_171']?.() + __napiInstance.exports['__napi_register__validate_hash_map_172']?.() + __napiInstance.exports['__napi_register__validate_null_173']?.() + __napiInstance.exports['__napi_register__validate_undefined_174']?.() + __napiInstance.exports['__napi_register__validate_number_175']?.() + __napiInstance.exports['__napi_register__validate_promise_176']?.() + __napiInstance.exports['__napi_register__validate_string_177']?.() + __napiInstance.exports['__napi_register__validate_symbol_178']?.() + __napiInstance.exports['__napi_register__validate_optional_179']?.() + __napiInstance.exports['__napi_register__return_undefined_if_invalid_180']?.() + __napiInstance.exports['__napi_register__return_undefined_if_invalid_promise_181']?.() + __napiInstance.exports['__napi_register__ts_rename_182']?.() + __napiInstance.exports['__napi_register__override_individual_arg_on_function_183']?.() + __napiInstance.exports['__napi_register__override_individual_arg_on_function_with_cb_arg_184']?.() + __napiInstance.exports['__napi_register__call0_185']?.() + __napiInstance.exports['__napi_register__call1_186']?.() + __napiInstance.exports['__napi_register__call2_187']?.() + __napiInstance.exports['__napi_register__apply0_188']?.() + __napiInstance.exports['__napi_register__apply1_189']?.() + __napiInstance.exports['__napi_register__call_function_190']?.() + __napiInstance.exports['__napi_register__call_function_with_arg_191']?.() + __napiInstance.exports['__napi_register__create_reference_on_function_192']?.() + __napiInstance.exports['__napi_register__call_function_with_arg_and_ctx_193']?.() + __napiInstance.exports['__napi_register__reference_as_callback_194']?.() + __napiInstance.exports['__napi_register__build_threadsafe_function_from_function_195']?.() + __napiInstance.exports['__napi_register__Fib_struct_196']?.() + __napiInstance.exports['__napi_register__Fib_impl_197']?.() + __napiInstance.exports['__napi_register__Fib_impl_199']?.() + __napiInstance.exports['__napi_register__Fib2_struct_200']?.() + __napiInstance.exports['__napi_register__Fib2_impl_201']?.() + __napiInstance.exports['__napi_register__Fib2_impl_203']?.() + __napiInstance.exports['__napi_register__Fib3_struct_204']?.() + __napiInstance.exports['__napi_register__Fib3_impl_205']?.() + __napiInstance.exports['__napi_register__ALIGNMENT_206']?.() + __napiInstance.exports['__napi_register__xxh64_207']?.() + __napiInstance.exports['__napi_register__xxh128_208']?.() + __napiInstance.exports['__napi_register__Xxh3_struct_209']?.() + __napiInstance.exports['__napi_register__Xxh3_impl_213']?.() + __napiInstance.exports['__napi_register__xxh2_plus_214']?.() + __napiInstance.exports['__napi_register__xxh3_xxh64_alias_215']?.() + __napiInstance.exports['__napi_register__xxh64_alias_216']?.() + __napiInstance.exports['__napi_register__get_mapping_217']?.() + __napiInstance.exports['__napi_register__sum_mapping_218']?.() + __napiInstance.exports['__napi_register__get_btree_mapping_219']?.() + __napiInstance.exports['__napi_register__sum_btree_mapping_220']?.() + __napiInstance.exports['__napi_register__get_index_mapping_221']?.() + __napiInstance.exports['__napi_register__sum_index_mapping_222']?.() + __napiInstance.exports['__napi_register__indexmap_passthrough_223']?.() + __napiInstance.exports['__napi_register__map_option_224']?.() + __napiInstance.exports['__napi_register__return_null_225']?.() + __napiInstance.exports['__napi_register__return_undefined_226']?.() + __napiInstance.exports['__napi_register__UseNullableStruct_struct_227']?.() + __napiInstance.exports['__napi_register__NotUseNullableStruct_struct_228']?.() + __napiInstance.exports['__napi_register__DefaultUseNullableStruct_struct_229']?.() + __napiInstance.exports['__napi_register__UseNullableClass_struct_230']?.() + __napiInstance.exports['__napi_register__NotUseNullableClass_struct_231']?.() + __napiInstance.exports['__napi_register__DefaultUseNullableClass_struct_232']?.() + __napiInstance.exports['__napi_register__add_233']?.() + __napiInstance.exports['__napi_register__fibonacci_234']?.() + __napiInstance.exports['__napi_register__list_obj_keys_235']?.() + __napiInstance.exports['__napi_register__create_obj_236']?.() + __napiInstance.exports['__napi_register__get_global_237']?.() + __napiInstance.exports['__napi_register__get_undefined_238']?.() + __napiInstance.exports['__napi_register__get_null_239']?.() + __napiInstance.exports['__napi_register__AllOptionalObject_struct_240']?.() + __napiInstance.exports['__napi_register__receive_all_optional_object_241']?.() + __napiInstance.exports['__napi_register__AliasedEnum_242']?.() + __napiInstance.exports['__napi_register__StructContainsAliasedEnum_struct_243']?.() + __napiInstance.exports['__napi_register__fn_received_aliased_244']?.() + __napiInstance.exports['__napi_register__StrictObject_struct_245']?.() + __napiInstance.exports['__napi_register__receive_strict_object_246']?.() + __napiInstance.exports['__napi_register__get_str_from_object_247']?.() + __napiInstance.exports['__napi_register__TsTypeChanged_struct_248']?.() + __napiInstance.exports['__napi_register__create_obj_with_property_249']?.() + __napiInstance.exports['__napi_register__getter_from_obj_250']?.() + __napiInstance.exports['__napi_register__ObjectOnlyFromJs_struct_251']?.() + __napiInstance.exports['__napi_register__receive_object_only_from_js_252']?.() + __napiInstance.exports['__napi_register__object_get_named_property_should_perform_typecheck_253']?.() + __napiInstance.exports['__napi_register__ObjectOnlyToJs_struct_254']?.() + __napiInstance.exports['__napi_register__return_object_only_to_js_255']?.() + __napiInstance.exports['__napi_register__async_plus_100_256']?.() + __napiInstance.exports['__napi_register__JsRepo_struct_257']?.() + __napiInstance.exports['__napi_register__JsRepo_impl_260']?.() + __napiInstance.exports['__napi_register__JsRemote_struct_261']?.() + __napiInstance.exports['__napi_register__JsRemote_impl_264']?.() + __napiInstance.exports['__napi_register__CSSRuleList_struct_265']?.() + __napiInstance.exports['__napi_register__CSSRuleList_impl_269']?.() + __napiInstance.exports['__napi_register__CSSStyleSheet_struct_270']?.() + __napiInstance.exports['__napi_register__AnotherCSSStyleSheet_struct_271']?.() + __napiInstance.exports['__napi_register__AnotherCSSStyleSheet_impl_273']?.() + __napiInstance.exports['__napi_register__CSSStyleSheet_impl_277']?.() + __napiInstance.exports['__napi_register__PackageJson_struct_278']?.() + __napiInstance.exports['__napi_register__read_package_json_279']?.() + __napiInstance.exports['__napi_register__get_package_json_name_280']?.() + __napiInstance.exports['__napi_register__test_serde_roundtrip_281']?.() + __napiInstance.exports['__napi_register__test_serde_big_number_precision_282']?.() + __napiInstance.exports['__napi_register__return_from_shared_crate_283']?.() + __napiInstance.exports['__napi_register__contains_284']?.() + __napiInstance.exports['__napi_register__concat_str_285']?.() + __napiInstance.exports['__napi_register__concat_utf16_286']?.() + __napiInstance.exports['__napi_register__concat_latin1_287']?.() + __napiInstance.exports['__napi_register__roundtrip_str_288']?.() + __napiInstance.exports['__napi_register__set_symbol_in_obj_289']?.() + __napiInstance.exports['__napi_register__create_symbol_290']?.() + __napiInstance.exports['__napi_register__create_symbol_for_291']?.() + __napiInstance.exports['__napi_register__DelaySum_impl_292']?.() + __napiInstance.exports['__napi_register__without_abort_controller_293']?.() + __napiInstance.exports['__napi_register__with_abort_controller_294']?.() + __napiInstance.exports['__napi_register__AsyncTaskVoidReturn_impl_295']?.() + __napiInstance.exports['__napi_register__async_task_void_return_296']?.() + __napiInstance.exports['__napi_register__AsyncTaskOptionalReturn_impl_297']?.() + __napiInstance.exports['__napi_register__async_task_optional_return_298']?.() + __napiInstance.exports['__napi_register__call_threadsafe_function_299']?.() + __napiInstance.exports['__napi_register__call_long_threadsafe_function_300']?.() + __napiInstance.exports['__napi_register__threadsafe_function_throw_error_301']?.() + __napiInstance.exports['__napi_register__threadsafe_function_fatal_mode_302']?.() + __napiInstance.exports['__napi_register__threadsafe_function_fatal_mode_error_303']?.() + __napiInstance.exports['__napi_register__threadsafe_function_closure_capture_304']?.() + __napiInstance.exports['__napi_register__tsfn_call_with_callback_305']?.() + __napiInstance.exports['__napi_register__tsfn_async_call_306']?.() + __napiInstance.exports['__napi_register__accept_threadsafe_function_307']?.() + __napiInstance.exports['__napi_register__accept_threadsafe_function_fatal_308']?.() + __napiInstance.exports['__napi_register__accept_threadsafe_function_tuple_args_309']?.() + __napiInstance.exports['__napi_register__tsfn_return_promise_310']?.() + __napiInstance.exports['__napi_register__tsfn_return_promise_timeout_311']?.() + __napiInstance.exports['__napi_register__tsfn_throw_from_js_312']?.() + __napiInstance.exports['__napi_register__get_buffer_313']?.() + __napiInstance.exports['__napi_register__append_buffer_314']?.() + __napiInstance.exports['__napi_register__get_empty_buffer_315']?.() + __napiInstance.exports['__napi_register__convert_u32_array_316']?.() + __napiInstance.exports['__napi_register__create_external_typed_array_317']?.() + __napiInstance.exports['__napi_register__mutate_typed_array_318']?.() + __napiInstance.exports['__napi_register__deref_uint8_array_319']?.() + __napiInstance.exports['__napi_register__buffer_pass_through_320']?.() + __napiInstance.exports['__napi_register__array_buffer_pass_through_321']?.() + __napiInstance.exports['__napi_register__accept_slice_322']?.() + __napiInstance.exports['__napi_register__u8_array_to_array_323']?.() + __napiInstance.exports['__napi_register__i8_array_to_array_324']?.() + __napiInstance.exports['__napi_register__u16_array_to_array_325']?.() + __napiInstance.exports['__napi_register__i16_array_to_array_326']?.() + __napiInstance.exports['__napi_register__u32_array_to_array_327']?.() + __napiInstance.exports['__napi_register__i32_array_to_array_328']?.() + __napiInstance.exports['__napi_register__f32_array_to_array_329']?.() + __napiInstance.exports['__napi_register__f64_array_to_array_330']?.() + __napiInstance.exports['__napi_register__u64_array_to_array_331']?.() + __napiInstance.exports['__napi_register__i64_array_to_array_332']?.() + __napiInstance.exports['__napi_register__accept_uint8_clamped_slice_333']?.() + __napiInstance.exports['__napi_register__accept_uint8_clamped_slice_and_buffer_slice_334']?.() + __napiInstance.exports['__napi_register__AsyncBuffer_impl_335']?.() + __napiInstance.exports['__napi_register__async_reduce_buffer_336']?.() + __napiInstance.exports['__napi_register__async_buffer_to_array_337']?.() } module.exports.Animal = __napiModule.exports.Animal module.exports.AnimalWithDefaultConstructor = __napiModule.exports.AnimalWithDefaultConstructor @@ -504,6 +505,7 @@ module.exports.optionStartEnd = __napiModule.exports.optionStartEnd module.exports.overrideIndividualArgOnFunction = __napiModule.exports.overrideIndividualArgOnFunction module.exports.overrideIndividualArgOnFunctionWithCbArg = __napiModule.exports.overrideIndividualArgOnFunctionWithCbArg module.exports.panic = __napiModule.exports.panic +module.exports.panicInAsync = __napiModule.exports.panicInAsync module.exports.plusOne = __napiModule.exports.plusOne module.exports.promiseInEither = __napiModule.exports.promiseInEither module.exports.readFile = __napiModule.exports.readFile diff --git a/examples/napi/index.cjs b/examples/napi/index.cjs index 47552aff..ea72b660 100644 --- a/examples/napi/index.cjs +++ b/examples/napi/index.cjs @@ -513,6 +513,7 @@ module.exports.optionStartEnd = nativeBinding.optionStartEnd module.exports.overrideIndividualArgOnFunction = nativeBinding.overrideIndividualArgOnFunction module.exports.overrideIndividualArgOnFunctionWithCbArg = nativeBinding.overrideIndividualArgOnFunctionWithCbArg module.exports.panic = nativeBinding.panic +module.exports.panicInAsync = nativeBinding.panicInAsync module.exports.plusOne = nativeBinding.plusOne module.exports.promiseInEither = nativeBinding.promiseInEither module.exports.readFile = nativeBinding.readFile diff --git a/examples/napi/index.d.cts b/examples/napi/index.d.cts index 93e5500c..a08e3f2d 100644 --- a/examples/napi/index.d.cts +++ b/examples/napi/index.d.cts @@ -551,6 +551,8 @@ export interface PackageJson { export function panic(): void +export function panicInAsync(): Promise + export function plusOne(this: Width): number export function promiseInEither(input: number | Promise): Promise diff --git a/examples/napi/src/async.rs b/examples/napi/src/async.rs index 29a586d6..b0a2d879 100644 --- a/examples/napi/src/async.rs +++ b/examples/napi/src/async.rs @@ -31,3 +31,8 @@ async fn async_multi_two(arg: u32) -> Result { .await .unwrap() } + +#[napi] +async fn panic_in_async() { + panic!("panic in async function"); +} diff --git a/examples/napi/src/lib.rs b/examples/napi/src/lib.rs index 2cae0595..625d1bdf 100644 --- a/examples/napi/src/lib.rs +++ b/examples/napi/src/lib.rs @@ -5,6 +5,7 @@ #![allow(clippy::new_without_default)] #![allow(deprecated)] +#[cfg(not(target_family = "wasm"))] use napi::bindgen_prelude::create_custom_tokio_runtime; #[macro_use]