fix(macro): constructor don't support asynchronous function (#2239)

This commit is contained in:
Richer 2024-08-31 10:40:49 +08:00 committed by GitHub
parent 7bbb04b4f0
commit b9c884e788
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -690,6 +690,10 @@ fn napi_fn_from_decl(
);
}
if matches!(kind, FnKind::Constructor) && asyncness.is_some() {
bail_span!(sig.ident, "Constructor don't support asynchronous function");
}
Ok(NapiFn {
name: ident.clone(),
js_name,