summaryrefslogtreecommitdiff
path: root/js/src/builtin/intl/CommonFunctions.cpp
diff options
context:
space:
mode:
authorMartok <martok@martoks-place.de>2023-06-11 00:54:39 +0200
committerMartok <martok@martoks-place.de>2023-06-30 00:01:27 +0200
commit371ae1639af8cd5d737bfb41f598ffbc5d405786 (patch)
tree19e1eedb466fbb7de282018bb3881f16afbe72d0 /js/src/builtin/intl/CommonFunctions.cpp
parent33ec3d04f26eaa76d67b330621e0758dcf3e2c5d (diff)
downloaduxp-371ae1639af8cd5d737bfb41f598ffbc5d405786.tar.gz
Issue #2259 - Improve ResolveLocale performance when initializing the default Intl objects
Based-on: m-c 1365650
Diffstat (limited to 'js/src/builtin/intl/CommonFunctions.cpp')
-rw-r--r--js/src/builtin/intl/CommonFunctions.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/js/src/builtin/intl/CommonFunctions.cpp b/js/src/builtin/intl/CommonFunctions.cpp
index be07ae4de7..e8723f3cfe 100644
--- a/js/src/builtin/intl/CommonFunctions.cpp
+++ b/js/src/builtin/intl/CommonFunctions.cpp
@@ -92,7 +92,6 @@ js::intl::GetAvailableLocales(JSContext* cx, CountAvailable countAvailable,
return false;
uint32_t count = countAvailable();
- RootedValue t(cx, BooleanValue(true));
for (uint32_t i = 0; i < count; i++) {
const char* locale = getAvailable(i);
auto lang = DuplicateString(cx, locale);
@@ -104,7 +103,7 @@ js::intl::GetAvailableLocales(JSContext* cx, CountAvailable countAvailable,
RootedAtom a(cx, Atomize(cx, lang.get(), strlen(lang.get())));
if (!a)
return false;
- if (!DefineProperty(cx, locales, a->asPropertyName(), t, nullptr, nullptr,
+ if (!DefineProperty(cx, locales, a->asPropertyName(), TrueHandleValue, nullptr, nullptr,
JSPROP_ENUMERATE))
{
return false;