mirror of
https://github.com/napi-rs/napi-rs.git
synced 2025-12-08 19:56:07 +00:00
fix(macro): constructor don't support asynchronous function (#2239)
This commit is contained in:
parent
7bbb04b4f0
commit
b9c884e788
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user