diff options
author | snek <snek@deno.com> | 2024-06-11 17:40:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-11 17:40:44 -0700 |
commit | 3765e6b3a625151e2c0377cad57420e2a82c9943 (patch) | |
tree | 63860ec64b0e0246ade25e5f3cd6935657644295 /ext/napi/value.rs | |
parent | 07437acc74f63c4f2e218c4424ef8fe6cf0f8de2 (diff) |
fix: clean up some node-api details (#24178)
- fix a few napi_* types
- clean up env hooks
- implement blocking queue in tsfn
- reduce transmutes
- use new `DataView::new` api from rusty_v8
Diffstat (limited to 'ext/napi/value.rs')
-rw-r--r-- | ext/napi/value.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ext/napi/value.rs b/ext/napi/value.rs index 6fb96758c..71beac07e 100644 --- a/ext/napi/value.rs +++ b/ext/napi/value.rs @@ -31,9 +31,7 @@ where v8::Local<'s, T>: Into<v8::Local<'s, v8::Value>>, { fn from(v: v8::Local<'s, T>) -> Self { - // SAFETY: It is safe to cast v8::Local<T> that implements Into<v8::Local<v8::Value>>. - // `fn into(self)` transmutes anyways. - Self(unsafe { transmute(v) }, std::marker::PhantomData) + Self(Some(NonNull::from(&*v.into())), std::marker::PhantomData) } } |