From 5bdf7d54d188e3700448d49b2612f1a408192ced Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Thu, 8 Dec 2022 08:06:51 -0500 Subject: [PATCH] deps: V8: cherry-pick d2db7fa7f786 Original commit message: [Intl] Fix nb / no fallback ICU 69 moved content of nb resources to no and let nb fallback to no. This break our original design of checking locale availability. Hard wire to check on no if nb fail for now until we come out with a better fix. Bug: chromium:1215606 Change-Id: I831529d29590cc643ee0109fb2ce8948dac75613 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3068010 Commit-Queue: Frank Tang Reviewed-by: Shu-yu Guo Cr-Commit-Position: refs/heads/master@{#76044} Refs: https://github.com/v8/v8/commit/d2db7fa7f786f7f5cf76b86fc4178ccc4a1f5624 --- common.gypi | 2 +- deps/v8/src/objects/intl-objects.cc | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common.gypi b/common.gypi index 98528bdc9d04e8..b8425d208cadaf 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.87', + 'v8_embedder_string': '-node.88', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/objects/intl-objects.cc b/deps/v8/src/objects/intl-objects.cc index d358e2780e22a6..ca359c85725164 100644 --- a/deps/v8/src/objects/intl-objects.cc +++ b/deps/v8/src/objects/intl-objects.cc @@ -569,7 +569,14 @@ std::set Intl::BuildLocaleSet( for (const std::string& locale : icu_available_locales) { if (path != nullptr || validate_key != nullptr) { if (!ValidateResource(icu::Locale(locale.c_str()), path, validate_key)) { - continue; + // FIXME(chromium:1215606) Find a beter fix for nb->no fallback + if (locale != "nb") { + continue; + } + // Try no for nb + if (!ValidateResource(icu::Locale("no"), path, validate_key)) { + continue; + } } } locales.insert(locale);