chromium/v8/src/builtins/builtins-intl.cc

// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_INTL_SUPPORT
#error Internationalization is expected to be enabled.
#endif  // V8_INTL_SUPPORT

#include <cmath>
#include <list>
#include <memory>

#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/date/date.h"
#include "src/logging/counters.h"
#include "src/objects/elements.h"
#include "src/objects/intl-objects.h"
#include "src/objects/js-array-inl.h"
#include "src/objects/js-break-iterator-inl.h"
#include "src/objects/js-collator-inl.h"
#include "src/objects/js-date-time-format-inl.h"
#include "src/objects/js-display-names-inl.h"
#include "src/objects/js-duration-format-inl.h"
#include "src/objects/js-list-format-inl.h"
#include "src/objects/js-locale-inl.h"
#include "src/objects/js-number-format-inl.h"
#include "src/objects/js-plural-rules-inl.h"
#include "src/objects/js-relative-time-format-inl.h"
#include "src/objects/js-segment-iterator-inl.h"
#include "src/objects/js-segmenter-inl.h"
#include "src/objects/js-segments-inl.h"
#include "src/objects/objects-inl.h"
#include "src/objects/option-utils.h"
#include "src/objects/property-descriptor.h"
#include "src/objects/smi.h"
#include "unicode/brkiter.h"

