fix(napi-derive-backend): always generate CallContext for constructor function

This commit is contained in:
LongYinan 2021-10-28 18:11:06 +08:00
parent d08f9b03e0
commit 813d671d76

View file

@ -39,7 +39,8 @@ impl TryToTokens for NapiFn {
}
};
let function_call = if args_len == 0 && self.fn_self.is_none() {
let function_call =
if args_len == 0 && self.fn_self.is_none() && self.kind != FnKind::Constructor {
quote! { #native_call }
} else {
quote! {