diff --git a/src/array_buffer_view.rs b/src/array_buffer_view.rs index bfb5eeff..d7508470 100644 --- a/src/array_buffer_view.rs +++ b/src/array_buffer_view.rs @@ -5,6 +5,7 @@ use crate::support::int; use crate::ArrayBuffer; use crate::ArrayBufferView; use crate::Local; +use crate::ToLocal; extern "C" { fn v8__ArrayBufferView__Buffer( @@ -21,8 +22,11 @@ extern "C" { impl ArrayBufferView { /// Returns underlying ArrayBuffer. - pub fn buffer<'sc>(&self) -> Option> { - unsafe { Local::from_raw(v8__ArrayBufferView__Buffer(self)) } + pub fn buffer<'sc>( + &self, + scope: &'_ mut impl ToLocal<'sc>, + ) -> Option> { + unsafe { scope.to_local(v8__ArrayBufferView__Buffer(self)) } } /// Size of a view in bytes. diff --git a/src/exception.rs b/src/exception.rs index bc41ff13..733aead0 100644 --- a/src/exception.rs +++ b/src/exception.rs @@ -80,7 +80,8 @@ impl StackTrace { ) -> Option> { let isolate = scope.isolate(); unsafe { - Local::from_raw(v8__StackTrace__GetFrame(self, isolate, index as u32)) + let ptr = v8__StackTrace__GetFrame(self, isolate, index as u32); + scope.to_local(ptr) } } }