diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/Cargo.toml | 2 | ||||
-rw-r--r-- | core/bindings.rs | 3 | ||||
-rw-r--r-- | core/error.rs | 1 | ||||
-rw-r--r-- | core/flags.rs | 1 | ||||
-rw-r--r-- | core/inspector.rs | 1 | ||||
-rw-r--r-- | core/lib.rs | 2 | ||||
-rw-r--r-- | core/modules.rs | 2 | ||||
-rw-r--r-- | core/ops.rs | 1 | ||||
-rw-r--r-- | core/ops_builtin.rs | 2 | ||||
-rw-r--r-- | core/runtime.rs | 28 |
10 files changed, 17 insertions, 26 deletions
diff --git a/core/Cargo.toml b/core/Cargo.toml index 94da16776..089826ec6 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -21,11 +21,11 @@ lazy_static = "1.4.0" log = "0.4.14" parking_lot = "0.11.1" pin-project = "1.0.7" -rusty_v8 = "0.32.0" serde = { version = "1.0.129", features = ["derive"] } serde_json = { version = "1.0.66", features = ["preserve_order"] } serde_v8 = { version = "0.16.0", path = "../serde_v8" } url = { version = "2.2.2", features = ["serde"] } +v8 = "0.33.0" [[example]] name = "http_bench_json_ops" diff --git a/core/bindings.rs b/core/bindings.rs index fc86a1136..2ba8059a0 100644 --- a/core/bindings.rs +++ b/core/bindings.rs @@ -13,7 +13,6 @@ use crate::OpTable; use crate::PromiseId; use crate::ZeroCopyBuf; use log::debug; -use rusty_v8 as v8; use serde::Deserialize; use serde::Serialize; use serde_v8::to_v8; @@ -633,7 +632,7 @@ fn set_wasm_streaming_callback( let undefined = v8::undefined(scope); let rid = serde_v8::to_v8(scope, streaming_rid).unwrap(); cb_handle - .get(scope) + .open(scope) .call(scope, undefined.into(), &[arg, rid]); }); } diff --git a/core/error.rs b/core/error.rs index 88cb06887..b94b7f192 100644 --- a/core/error.rs +++ b/core/error.rs @@ -3,7 +3,6 @@ pub use anyhow::anyhow; pub use anyhow::bail; pub use anyhow::Context; -use rusty_v8 as v8; use std::borrow::Cow; use std::convert::TryFrom; use std::convert::TryInto; diff --git a/core/flags.rs b/core/flags.rs index af64df64e..78ed08125 100644 --- a/core/flags.rs +++ b/core/flags.rs @@ -1,6 +1,5 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. -use rusty_v8 as v8; /// Pass the command line arguments to v8. /// Returns a vector of command line arguments that V8 did not understand. pub fn v8_set_flags(args: Vec<String>) -> Vec<String> { diff --git a/core/inspector.rs b/core/inspector.rs index c4dddc5d6..3e84bcd58 100644 --- a/core/inspector.rs +++ b/core/inspector.rs @@ -22,7 +22,6 @@ use crate::futures::task::Poll; use crate::serde_json; use crate::serde_json::json; use crate::serde_json::Value; -use crate::v8; use parking_lot::Mutex; use std::cell::BorrowMutError; use std::cell::RefCell; diff --git a/core/lib.rs b/core/lib.rs index 889f613df..eff1397cf 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -20,7 +20,6 @@ mod runtime; // Re-exports pub use futures; pub use parking_lot; -pub use rusty_v8 as v8; pub use serde; pub use serde_json; pub use serde_v8; @@ -28,6 +27,7 @@ pub use serde_v8::Buffer as ZeroCopyBuf; pub use serde_v8::ByteString; pub use serde_v8::StringOrBuffer; pub use url; +pub use v8; pub use crate::async_cancel::CancelFuture; pub use crate::async_cancel::CancelHandle; diff --git a/core/modules.rs b/core/modules.rs index 31e03196a..ba7db507e 100644 --- a/core/modules.rs +++ b/core/modules.rs @@ -1,7 +1,5 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. -use rusty_v8 as v8; - use crate::bindings; use crate::error::generic_error; use crate::error::AnyError; diff --git a/core/ops.rs b/core/ops.rs index 20b14ec39..ab233ef29 100644 --- a/core/ops.rs +++ b/core/ops.rs @@ -13,7 +13,6 @@ use futures::ready; use futures::task::noop_waker; use futures::Future; use indexmap::IndexMap; -use rusty_v8 as v8; use serde::de::DeserializeOwned; use serde::Serialize; use std::cell::RefCell; diff --git a/core/ops_builtin.rs b/core/ops_builtin.rs index c830f8eff..d33565caf 100644 --- a/core/ops_builtin.rs +++ b/core/ops_builtin.rs @@ -98,7 +98,7 @@ pub fn op_print( Ok(()) } -pub struct WasmStreamingResource(pub(crate) RefCell<rusty_v8::WasmStreaming>); +pub struct WasmStreamingResource(pub(crate) RefCell<v8::WasmStreaming>); impl Resource for WasmStreamingResource { fn close(self: Rc<Self>) { diff --git a/core/runtime.rs b/core/runtime.rs index e453b453f..327662e7c 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -1,7 +1,5 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. -use rusty_v8 as v8; - use crate::bindings; use crate::error::attach_handle_to_error; use crate::error::generic_error; @@ -529,7 +527,7 @@ impl JsRuntime { let scope = &mut self.handle_scope(); let state_rc = JsRuntime::state(scope); let js_sync_cb_handle = state_rc.borrow().js_sync_cb.clone().unwrap(); - let js_sync_cb = js_sync_cb_handle.get(scope); + let js_sync_cb = js_sync_cb_handle.open(scope); let this = v8::undefined(scope).into(); js_sync_cb.call(scope, this, &[]); } @@ -995,7 +993,7 @@ impl JsRuntime { let status = { let scope = &mut self.handle_scope(); - let module = module_handle.get(scope); + let module = module_handle.open(scope); module.get_status() }; @@ -1142,7 +1140,7 @@ impl JsRuntime { .dynamic_import_map .remove(&id) .expect("Invalid dynamic import id"); - let resolver = resolver_handle.get(scope); + let resolver = resolver_handle.open(scope); let exception = err .downcast_ref::<ErrWithV8Handle>() @@ -1171,7 +1169,7 @@ impl JsRuntime { .dynamic_import_map .remove(&id) .expect("Invalid dynamic import id"); - let resolver = resolver_handle.get(scope); + let resolver = resolver_handle.open(scope); let module = { module_map_rc @@ -1328,7 +1326,7 @@ impl JsRuntime { let module_evaluation = maybe_module_evaluation.unwrap(); let scope = &mut self.handle_scope(); - let promise = module_evaluation.promise.get(scope); + let promise = module_evaluation.promise.open(scope); let promise_state = promise.state(); match promise_state { @@ -1364,8 +1362,8 @@ impl JsRuntime { let scope = &mut self.handle_scope(); let module_id = pending_dyn_evaluate.module_id; - let promise = pending_dyn_evaluate.promise.get(scope); - let _module = pending_dyn_evaluate.module.get(scope); + let promise = pending_dyn_evaluate.promise.open(scope); + let _module = pending_dyn_evaluate.module.open(scope); let promise_state = promise.state(); match promise_state { @@ -1545,7 +1543,7 @@ impl JsRuntime { } let tc_scope = &mut v8::TryCatch::new(scope); - let js_recv_cb = js_recv_cb_handle.get(tc_scope); + let js_recv_cb = js_recv_cb_handle.open(tc_scope); let this = v8::undefined(tc_scope).into(); js_recv_cb.call(tc_scope, this, args.as_slice()); @@ -1563,7 +1561,7 @@ impl JsRuntime { }; let scope = &mut self.handle_scope(); - let js_macrotask_cb = js_macrotask_cb_handle.get(scope); + let js_macrotask_cb = js_macrotask_cb_handle.open(scope); // Repeatedly invoke macrotask callback until it returns true (done), // such that ready microtasks would be automatically run before @@ -1729,13 +1727,13 @@ pub mod tests { let value_global = runtime.execute_script("a.js", "a = 1 + 2").unwrap(); { let scope = &mut runtime.handle_scope(); - let value = value_global.get(scope); + let value = value_global.open(scope); assert_eq!(value.integer_value(scope).unwrap(), 3); } let value_global = runtime.execute_script("b.js", "b = 'foobar'").unwrap(); { let scope = &mut runtime.handle_scope(); - let value = value_global.get(scope); + let value = value_global.open(scope); assert!(value.is_string()); assert_eq!( value.to_string(scope).unwrap().to_rust_string_lossy(scope), @@ -1753,7 +1751,7 @@ pub mod tests { let result_global = runtime.resolve_value(value_global).await.unwrap(); { let scope = &mut runtime.handle_scope(); - let value = result_global.get(scope); + let value = result_global.open(scope); assert_eq!(value.integer_value(scope).unwrap(), 3); } @@ -1766,7 +1764,7 @@ pub mod tests { let result_global = runtime.resolve_value(value_global).await.unwrap(); { let scope = &mut runtime.handle_scope(); - let value = result_global.get(scope); + let value = result_global.open(scope); assert_eq!(value.integer_value(scope).unwrap(), 4); } |