chore(napi-derive): allow unsafe async &mut self (#1453)
This commit is contained in:
parent
e3adf5dac4
commit
ab81f4126b
1 changed files with 2 additions and 2 deletions
|
@ -30,10 +30,10 @@ impl TryToTokens for NapiFn {
|
|||
.collect(),
|
||||
);
|
||||
}
|
||||
if Some(FnSelf::MutRef) == self.fn_self && self.is_async {
|
||||
if Some(FnSelf::MutRef) == self.fn_self && self.is_async && !self.unsafe_ {
|
||||
return Err(Diagnostic::span_error(
|
||||
self.name.span(),
|
||||
"&mut self is incompatible with async napi methods",
|
||||
"&mut self in async napi methods should be marked as unsafe",
|
||||
));
|
||||
}
|
||||
let arg_ref_count = refs.len();
|
||||
|
|
Loading…
Reference in a new issue