Skip to content

Commit 9581f78

Browse files
committed
fix(napi-derive): undefined feature flags in expanded macro
Close #2370
1 parent 39d3827 commit 9581f78

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

crates/backend/src/codegen/const.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ impl NapiConst {
3535
}
3636
#[allow(non_snake_case)]
3737
#[allow(clippy::all)]
38-
#[cfg(all(not(test), not(feature = "noop"), not(target_family = "wasm")))]
38+
#[cfg(all(not(test), not(target_family = "wasm")))]
3939
#[napi::bindgen_prelude::ctor]
4040
fn #register_name() {
4141
napi::bindgen_prelude::register_module_export(#js_mod_ident, #js_name_lit, #cb_name);
4242
}
4343

4444
#[allow(non_snake_case)]
4545
#[allow(clippy::all)]
46-
#[cfg(all(not(test), not(feature = "noop"), target_family = "wasm"))]
46+
#[cfg(all(not(test), target_family = "wasm"))]
4747
#[no_mangle]
4848
unsafe extern "C" fn #register_name() {
4949
napi::bindgen_prelude::register_module_export(#js_mod_ident, #js_name_lit, #cb_name);

crates/backend/src/codegen/enum.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,14 @@ impl NapiEnum {
199199
}
200200
#[allow(non_snake_case)]
201201
#[allow(clippy::all)]
202-
#[cfg(all(not(test), not(feature = "noop"), not(target_family = "wasm")))]
202+
#[cfg(all(not(test), not(target_family = "wasm")))]
203203
#[napi::bindgen_prelude::ctor]
204204
fn #register_name() {
205205
napi::bindgen_prelude::register_module_export(#js_mod_ident, #js_name_lit, #callback_name);
206206
}
207207
#[allow(non_snake_case)]
208208
#[allow(clippy::all)]
209-
#[cfg(all(not(test), not(feature = "noop"), target_family = "wasm"))]
209+
#[cfg(all(not(test), target_family = "wasm"))]
210210
#[no_mangle]
211211
extern "C" fn #register_name() {
212212
napi::bindgen_prelude::register_module_export(#js_mod_ident, #js_name_lit, #callback_name);

crates/backend/src/codegen/fn.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl TryToTokens for NapiFn {
7979

8080
#(#refs)*
8181

82-
#[cfg(debug_assert)]
82+
#[cfg(debug_assertions)]
8383
{
8484
for a in &_args_array {
8585
assert!(!a.is_null(), "failed to initialize napi ref");
@@ -666,15 +666,15 @@ impl NapiFn {
666666

667667
#[allow(clippy::all)]
668668
#[allow(non_snake_case)]
669-
#[cfg(all(not(test), not(feature = "noop"), not(target_family = "wasm")))]
669+
#[cfg(all(not(test), not(target_family = "wasm")))]
670670
#[napi::bindgen_prelude::ctor]
671671
fn #module_register_name() {
672672
napi::bindgen_prelude::register_module_export(#js_mod_ident, #js_name, #cb_name);
673673
}
674674

675675
#[allow(clippy::all)]
676676
#[allow(non_snake_case)]
677-
#[cfg(all(not(test), not(feature = "noop"), target_family = "wasm"))]
677+
#[cfg(all(not(test), target_family = "wasm"))]
678678
#[no_mangle]
679679
extern "C" fn #module_register_name() {
680680
napi::bindgen_prelude::register_module_export(#js_mod_ident, #js_name, #cb_name);

crates/backend/src/codegen/struct.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -797,15 +797,15 @@ impl NapiStruct {
797797
quote! {
798798
#[allow(non_snake_case)]
799799
#[allow(clippy::all)]
800-
#[cfg(all(not(test), not(feature = "noop"), not(target_family = "wasm")))]
800+
#[cfg(all(not(test), not(target_family = "wasm")))]
801801
#[napi::bindgen_prelude::ctor]
802802
fn #struct_register_name() {
803803
napi::__private::register_class(#name_str, #js_mod_ident, #js_name, vec![#(#props),*]);
804804
}
805805

806806
#[allow(non_snake_case)]
807807
#[allow(clippy::all)]
808-
#[cfg(all(not(test), not(feature = "noop"), target_family = "wasm"))]
808+
#[cfg(all(not(test), target_family = "wasm"))]
809809
#[no_mangle]
810810
extern "C" fn #struct_register_name() {
811811
napi::__private::register_class(#name_str, #js_mod_ident, #js_name, vec![#(#props),*]);
@@ -917,13 +917,13 @@ impl NapiImpl {
917917
use super::*;
918918
#(#methods)*
919919

920-
#[cfg(all(not(test), not(feature = "noop"), not(target_family = "wasm")))]
920+
#[cfg(all(not(test), not(target_family = "wasm")))]
921921
#[napi::bindgen_prelude::ctor]
922922
fn #register_name() {
923923
napi::__private::register_class(#name_str, #js_mod_ident, #js_name, vec![#(#props),*]);
924924
}
925925

926-
#[cfg(all(not(test), not(feature = "noop"), target_family = "wasm"))]
926+
#[cfg(all(not(test), target_family = "wasm"))]
927927
#[no_mangle]
928928
extern "C" fn #register_name() {
929929
napi::__private::register_class(#name_str, #js_mod_ident, #js_name, vec![#(#props_wasm),*]);

0 commit comments

Comments
 (0)