diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-07-23 01:01:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-23 00:01:31 +0000 |
commit | 3f8efe5289d88097ab49e7a8fcda763c2823376b (patch) | |
tree | 736b2f2315a46a81af1ecfec4e5efb4f2a7d3521 /ext/napi/sym/lib.rs | |
parent | 715675565a928a7ac819b89fa40d8b74e7e1c8bc (diff) |
Revert "chore: move all node-api impl to ext (#24662)" (#24680)
This reverts commit d00fbd70258a77a267fe20bdd2c4a028c799b693.
Reverting because, it caused a failure during v1.45.3 publish:
https://github.com/denoland/deno/actions/runs/10048730693/job/27773718095
Diffstat (limited to 'ext/napi/sym/lib.rs')
-rw-r--r-- | ext/napi/sym/lib.rs | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/ext/napi/sym/lib.rs b/ext/napi/sym/lib.rs deleted file mode 100644 index 21edaa289..000000000 --- a/ext/napi/sym/lib.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -use proc_macro::TokenStream; -use quote::quote; -use serde::Deserialize; - -static NAPI_EXPORTS: &str = include_str!("./symbol_exports.json"); - -#[derive(Deserialize)] -struct SymbolExports { - pub symbols: Vec<String>, -} - -#[proc_macro_attribute] -pub fn napi_sym(_attr: TokenStream, item: TokenStream) -> TokenStream { - let func = syn::parse::<syn::ItemFn>(item).expect("expected a function"); - - let exports: SymbolExports = - serde_json::from_str(NAPI_EXPORTS).expect("failed to parse exports"); - let name = &func.sig.ident; - assert!( - exports.symbols.contains(&name.to_string()), - "ext/napi/sym/symbol_exports.json is out of sync!" - ); - - TokenStream::from(quote! { - crate::napi_wrap! { - #func - } - }) -} |