summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2021-10-27 23:26:15 +0200
committerGitHub <noreply@github.com>2021-10-27 23:26:15 +0200
commitbe68b82eb43f8e6156bad562b292af11776d38b8 (patch)
tree3df7fe56e42ff5097a58964c2ea0f48dffad470e
parent09dd77c13edf59eb3748b5f21bd8b7141d822f61 (diff)
chore: update to rusty_v8 0.33.0 (#12564)
-rw-r--r--Cargo.lock30
-rw-r--r--Cargo.toml4
-rw-r--r--cli/compat/mod.rs2
-rw-r--r--core/Cargo.toml2
-rw-r--r--core/bindings.rs3
-rw-r--r--core/error.rs1
-rw-r--r--core/flags.rs1
-rw-r--r--core/inspector.rs1
-rw-r--r--core/lib.rs2
-rw-r--r--core/modules.rs2
-rw-r--r--core/ops.rs1
-rw-r--r--core/ops_builtin.rs2
-rw-r--r--core/runtime.rs28
-rw-r--r--serde_v8/Cargo.toml2
-rw-r--r--serde_v8/benches/de.rs1
-rw-r--r--serde_v8/benches/ser.rs2
-rw-r--r--serde_v8/examples/basic.rs2
-rw-r--r--serde_v8/src/de.rs1
-rw-r--r--serde_v8/src/keys.rs2
-rw-r--r--serde_v8/src/magic/buffer.rs2
-rw-r--r--serde_v8/src/magic/value.rs1
-rw-r--r--serde_v8/src/magic/zero_copy_buf.rs1
-rw-r--r--serde_v8/src/payload.rs1
-rw-r--r--serde_v8/src/ser.rs1
-rw-r--r--serde_v8/src/serializable.rs1
-rw-r--r--serde_v8/src/utils.rs1
-rw-r--r--serde_v8/tests/de.rs2
-rw-r--r--serde_v8/tests/magic.rs2
-rw-r--r--serde_v8/tests/ser.rs2
-rw-r--r--tools/wpt/expectation.json48
30 files changed, 47 insertions, 104 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 4d352431f..8eaece96f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -747,12 +747,12 @@ dependencies = [
"log",
"parking_lot",
"pin-project",
- "rusty_v8",
"serde",
"serde_json",
"serde_v8",
"tokio",
"url",
+ "v8",
]
[[package]]
@@ -3115,19 +3115,6 @@ dependencies = [
]
[[package]]
-name = "rusty_v8"
-version = "0.32.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2b311db3661f6b7631f94ad431133ff0f299c423e6bcc35b748ad0d57d6e604"
-dependencies = [
- "bitflags",
- "fslock",
- "lazy_static",
- "libc",
- "which",
-]
-
-[[package]]
name = "rustyline"
version = "9.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3323,9 +3310,9 @@ name = "serde_v8"
version = "0.16.0"
dependencies = [
"bencher",
- "rusty_v8",
"serde",
"serde_json",
+ "v8",
]
[[package]]
@@ -4538,6 +4525,19 @@ dependencies = [
]
[[package]]
+name = "v8"
+version = "0.33.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b3adb16fd1af3e28d6fda8348a6d96b5363a128dc5a0216b137b64ecbae6641"
+dependencies = [
+ "bitflags",
+ "fslock",
+ "lazy_static",
+ "libc",
+ "which",
+]
+
+[[package]]
name = "vcpkg"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index 83c25c9e5..0f8b7563c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -70,7 +70,7 @@ opt-level = 3
opt-level = 3
[profile.bench.package.num-bigint-dig]
opt-level = 3
-[profile.bench.package.rusty_v8]
+[profile.bench.package.v8]
opt-level = 3
[profile.bench.package.serde_v8]
opt-level = 3
@@ -104,7 +104,7 @@ opt-level = 3
opt-level = 3
[profile.release.package.num-bigint-dig]
opt-level = 3
-[profile.release.package.rusty_v8]
+[profile.release.package.v8]
opt-level = 3
[profile.release.package.serde_v8]
opt-level = 3
diff --git a/cli/compat/mod.rs b/cli/compat/mod.rs
index ac0a34c5a..bcc9473eb 100644
--- a/cli/compat/mod.rs
+++ b/cli/compat/mod.rs
@@ -106,7 +106,7 @@ pub async fn check_if_should_use_esm_loader(
let use_esm_loader_global = js_runtime.resolve_value(result).await?;
let use_esm_loader = {
let scope = &mut js_runtime.handle_scope();
- let use_esm_loader_local = use_esm_loader_global.get(scope);
+ let use_esm_loader_local = use_esm_loader_global.open(scope);
use_esm_loader_local.boolean_value(scope)
};
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);
}
diff --git a/serde_v8/Cargo.toml b/serde_v8/Cargo.toml
index 6fcf62676..ac5d26575 100644
--- a/serde_v8/Cargo.toml
+++ b/serde_v8/Cargo.toml
@@ -10,8 +10,8 @@ repository = "https://github.com/denoland/deno"
description = "Rust to V8 serialization and deserialization"
[dependencies]
-rusty_v8 = "0.32.0"
serde = { version = "1.0.130", features = ["derive"] }
+v8 = "0.33.0"
[dev-dependencies]
bencher = "0.1"
diff --git a/serde_v8/benches/de.rs b/serde_v8/benches/de.rs
index 6bd4f0f9b..d800a39a5 100644
--- a/serde_v8/benches/de.rs
+++ b/serde_v8/benches/de.rs
@@ -1,7 +1,6 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use bencher::{benchmark_group, benchmark_main, Bencher};
-use rusty_v8 as v8;
use std::convert::TryFrom;
use serde::Deserialize;
diff --git a/serde_v8/benches/ser.rs b/serde_v8/benches/ser.rs
index d62e264cd..1318f9585 100644
--- a/serde_v8/benches/ser.rs
+++ b/serde_v8/benches/ser.rs
@@ -1,8 +1,6 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use bencher::{benchmark_group, benchmark_main, Bencher};
-use rusty_v8 as v8;
-
use serde::Serialize;
use serde_v8::utils::v8_do;
diff --git a/serde_v8/examples/basic.rs b/serde_v8/examples/basic.rs
index 6c24220d4..8bea43bb5 100644
--- a/serde_v8/examples/basic.rs
+++ b/serde_v8/examples/basic.rs
@@ -1,6 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-use rusty_v8 as v8;
-
use serde::Deserialize;
#[derive(Debug, Deserialize)]
diff --git a/serde_v8/src/de.rs b/serde_v8/src/de.rs
index b865547ec..14edfec03 100644
--- a/serde_v8/src/de.rs
+++ b/serde_v8/src/de.rs
@@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-use rusty_v8 as v8;
use serde::de::{self, Visitor};
use serde::Deserialize;
diff --git a/serde_v8/src/keys.rs b/serde_v8/src/keys.rs
index ea989086c..783b7aaef 100644
--- a/serde_v8/src/keys.rs
+++ b/serde_v8/src/keys.rs
@@ -1,6 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-use rusty_v8 as v8;
-
use std::collections::HashMap;
// KeyCache stores a pool struct keys mapped to v8,
diff --git a/serde_v8/src/magic/buffer.rs b/serde_v8/src/magic/buffer.rs
index ef1f395fe..7a3a3b8ee 100644
--- a/serde_v8/src/magic/buffer.rs
+++ b/serde_v8/src/magic/buffer.rs
@@ -1,4 +1,4 @@
-use rusty_v8 as v8;
+// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use std::fmt;
use std::ops::Deref;
diff --git a/serde_v8/src/magic/value.rs b/serde_v8/src/magic/value.rs
index 2cb622466..052230007 100644
--- a/serde_v8/src/magic/value.rs
+++ b/serde_v8/src/magic/value.rs
@@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-use rusty_v8 as v8;
use std::fmt;
use std::marker::PhantomData;
diff --git a/serde_v8/src/magic/zero_copy_buf.rs b/serde_v8/src/magic/zero_copy_buf.rs
index 1e911c329..5c200a842 100644
--- a/serde_v8/src/magic/zero_copy_buf.rs
+++ b/serde_v8/src/magic/zero_copy_buf.rs
@@ -1,6 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-use rusty_v8 as v8;
use std::cell::Cell;
use std::ops::Deref;
use std::ops::DerefMut;
diff --git a/serde_v8/src/payload.rs b/serde_v8/src/payload.rs
index a9fb045e3..cad9bc868 100644
--- a/serde_v8/src/payload.rs
+++ b/serde_v8/src/payload.rs
@@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-use rusty_v8 as v8;
// TODO: maybe add a Payload type that holds scope & v8::Value
// so it can implement Deserialize by itself
diff --git a/serde_v8/src/ser.rs b/serde_v8/src/ser.rs
index a2a57d62e..386e46019 100644
--- a/serde_v8/src/ser.rs
+++ b/serde_v8/src/ser.rs
@@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-use rusty_v8 as v8;
use serde::ser;
use serde::ser::Serialize;
diff --git a/serde_v8/src/serializable.rs b/serde_v8/src/serializable.rs
index c9182b636..6cb638440 100644
--- a/serde_v8/src/serializable.rs
+++ b/serde_v8/src/serializable.rs
@@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-use rusty_v8 as v8;
use std::any::TypeId;
use std::mem::transmute_copy;
diff --git a/serde_v8/src/utils.rs b/serde_v8/src/utils.rs
index 6f638f7b3..f18d2269c 100644
--- a/serde_v8/src/utils.rs
+++ b/serde_v8/src/utils.rs
@@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-use rusty_v8 as v8;
use std::sync::Once;
pub fn js_exec<'s>(
diff --git a/serde_v8/tests/de.rs b/serde_v8/tests/de.rs
index 888bff4f4..366d6d2b5 100644
--- a/serde_v8/tests/de.rs
+++ b/serde_v8/tests/de.rs
@@ -1,6 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-use rusty_v8 as v8;
-
use serde::Deserialize;
use serde_v8::utils::{js_exec, v8_do};
diff --git a/serde_v8/tests/magic.rs b/serde_v8/tests/magic.rs
index 95ad3eb55..15b318baf 100644
--- a/serde_v8/tests/magic.rs
+++ b/serde_v8/tests/magic.rs
@@ -1,6 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-use rusty_v8 as v8;
-
use serde::{Deserialize, Serialize};
use serde_v8::utils::{js_exec, v8_do};
diff --git a/serde_v8/tests/ser.rs b/serde_v8/tests/ser.rs
index c3ada7a6e..951c16d55 100644
--- a/serde_v8/tests/ser.rs
+++ b/serde_v8/tests/ser.rs
@@ -1,6 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-use rusty_v8 as v8;
-
use serde::Serialize;
use serde_json::json;
use serde_v8::utils::{js_exec, v8_do};
diff --git a/tools/wpt/expectation.json b/tools/wpt/expectation.json
index 6bcaf576f..c80aeea25 100644
--- a/tools/wpt/expectation.json
+++ b/tools/wpt/expectation.json
@@ -6709,33 +6709,15 @@
"toString.any.html": true,
"toString.any.worker.html": true
},
- "prototypes.any.html": false,
- "prototypes.any.worker.html": false,
+ "prototypes.any.html": true,
+ "prototypes.any.worker.html": true,
"table": {
- "constructor.any.html": [
- "initialize externref table with default value"
- ],
- "constructor.any.worker.html": [
- "initialize externref table with default value"
- ],
- "get-set.any.html": [
- "Arguments for anyfunc table set",
- "Arguments for externref table set"
- ],
- "get-set.any.worker.html": [
- "Arguments for anyfunc table set",
- "Arguments for externref table set"
- ],
- "grow.any.html": [
- "Grow with exported-function argument",
- "Grow with non-function argument",
- "Grow with JS-function argument"
- ],
- "grow.any.worker.html": [
- "Grow with exported-function argument",
- "Grow with non-function argument",
- "Grow with JS-function argument"
- ],
+ "constructor.any.html": true,
+ "constructor.any.worker.html": true,
+ "get-set.any.html": true,
+ "get-set.any.worker.html": true,
+ "grow.any.html": true,
+ "grow.any.worker.html": true,
"length.any.html": true,
"length.any.worker.html": true,
"toString.any.html": true,
@@ -6746,18 +6728,8 @@
"type.tentative.any.worker.html": false
},
"exception": {
- "basic.tentative.any.html": [
- "Wasm function throws argument",
- "Wasm function throws null",
- "Imported JS function throws",
- "Imported JS function throws, Wasm catches and rethrows"
- ],
- "basic.tentative.any.worker.html": [
- "Wasm function throws argument",
- "Wasm function throws null",
- "Imported JS function throws",
- "Imported JS function throws, Wasm catches and rethrows"
- ],
+ "basic.tentative.any.html": true,
+ "basic.tentative.any.worker.html": true,
"constructor.tentative.any.html": true,
"constructor.tentative.any.worker.html": true,
"getArg.tentative.any.html": true,