chore(napi): misc cleanup
This commit is contained in:
parent
03e80361d9
commit
36275438ad
2 changed files with 7 additions and 1 deletions
|
@ -724,6 +724,12 @@ impl ParseNapi for syn::ItemFn {
|
||||||
"#[napi] can't be applied to a function with #[napi(ts_type)]"
|
"#[napi] can't be applied to a function with #[napi(ts_type)]"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if opts.return_if_invalid().is_some() && opts.strict().is_some() {
|
||||||
|
bail_span!(
|
||||||
|
self,
|
||||||
|
"#[napi(return_if_invalid)] can't be used with #[napi(strict)]"
|
||||||
|
);
|
||||||
|
}
|
||||||
let napi = self.convert_to_ast(opts);
|
let napi = self.convert_to_ast(opts);
|
||||||
self.to_tokens(tokens);
|
self.to_tokens(tokens);
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ impl Object {
|
||||||
check_status!(
|
check_status!(
|
||||||
sys::napi_get_named_property(self.0.env, self.0.value, c_field.as_ptr(), &mut ret),
|
sys::napi_get_named_property(self.0.env, self.0.value, c_field.as_ptr(), &mut ret),
|
||||||
"Failed to get property with field `{}`",
|
"Failed to get property with field `{}`",
|
||||||
c_field.to_string_lossy(),
|
field.as_ref(),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let ty = type_of!(self.0.env, ret)?;
|
let ty = type_of!(self.0.env, ret)?;
|
||||||
|
|
Loading…
Reference in a new issue