#ifndef V8_INTL_SUPPORT
#error Internationalization is expected to be enabled.
#endif
#include "src/objects/js-display-names.h"
#include <memory>
#include <vector>
#include "src/execution/isolate.h"
#include "src/heap/factory.h"
#include "src/objects/intl-objects.h"
#include "src/objects/js-display-names-inl.h"
#include "src/objects/js-locale.h"
#include "src/objects/managed-inl.h"
#include "src/objects/objects-inl.h"
#include "src/objects/option-utils.h"
#include "unicode/dtfmtsym.h"
#include "unicode/dtptngen.h"
#include "unicode/localebuilder.h"
#include "unicode/locdspnm.h"
#include "unicode/measfmt.h"
#include "unicode/timezone.h"
#include "unicode/tznames.h"
#include "unicode/uloc.h"
#include "unicode/unistr.h"
#include "unicode/uscript.h"
namespace v8 {
namespace internal {
namespace {
enum class Type { … };
bool IsUnicodeScriptSubtag(const std::string& value) { … }
bool IsUnicodeRegionSubtag(const std::string& value) { … }
UDisplayContext ToUDisplayContext(JSDisplayNames::Style style) { … }
}
class DisplayNamesInternal { … };
namespace {
class LocaleDisplayNamesCommon : public DisplayNamesInternal { … };
class LanguageNames : public LocaleDisplayNamesCommon { … };
class RegionNames : public LocaleDisplayNamesCommon { … };
class ScriptNames : public LocaleDisplayNamesCommon { … };
class KeyValueDisplayNames : public LocaleDisplayNamesCommon { … };
class CurrencyNames : public KeyValueDisplayNames { … };
class CalendarNames : public KeyValueDisplayNames { … };
UDateTimePGDisplayWidth StyleToUDateTimePGDisplayWidth(
JSDisplayNames::Style style) { … }
UDateTimePatternField StringToUDateTimePatternField(const char* code) { … }
class DateTimeFieldNames : public DisplayNamesInternal { … };
DisplayNamesInternal* CreateInternal(const icu::Locale& locale,
JSDisplayNames::Style style, Type type,
bool fallback, bool dialect) { … }
}
MaybeHandle<JSDisplayNames> JSDisplayNames::New(Isolate* isolate,
DirectHandle<Map> map,
Handle<Object> locales,
Handle<Object> input_options) { … }
Handle<JSObject> JSDisplayNames::ResolvedOptions(
Isolate* isolate, DirectHandle<JSDisplayNames> display_names) { … }
MaybeHandle<Object> JSDisplayNames::Of(
Isolate* isolate, DirectHandle<JSDisplayNames> display_names,
Handle<Object> code_obj) { … }
namespace {
struct CheckCalendar { … };
}
const std::set<std::string>& JSDisplayNames::GetAvailableLocales() { … }
Handle<String> JSDisplayNames::StyleAsString() const { … }
Handle<String> JSDisplayNames::FallbackAsString() const { … }
Handle<String> JSDisplayNames::LanguageDisplayAsString() const { … }
}
}