mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
chore: update rusty_v8 to 0.41.0 (#13909)
This commit is contained in:
parent
6ecadf6398
commit
189e2f617e
9 changed files with 14 additions and 20 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -4836,9 +4836,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "v8"
|
name = "v8"
|
||||||
version = "0.40.2"
|
version = "0.41.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "739aa8ce7593f9298bc5a0eb676ba6cb4e48fa0ed51c1aaa2560df7c46c0259b"
|
checksum = "a9c3d267007e1f137d79b4da64267139a86034a4d85df4964334979c1c7a708a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"fslock",
|
"fslock",
|
||||||
|
|
|
@ -25,7 +25,7 @@ serde = { version = "1.0.129", features = ["derive"] }
|
||||||
serde_json = { version = "1.0.66", features = ["preserve_order"] }
|
serde_json = { version = "1.0.66", features = ["preserve_order"] }
|
||||||
serde_v8 = { version = "0.33.0", path = "../serde_v8" }
|
serde_v8 = { version = "0.33.0", path = "../serde_v8" }
|
||||||
url = { version = "2.2.2", features = ["serde"] }
|
url = { version = "2.2.2", features = ["serde"] }
|
||||||
v8 = "0.40.2"
|
v8 = "0.41.0"
|
||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "http_bench_json_ops"
|
name = "http_bench_json_ops"
|
||||||
|
|
|
@ -246,7 +246,8 @@ pub fn set_func(
|
||||||
|
|
||||||
pub extern "C" fn host_import_module_dynamically_callback(
|
pub extern "C" fn host_import_module_dynamically_callback(
|
||||||
context: v8::Local<v8::Context>,
|
context: v8::Local<v8::Context>,
|
||||||
referrer: v8::Local<v8::ScriptOrModule>,
|
_host_defined_options: v8::Local<v8::Data>,
|
||||||
|
resource_name: v8::Local<v8::Value>,
|
||||||
specifier: v8::Local<v8::String>,
|
specifier: v8::Local<v8::String>,
|
||||||
import_assertions: v8::Local<v8::FixedArray>,
|
import_assertions: v8::Local<v8::FixedArray>,
|
||||||
) -> *mut v8::Promise {
|
) -> *mut v8::Promise {
|
||||||
|
@ -257,18 +258,11 @@ pub extern "C" fn host_import_module_dynamically_callback(
|
||||||
.to_string(scope)
|
.to_string(scope)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.to_rust_string_lossy(scope);
|
.to_rust_string_lossy(scope);
|
||||||
let referrer_name = referrer.get_resource_name();
|
let referrer_name_str = resource_name
|
||||||
let referrer_name_str = referrer_name
|
|
||||||
.to_string(scope)
|
.to_string(scope)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.to_rust_string_lossy(scope);
|
.to_rust_string_lossy(scope);
|
||||||
|
|
||||||
// TODO(ry) I'm not sure what HostDefinedOptions is for or if we're ever going
|
|
||||||
// to use it. For now we check that it is not used. This check may need to be
|
|
||||||
// changed in the future.
|
|
||||||
let host_defined_options = referrer.get_host_defined_options();
|
|
||||||
assert_eq!(host_defined_options.length(), 0);
|
|
||||||
|
|
||||||
let resolver = v8::PromiseResolver::new(scope).unwrap();
|
let resolver = v8::PromiseResolver::new(scope).unwrap();
|
||||||
let promise = resolver.get_promise(scope);
|
let promise = resolver.get_promise(scope);
|
||||||
|
|
||||||
|
|
BIN
core/icudtl.dat
BIN
core/icudtl.dat
Binary file not shown.
|
@ -196,9 +196,9 @@ impl Drop for JsRuntime {
|
||||||
fn v8_init(v8_platform: Option<v8::SharedRef<v8::Platform>>) {
|
fn v8_init(v8_platform: Option<v8::SharedRef<v8::Platform>>) {
|
||||||
// Include 10MB ICU data file.
|
// Include 10MB ICU data file.
|
||||||
#[repr(C, align(16))]
|
#[repr(C, align(16))]
|
||||||
struct IcuData([u8; 10144432]);
|
struct IcuData([u8; 10284336]);
|
||||||
static ICU_DATA: IcuData = IcuData(*include_bytes!("icudtl.dat"));
|
static ICU_DATA: IcuData = IcuData(*include_bytes!("icudtl.dat"));
|
||||||
v8::icu::set_common_data_69(&ICU_DATA.0).unwrap();
|
v8::icu::set_common_data_70(&ICU_DATA.0).unwrap();
|
||||||
|
|
||||||
let v8_platform = v8_platform
|
let v8_platform = v8_platform
|
||||||
.unwrap_or_else(|| v8::new_default_platform(0, false).make_shared());
|
.unwrap_or_else(|| v8::new_default_platform(0, false).make_shared());
|
||||||
|
|
|
@ -19,7 +19,7 @@ function assertArrayEquals(a1, a2) {
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
const emptyString = "";
|
const emptyString = "";
|
||||||
const emptyStringSerialized = [255, 14, 34, 0];
|
const emptyStringSerialized = [255, 15, 34, 0];
|
||||||
assertArrayEquals(Deno.core.serialize(emptyString), emptyStringSerialized);
|
assertArrayEquals(Deno.core.serialize(emptyString), emptyStringSerialized);
|
||||||
assert(
|
assert(
|
||||||
Deno.core.deserialize(new Uint8Array(emptyStringSerialized)) ===
|
Deno.core.deserialize(new Uint8Array(emptyStringSerialized)) ===
|
||||||
|
@ -29,7 +29,7 @@ function main() {
|
||||||
const primitiveValueArray = ["test", "a", null, undefined];
|
const primitiveValueArray = ["test", "a", null, undefined];
|
||||||
// deno-fmt-ignore
|
// deno-fmt-ignore
|
||||||
const primitiveValueArraySerialized = [
|
const primitiveValueArraySerialized = [
|
||||||
255, 14, 65, 4, 34, 4, 116, 101, 115, 116,
|
255, 15, 65, 4, 34, 4, 116, 101, 115, 116,
|
||||||
34, 1, 97, 48, 95, 36, 0, 4,
|
34, 1, 97, 48, 95, 36, 0, 4,
|
||||||
];
|
];
|
||||||
assertArrayEquals(
|
assertArrayEquals(
|
||||||
|
@ -48,7 +48,7 @@ function main() {
|
||||||
circularObject.test = circularObject;
|
circularObject.test = circularObject;
|
||||||
// deno-fmt-ignore
|
// deno-fmt-ignore
|
||||||
const circularObjectSerialized = [
|
const circularObjectSerialized = [
|
||||||
255, 14, 111, 34, 4, 116, 101, 115,
|
255, 15, 111, 34, 4, 116, 101, 115,
|
||||||
116, 94, 0, 34, 5, 116, 101, 115,
|
116, 94, 0, 34, 5, 116, 101, 115,
|
||||||
116, 50, 34, 2, 100, 100, 34, 5,
|
116, 50, 34, 2, 100, 100, 34, 5,
|
||||||
116, 101, 115, 116, 51, 34, 2, 97,
|
116, 101, 115, 116, 51, 34, 2, 97,
|
||||||
|
|
|
@ -12,7 +12,7 @@ description = "Rust to V8 serialization and deserialization"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = { version = "1.0.130", features = ["derive"] }
|
serde = { version = "1.0.130", features = ["derive"] }
|
||||||
serde_bytes = "0.11"
|
serde_bytes = "0.11"
|
||||||
v8 = "0.40.2"
|
v8 = "0.41.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
bencher = "0.1"
|
bencher = "0.1"
|
||||||
|
|
|
@ -55,5 +55,5 @@ fn main() {
|
||||||
unsafe {
|
unsafe {
|
||||||
v8::V8::dispose();
|
v8::V8::dispose();
|
||||||
}
|
}
|
||||||
v8::V8::shutdown_platform();
|
v8::V8::dispose_platform();
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ pub fn v8_shutdown() {
|
||||||
unsafe {
|
unsafe {
|
||||||
v8::V8::dispose();
|
v8::V8::dispose();
|
||||||
}
|
}
|
||||||
v8::V8::shutdown_platform();
|
v8::V8::dispose_platform();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn v8_do(f: impl FnOnce()) {
|
pub fn v8_do(f: impl FnOnce()) {
|
||||||
|
|
Loading…
Reference in a new issue