namespace v8 {
namespace internal {

BUILTIN(StringPrototypeToUpperCaseIntl) {}

BUILTIN(StringPrototypeNormalizeIntl) {}

BUILTIN(V8BreakIteratorSupportedLocalesOf) {}

BUILTIN(NumberFormatSupportedLocalesOf) {}

BUILTIN(NumberFormatPrototypeFormatToParts) {}

BUILTIN(DateTimeFormatPrototypeResolvedOptions) {}

BUILTIN(DateTimeFormatSupportedLocalesOf) {}

BUILTIN(DateTimeFormatPrototypeFormatToParts) {}

// Common code for DateTimeFormatPrototypeFormtRange(|ToParts)
template <class T, MaybeHandle<T> (*F)(Isolate*, Handle<JSDateTimeFormat>,
                                       Handle<Object>, Handle<Object>,
                                       const char* const)>
V8_WARN_UNUSED_RESULT Tagged<Object> DateTimeFormatRange(
    BuiltinArguments args, Isolate* isolate, const char* const method_name) {}

BUILTIN(DateTimeFormatPrototypeFormatRange) {}

BUILTIN(DateTimeFormatPrototypeFormatRangeToParts) {}

namespace {

Handle<JSFunction> CreateBoundFunction(Isolate* isolate,
                                       DirectHandle<JSObject> object,
                                       Builtin builtin, int len) {}

/**
 * Common code shared between DateTimeFormatConstructor and
 * NumberFormatConstrutor
 */
template <class T>
Tagged<Object> LegacyFormatConstructor(BuiltinArguments args, Isolate* isolate,
                                       v8::Isolate::UseCounterFeature feature,
                                       Handle<Object> constructor,
                                       const char* method_name) {}

/**
 * Common code shared by ListFormat, RelativeTimeFormat, PluralRules, and
 * Segmenter
 */
template <class T>
Tagged<Object> DisallowCallConstructor(BuiltinArguments args, Isolate* isolate,
                                       v8::Isolate::UseCounterFeature feature,
                                       const char* method_name) {}

/**
 * Common code shared by Collator and V8BreakIterator
 */
template <class T>
Tagged<Object> CallOrConstructConstructor(BuiltinArguments args,
                                          Isolate* isolate,
                                          const char* method_name) {}

}  // namespace

// Intl.DisplayNames

BUILTIN(DisplayNamesConstructor) {}

BUILTIN(DisplayNamesPrototypeResolvedOptions) {}

BUILTIN(DisplayNamesSupportedLocalesOf) {}

BUILTIN(DisplayNamesPrototypeOf) {}

// Intl.DurationFormat
BUILTIN(DurationFormatConstructor) {}

BUILTIN(DurationFormatPrototypeResolvedOptions) {}

BUILTIN(DurationFormatSupportedLocalesOf) {}

BUILTIN(DurationFormatPrototypeFormat) {}

BUILTIN(DurationFormatPrototypeFormatToParts) {}

// Intl.NumberFormat

BUILTIN(NumberFormatConstructor) {}

BUILTIN(NumberFormatPrototypeResolvedOptions) {}

BUILTIN(NumberFormatPrototypeFormatNumber) {}

BUILTIN(NumberFormatInternalFormatNumber) {}

// Common code for NumberFormatPrototypeFormtRange(|ToParts)
template <class T, MaybeHandle<T> (*F)(Isolate*, DirectHandle<JSNumberFormat>,
                                       Handle<Object>, Handle<Object>)>
V8_WARN_UNUSED_RESULT Tagged<Object> NumberFormatRange(
    BuiltinArguments args, Isolate* isolate, const char* const method_name) {}

BUILTIN(NumberFormatPrototypeFormatRange) {}

BUILTIN(NumberFormatPrototypeFormatRangeToParts) {}

BUILTIN(DateTimeFormatConstructor) {}

BUILTIN(DateTimeFormatPrototypeFormat) {}

BUILTIN(DateTimeFormatInternalFormat) {}

BUILTIN(IntlGetCanonicalLocales) {}

BUILTIN(IntlSupportedValuesOf) {}

BUILTIN(ListFormatConstructor) {}

BUILTIN(ListFormatPrototypeResolvedOptions) {}

BUILTIN(ListFormatSupportedLocalesOf) {}

// Intl.Locale implementation
BUILTIN(LocaleConstructor) {}

BUILTIN(LocalePrototypeMaximize) {}

BUILTIN(LocalePrototypeMinimize) {}

BUILTIN(LocalePrototypeGetCalendars) {}

BUILTIN(LocalePrototypeGetCollations) {}

BUILTIN(LocalePrototypeGetHourCycles) {}

BUILTIN(LocalePrototypeGetNumberingSystems) {}

BUILTIN(LocalePrototypeGetTextInfo) {}

BUILTIN(LocalePrototypeGetTimeZones) {}

BUILTIN(LocalePrototypeGetWeekInfo) {}

BUILTIN(LocalePrototypeCalendars) {}

BUILTIN(LocalePrototypeCollations) {}

BUILTIN(LocalePrototypeHourCycles) {}

BUILTIN(LocalePrototypeNumberingSystems) {}

BUILTIN(LocalePrototypeTextInfo) {}

BUILTIN(LocalePrototypeTimeZones) {}

BUILTIN(LocalePrototypeWeekInfo) {}

BUILTIN(RelativeTimeFormatSupportedLocalesOf) {}

BUILTIN(RelativeTimeFormatPrototypeFormat) {}

BUILTIN(RelativeTimeFormatPrototypeFormatToParts) {}

// Locale getters.
BUILTIN(LocalePrototypeLanguage) {}

BUILTIN(LocalePrototypeScript) {}

BUILTIN(LocalePrototypeRegion) {}

BUILTIN(LocalePrototypeBaseName) {}

BUILTIN(LocalePrototypeCalendar) {}

BUILTIN(LocalePrototypeCaseFirst) {}

BUILTIN(LocalePrototypeCollation) {}

BUILTIN(LocalePrototypeFirstDayOfWeek) {}

BUILTIN(LocalePrototypeHourCycle) {}

BUILTIN(LocalePrototypeNumeric) {}

BUILTIN(LocalePrototypeNumberingSystem) {}

BUILTIN(LocalePrototypeToString) {}

BUILTIN(RelativeTimeFormatConstructor) {}

BUILTIN(RelativeTimeFormatPrototypeResolvedOptions) {}

bool IsFastLocale(Tagged<Object> maybe_locale) {}

BUILTIN(StringPrototypeToLocaleUpperCase) {}

BUILTIN(PluralRulesConstructor) {}

BUILTIN(PluralRulesPrototypeResolvedOptions) {}

BUILTIN(PluralRulesPrototypeSelect) {}

BUILTIN(PluralRulesPrototypeSelectRange) {}

BUILTIN(PluralRulesSupportedLocalesOf) {}

BUILTIN(CollatorConstructor) {}

BUILTIN(CollatorPrototypeResolvedOptions) {}

BUILTIN(CollatorSupportedLocalesOf) {}

BUILTIN(CollatorPrototypeCompare) {}

BUILTIN(CollatorInternalCompare) {}

// ecma402 #sec-%segmentiteratorprototype%.next
BUILTIN(SegmentIteratorPrototypeNext) {}

// ecma402 #sec-intl.segmenter
BUILTIN(SegmenterConstructor) {}

// ecma402 #sec-intl.segmenter.supportedlocalesof
BUILTIN(SegmenterSupportedLocalesOf) {}

// ecma402 #sec-intl.segmenter.prototype.resolvedoptions
BUILTIN(SegmenterPrototypeResolvedOptions) {}

// ecma402 #sec-intl.segmenter.prototype.segment
BUILTIN(SegmenterPrototypeSegment) {}

// ecma402 #sec-%segmentsprototype%.containing
BUILTIN(SegmentsPrototypeContaining) {}

// ecma402 #sec-%segmentsprototype%-@@iterator
BUILTIN(SegmentsPrototypeIterator) {}

BUILTIN(V8BreakIteratorConstructor) {}

BUILTIN(V8BreakIteratorPrototypeResolvedOptions) {}

BUILTIN(V8BreakIteratorPrototypeAdoptText) {}

BUILTIN(V8BreakIteratorInternalAdoptText) {}

BUILTIN(V8BreakIteratorPrototypeFirst) {}

BUILTIN(V8BreakIteratorInternalFirst) {}

BUILTIN(V8BreakIteratorPrototypeNext) {}

BUILTIN(V8BreakIteratorInternalNext) {}

BUILTIN(V8BreakIteratorPrototypeCurrent) {}

BUILTIN(V8BreakIteratorInternalCurrent) {}

BUILTIN(V8BreakIteratorPrototypeBreakType) {}

BUILTIN(V8BreakIteratorInternalBreakType) {}

}  // namespace internal
}  // namespace v8