From e3b2ee183bc7497ec0432bc764678f5eda6495a7 Mon Sep 17 00:00:00 2001 From: snek Date: Mon, 10 Jun 2024 09:20:44 -0700 Subject: fix: Rewrite Node-API (#24101) Phase 1 node-api rewrite --- cli/napi/sym/lib.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'cli/napi/sym/lib.rs') diff --git a/cli/napi/sym/lib.rs b/cli/napi/sym/lib.rs index 33f039b5f..e2826306b 100644 --- a/cli/napi/sym/lib.rs +++ b/cli/napi/sym/lib.rs @@ -20,17 +20,12 @@ pub fn napi_sym(_attr: TokenStream, item: TokenStream) -> TokenStream { let name = &func.sig.ident; assert!( exports.symbols.contains(&name.to_string()), - "tools/napi/sym/symbol_exports.json is out of sync!" + "cli/napi/sym/symbol_exports.json is out of sync!" ); - let block = &func.block; - let inputs = &func.sig.inputs; - let generics = &func.sig.generics; TokenStream::from(quote! { - // SAFETY: it's an NAPI function. - #[no_mangle] - pub unsafe extern "C" fn #name #generics (#inputs) -> napi_status { - #block - } + crate::napi_wrap! { + #func + } }) } -- cgit v1.2.3