napi-rs/crates/napi/src
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
..
bindgen_runtime feat(napi): allow Reference as a class method param (#1966) 2024-02-22 22:37:50 +08:00
js_values fix(napi): require static lifetime on add_finalizer callback (#1968) 2024-02-22 18:40:04 +08:00
async_cleanup_hook.rs Introduce #[napi] procedural macro to automation development boilerplate (#696) 2021-09-23 01:29:09 +08:00
async_work.rs chore: fix async_work status typo (#1883) 2024-01-02 13:23:45 +08:00
call_context.rs refactor(napi): remove compatible Either struct 2021-11-25 17:53:41 +08:00
cleanup_env.rs Introduce #[napi] procedural macro to automation development boilerplate (#696) 2021-09-23 01:29:09 +08:00
env.rs fix(napi): Fix buffer corruption and soundness issues (#1923) 2024-01-29 18:32:28 +08:00
error.rs feat(napi,sys): sync to napi9 (#1781) 2023-11-06 11:00:27 +08:00
lib.rs fix: remove outdated rustdoc about tokio channels (#1961) 2024-02-20 16:36:29 +08:00
status.rs fix(napi): support custom status in Error (#1486) 2023-02-09 23:18:57 +08:00
task.rs feat(napi): implement AsyncTask with AbortSignal support 2021-11-06 13:51:54 +08:00
threadsafe_function.rs fix(napi): no hard fail on ThreadsafeFunction::call_async (#1970) 2024-02-22 17:34:10 +08:00
tokio_runtime.rs fix(napi): future in block_on do not need to be send 2024-01-24 17:20:31 +08:00
value_type.rs feat(napi): BigInt codegen support 2021-11-11 16:18:25 +08:00
version.rs fix(napi): correct the CString usage 2021-11-15 16:55:13 +08:00