From 92abdb7669d81b656ae0505cf923fca3b7feea01 Mon Sep 17 00:00:00 2001 From: snek Date: Mon, 22 Jul 2024 11:41:59 -0700 Subject: chore: move all node-api impl to ext (#24662) these symbols are re-exported from runtime/cli using `build.rs`, so we don't need them in the same crate. --- cli/napi/sym/lib.rs | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 cli/napi/sym/lib.rs (limited to 'cli/napi/sym/lib.rs') diff --git a/cli/napi/sym/lib.rs b/cli/napi/sym/lib.rs deleted file mode 100644 index e2826306b..000000000 --- a/cli/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, -} - -#[proc_macro_attribute] -pub fn napi_sym(_attr: TokenStream, item: TokenStream) -> TokenStream { - let func = syn::parse::(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()), - "cli/napi/sym/symbol_exports.json is out of sync!" - ); - - TokenStream::from(quote! { - crate::napi_wrap! { - #func - } - }) -} -- cgit v1.2.3