napi-rs/crates
Louis 43415251b8
feat(napi): allow Reference as a class method param (#1966)
As of before this commit, there was a lock in the codegen preventing Reference
from being used as a function argument outside of a Reference<Self>.

This changes it, allowing Reference of any class to be added as a class method
argument anywhere. It has the same limitations as reference, as in it requires
the class to have been created with a factory or constructor. This change
implements FromNapiValue on Reference, which will unwrap the class and call the
existing from_value_ptr method. It also updated typegen so that we only emit
the reference type if we're in an impl block that doesn't match the Reference
we're getting. This ensures that typegen works as expected with the previous
behaviour.
2024-02-22 22:37:50 +08:00
..
backend feat(napi): allow Reference as a class method param (#1966) 2024-02-22 22:37:50 +08:00
build Release independent packages 2024-02-19 19:10:16 +08:00
macro fix(napi-derive): napi-derive-backend version 2024-02-20 15:17:43 +08:00
napi feat(napi): allow Reference as a class method param (#1966) 2024-02-22 22:37:50 +08:00
sys Release independent packages 2023-11-07 14:18:36 +08:00