-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
T::into_instance
by napi-rs (N…
…omicFoundation#907) Rather than hand-rolling it; The codegen uses exactly the same code but with the benefit of abstracting away the unsafe details, getting rid of the only instance of `unsafe` we use. For reference: - `ToNapiValue`/`into_instance`: https://github.com/napi-rs/napi-rs/blob/0550c56fcf8eeec61d2e5abfa00c92a990c34e25/crates/backend/src/codegen/struct.rs#L278-L330 - `JsObject::from_raw_unchecked`/`ClassInstance::as_object`: https://github.com/napi-rs/napi-rs/blob/0550c56fcf8eeec61d2e5abfa00c92a990c34e25/crates/napi/src/bindgen_runtime/js_values/class.rs#L25 Additionally, I changed `Env` to be passed by value since it's a `Copy` newtype wrapper around pointer (no double indirection) and makes the code a bit clearer: no need to additionally dereference with `*`in the related calls, since napi-rs API accepts it by value.
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.