summaryrefslogtreecommitdiff
path: root/deps/v8/src/objects/js-collator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/objects/js-collator.cc')
-rw-r--r--deps/v8/src/objects/js-collator.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/deps/v8/src/objects/js-collator.cc b/deps/v8/src/objects/js-collator.cc
index 3c2efa93db..dd927f02dc 100644
--- a/deps/v8/src/objects/js-collator.cc
+++ b/deps/v8/src/objects/js-collator.cc
@@ -45,7 +45,7 @@ void CreateDataPropertyForOptions(Isolate* isolate, Handle<JSObject> options,
// This is a brand new JSObject that shouldn't already have the same
// key so this shouldn't fail.
CHECK(JSReceiver::CreateDataProperty(isolate, options, key, value_str,
- kDontThrow)
+ Just(kDontThrow))
.FromJust());
}
@@ -56,7 +56,7 @@ void CreateDataPropertyForOptions(Isolate* isolate, Handle<JSObject> options,
// This is a brand new JSObject that shouldn't already have the same
// key so this shouldn't fail.
CHECK(JSReceiver::CreateDataProperty(isolate, options, key, value_obj,
- kDontThrow)
+ Just(kDontThrow))
.FromJust());
}
@@ -484,11 +484,10 @@ MaybeHandle<JSCollator> JSCollator::Initialize(Isolate* isolate,
return collator;
}
-std::set<std::string> JSCollator::GetAvailableLocales() {
- int32_t num_locales = 0;
- const icu::Locale* icu_available_locales =
- icu::Collator::getAvailableLocales(num_locales);
- return Intl::BuildLocaleSet(icu_available_locales, num_locales);
+const std::set<std::string>& JSCollator::GetAvailableLocales() {
+ static base::LazyInstance<Intl::AvailableLocales<icu::Collator>>::type
+ available_locales = LAZY_INSTANCE_INITIALIZER;
+ return available_locales.Pointer()->Get();
}
} // namespace internal