diff --git a/.gitmodules b/.gitmodules index bab7f0717a..fc90f02671 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,3 @@ -[submodule "v8"] - path = v8 - url = https://chromium.googlesource.com/v8/v8 -[submodule "build"] - path = build - url = https://github.com/denoland/chromium_build.git [submodule "tools/clang"] path = tools/clang url = https://chromium.googlesource.com/chromium/src/tools/clang.git @@ -22,3 +16,12 @@ [submodule "third_party/zlib"] path = third_party/zlib url = https://chromium.googlesource.com/chromium/src/third_party/zlib.git +[submodule "v8"] + path = v8 + url = https://github.com/kishiguro/chromium_v8.git +[submodule "build"] + path = build + url = https://github.com/kishiguro/chromium_build.git +[submodule "third_party/icu"] + path = third_party/icu + url = https://github.com/kishiguro/icu.git diff --git a/.gn b/.gn index b21600ab8d..5c74f7572b 100644 --- a/.gn +++ b/.gn @@ -28,7 +28,7 @@ default_args = { # https://cs.chromium.org/chromium/src/docs/ccache_mac.md clang_use_chrome_plugins = false - v8_enable_i18n_support = false + v8_enable_i18n_support = true v8_monolithic = false v8_use_external_startup_data = false v8_use_snapshot = true diff --git a/build b/build index f503a500c8..df0e2bd801 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit f503a500c8d6da6c1fb525d445a431c6ff8a37ed +Subproject commit df0e2bd8017ac31be8c4797e4d33afe979f8733b diff --git a/tests/test_api.rs b/tests/test_api.rs index 5f1a84d299..72f5e531e3 100644 --- a/tests/test_api.rs +++ b/tests/test_api.rs @@ -2937,3 +2937,39 @@ fn module_snapshot() { } } } + +#[test] +fn icu_date() { + let _setup_guard = setup(); + let isolate = &mut v8::Isolate::new(Default::default()); + { + let scope = &mut v8::HandleScope::new(isolate); + let context = v8::Context::new(scope); + let scope = &mut v8::ContextScope::new(scope, context); + let source = r#" + (new Date(Date.UTC(2020, 5, 26, 7, 0, 0))).toLocaleString("de-DE", {weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }); + "#; + let value = eval(scope, source).unwrap(); + let date_de_val = v8::String::new(scope, "Freitag, 26. Juni 2020").unwrap(); + assert!(value.is_string()); + assert!(value.strict_equals(date_de_val.into())); + } +} + +#[test] +fn icu_format() { + let _setup_guard = setup(); + let isolate = &mut v8::Isolate::new(Default::default()); + { + let scope = &mut v8::HandleScope::new(isolate); + let context = v8::Context::new(scope); + let scope = &mut v8::ContextScope::new(scope, context); + let source = r#" + new Intl.NumberFormat('ja-JP',{ style: 'currency',currency: 'JPY'}).format(1230000); + "#; + let value = eval(scope, source).unwrap(); + let currency_jpy_val = v8::String::new(scope, "¥1,230,000").unwrap(); + assert!(value.is_string()); + assert!(value.strict_equals(currency_jpy_val.into())); + } +} diff --git a/third_party/icu b/third_party/icu new file mode 160000 index 0000000000..aec8e1ee29 --- /dev/null +++ b/third_party/icu @@ -0,0 +1 @@ +Subproject commit aec8e1ee291e3cc620e01560c8f7b60458c3bf3b diff --git a/v8 b/v8 index fb20b5d83e..54ef28208a 160000 --- a/v8 +++ b/v8 @@ -1 +1 @@ -Subproject commit fb20b5d83e381586c7b16fc7aad554eaa5432416 +Subproject commit 54ef28208aa61eb818fe460c62f7b918d5fc77e3