diff --git a/Cargo.lock b/Cargo.lock index b2525c9aea..ea47904bfe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2221,9 +2221,9 @@ dependencies = [ [[package]] name = "rusty_v8" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901a9566b56ddfd49c504fdce35f27d8a6b29088facfd480ab79e95de3f836a1" +checksum = "a50f63f3030b5a676b9f6e7d53bf1f880904973c2350a3f034dbf82facca0b4f" dependencies = [ "bitflags", "cargo_gn", diff --git a/core/Cargo.toml b/core/Cargo.toml index e0486e4fe1..0f9b86a821 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -20,7 +20,7 @@ lazy_static = "1.4.0" libc = "0.2.82" log = "0.4.13" pin-project = "1.0.4" -rusty_v8 = "0.15.0" +rusty_v8 = "0.16.0" serde = { version = "1.0.116", features = ["derive"] } serde_json = { version = "1.0.61", features = ["preserve_order"] } smallvec = "1.6.1" diff --git a/core/bindings.rs b/core/bindings.rs index 20725c0fc1..8a41b60270 100644 --- a/core/bindings.rs +++ b/core/bindings.rs @@ -59,24 +59,18 @@ pub fn script_origin<'a>( s: &mut v8::HandleScope<'a>, resource_name: v8::Local<'a, v8::String>, ) -> v8::ScriptOrigin<'a> { - let resource_line_offset = v8::Integer::new(s, 0); - let resource_column_offset = v8::Integer::new(s, 0); - let resource_is_shared_cross_origin = v8::Boolean::new(s, false); - let script_id = v8::Integer::new(s, 123); let source_map_url = v8::String::new(s, "").unwrap(); - let resource_is_opaque = v8::Boolean::new(s, true); - let is_wasm = v8::Boolean::new(s, false); - let is_module = v8::Boolean::new(s, false); v8::ScriptOrigin::new( + s, resource_name.into(), - resource_line_offset, - resource_column_offset, - resource_is_shared_cross_origin, - script_id, + 0, + 0, + false, + 123, source_map_url.into(), - resource_is_opaque, - is_wasm, - is_module, + true, + false, + false, ) } @@ -84,24 +78,18 @@ pub fn module_origin<'a>( s: &mut v8::HandleScope<'a>, resource_name: v8::Local<'a, v8::String>, ) -> v8::ScriptOrigin<'a> { - let resource_line_offset = v8::Integer::new(s, 0); - let resource_column_offset = v8::Integer::new(s, 0); - let resource_is_shared_cross_origin = v8::Boolean::new(s, false); - let script_id = v8::Integer::new(s, 123); let source_map_url = v8::String::new(s, "").unwrap(); - let resource_is_opaque = v8::Boolean::new(s, true); - let is_wasm = v8::Boolean::new(s, false); - let is_module = v8::Boolean::new(s, true); v8::ScriptOrigin::new( + s, resource_name.into(), - resource_line_offset, - resource_column_offset, - resource_is_shared_cross_origin, - script_id, + 0, + 0, + false, + 123, source_map_url.into(), - resource_is_opaque, - is_wasm, - is_module, + true, + false, + true, ) } diff --git a/runtime/inspector.rs b/runtime/inspector.rs index 0a2a236f29..08493c5def 100644 --- a/runtime/inspector.rs +++ b/runtime/inspector.rs @@ -405,7 +405,7 @@ enum PollState { pub struct DenoInspector { v8_inspector_client: v8::inspector::V8InspectorClientBase, - v8_inspector: v8::UniqueRef, + v8_inspector: v8::UniquePtr, sessions: RefCell, flags: RefCell, waker: Arc, @@ -417,13 +417,13 @@ pub struct DenoInspector { impl Deref for DenoInspector { type Target = v8::inspector::V8Inspector; fn deref(&self) -> &Self::Target { - &self.v8_inspector + self.v8_inspector.as_ref().unwrap() } } impl DerefMut for DenoInspector { fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.v8_inspector + self.v8_inspector.as_mut().unwrap() } } @@ -494,8 +494,6 @@ impl DenoInspector { let mut self_ = new_box_with(|self_ptr| { let v8_inspector_client = v8::inspector::V8InspectorClientBase::new::(); - let v8_inspector = - v8::inspector::V8Inspector::create(scope, unsafe { &mut *self_ptr }); let sessions = InspectorSessions::new(self_ptr, new_websocket_rx); let flags = InspectorFlags::new(); @@ -519,7 +517,7 @@ impl DenoInspector { Self { v8_inspector_client, - v8_inspector, + v8_inspector: Default::default(), sessions, flags, waker, @@ -528,6 +526,8 @@ impl DenoInspector { debugger_url, } }); + self_.v8_inspector = + v8::inspector::V8Inspector::create(scope, &mut *self_).into(); // Tell the inspector about the global context. let context = v8::Local::new(scope, context);