diff --git a/Cargo.lock b/Cargo.lock index f2dadefeaf0..d710f2970bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1677,6 +1677,12 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26bf8fc351c5ed29b5c2f0cbbac1b209b74f60ecd62e675a998df72c49af5204" +[[package]] +name = "deno_core_icudata" +version = "0.77.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9efff8990a82c1ae664292507e1a5c6749ddd2312898cdf9cd7cb1fd4bc64c6" + [[package]] name = "deranged" version = "0.5.4" @@ -7680,6 +7686,7 @@ dependencies = [ "criterion", "crossbeam-channel", "crossbeam-queue", + "deno_core_icudata", "derive_more 0.99.20", "dirs 5.0.1", "enum-as-inner", diff --git a/Cargo.toml b/Cargo.toml index 369cb19b669..416fd7f65df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -325,6 +325,9 @@ uuid = { version = "1.18.1", default-features = false } # When updating the V8 crate, either update the version and hashes in that file, # or ping phoebe @gefjon to do so. v8 = "=145.0.0" +# This version is kept in sync with the version of ICU required by v8. +# When that changes, the `v8::icu::set_common_data_XX()` function is renamed. +deno_core_icudata = "0.77" walkdir = "2.2.5" wasmbin = "0.6" diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index 3ec0b44e251..f7b4c909d37 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -51,6 +51,7 @@ bytestring.workspace = true chrono.workspace = true crossbeam-channel.workspace = true crossbeam-queue.workspace = true +deno_core_icudata.workspace = true derive_more.workspace = true dirs.workspace = true enum-as-inner.workspace = true diff --git a/crates/core/src/host/v8/mod.rs b/crates/core/src/host/v8/mod.rs index e21a08e5747..eb4f374ea94 100644 --- a/crates/core/src/host/v8/mod.rs +++ b/crates/core/src/host/v8/mod.rs @@ -104,6 +104,13 @@ impl V8RuntimeInner { /// /// Should only be called once but it isn't unsound to call it more times. fn init() -> Self { + // If the number in the name of this function is changed, update the version + // of the `deno_core_icudata` dep to match the number in the function name. + v8::icu::set_common_data_77(deno_core_icudata::ICU_DATA).ok(); + // Set a default locale for functions like `toLocaleString()`. + // en-001 is "International English". + v8::icu::set_default_locale("en-001"); + // We don't want idle tasks nor background worker tasks, // as we intend to run on a single core. // Per the docs, `new_single_threaded_default_platform` requires