diff --git a/crates/napi/src/bindgen_runtime/js_values/arraybuffer.rs b/crates/napi/src/bindgen_runtime/js_values/arraybuffer.rs index 01ee9c76..4bbacc12 100644 --- a/crates/napi/src/bindgen_runtime/js_values/arraybuffer.rs +++ b/crates/napi/src/bindgen_runtime/js_values/arraybuffer.rs @@ -7,7 +7,7 @@ use std::sync::{ Arc, }; -#[cfg(all(feature = "napi4", not(target_os = "wasi")))] +#[cfg(all(feature = "napi4", not(feature = "noop"), not(target_os = "wasi")))] use crate::bindgen_prelude::{CUSTOM_GC_TSFN, CUSTOM_GC_TSFN_DESTROYED, THREADS_CAN_ACCESS_ENV}; pub use crate::js_values::TypedArrayType; use crate::{check_status, sys, Error, Result, Status}; @@ -80,7 +80,7 @@ macro_rules! impl_typed_array { if ref_.is_null() { return; } - #[cfg(all(feature = "napi4", not(target_os = "wasi")))] + #[cfg(all(feature = "napi4", not(feature = "noop"), not(target_os = "wasi")))] { if CUSTOM_GC_TSFN_DESTROYED.load(Ordering::SeqCst) { return; diff --git a/crates/napi/src/bindgen_runtime/js_values/buffer.rs b/crates/napi/src/bindgen_runtime/js_values/buffer.rs index 7d3347f2..13cf98d3 100644 --- a/crates/napi/src/bindgen_runtime/js_values/buffer.rs +++ b/crates/napi/src/bindgen_runtime/js_values/buffer.rs @@ -9,7 +9,7 @@ use std::sync::Arc; #[cfg(all(debug_assertions, not(windows)))] use std::sync::Mutex; -#[cfg(all(feature = "napi4", not(target_os = "wasi")))] +#[cfg(all(feature = "napi4", not(feature = "noop"), not(target_os = "wasi")))] use crate::bindgen_prelude::{CUSTOM_GC_TSFN, CUSTOM_GC_TSFN_DESTROYED, THREADS_CAN_ACCESS_ENV}; use crate::{bindgen_prelude::*, check_status, sys, Result, ValueType}; @@ -37,7 +37,7 @@ impl Drop for Buffer { if ref_.is_null() { return; } - #[cfg(all(feature = "napi4", not(target_os = "wasi")))] + #[cfg(all(feature = "napi4", not(feature = "noop"), not(target_os = "wasi")))] { if CUSTOM_GC_TSFN_DESTROYED.load(std::sync::atomic::Ordering::SeqCst) { return; diff --git a/crates/napi/src/bindgen_runtime/module_register.rs b/crates/napi/src/bindgen_runtime/module_register.rs index fecbfef6..d7542273 100644 --- a/crates/napi/src/bindgen_runtime/module_register.rs +++ b/crates/napi/src/bindgen_runtime/module_register.rs @@ -74,12 +74,12 @@ static IS_FIRST_MODULE: AtomicBool = AtomicBool::new(true); static FIRST_MODULE_REGISTERED: AtomicBool = AtomicBool::new(false); static REGISTERED_CLASSES: Lazy = Lazy::new(Default::default); static FN_REGISTER_MAP: Lazy = Lazy::new(Default::default); -#[cfg(all(feature = "napi4", not(target_os = "wasi")))] +#[cfg(all(feature = "napi4", not(feature = "noop"), not(target_os = "wasi")))] pub(crate) static CUSTOM_GC_TSFN: AtomicPtr = AtomicPtr::new(ptr::null_mut()); -#[cfg(all(feature = "napi4", not(target_os = "wasi")))] +#[cfg(all(feature = "napi4", not(feature = "noop"), not(target_os = "wasi")))] pub(crate) static CUSTOM_GC_TSFN_DESTROYED: AtomicBool = AtomicBool::new(false); -#[cfg(all(feature = "napi4", not(target_os = "wasi")))] +#[cfg(all(feature = "napi4", not(feature = "noop"), not(target_os = "wasi")))] // Store thread id of the thread that created the CustomGC ThreadsafeFunction. pub(crate) static THREADS_CAN_ACCESS_ENV: once_cell::sync::Lazy< PersistedPerInstanceHashMap,