LibJS: Enable EXPLICIT_SYMBOL_EXPORT

This commit is contained in:
ayeteadoe 2025-06-28 21:39:13 -07:00 committed by Andrew Kaster
commit c14173f651
Notes: github-actions[bot] 2025-06-30 16:51:52 +00:00
258 changed files with 952 additions and 941 deletions

View file

@ -63,23 +63,23 @@ AK_ENUM_BITWISE_OPERATORS(SpecialBehaviors);
using StringOrBoolean = Variant<StringView, bool>;
bool is_structurally_valid_language_tag(StringView locale);
String canonicalize_unicode_locale_id(StringView locale);
bool is_well_formed_currency_code(StringView currency);
Vector<TimeZoneIdentifier> const& available_named_time_zone_identifiers();
Optional<TimeZoneIdentifier const&> get_available_named_time_zone_identifier(StringView time_zone_identifier);
bool is_well_formed_unit_identifier(StringView unit_identifier);
ThrowCompletionOr<Vector<String>> canonicalize_locale_list(VM&, Value locales);
Optional<MatchedLocale> lookup_matching_locale_by_prefix(ReadonlySpan<String> requested_locales);
Optional<MatchedLocale> lookup_matching_locale_by_best_fit(ReadonlySpan<String> requested_locales);
String insert_unicode_extension_and_canonicalize(Unicode::LocaleID locale_id, Vector<String> attributes, Vector<Unicode::Keyword> keywords);
ResolvedLocale resolve_locale(ReadonlySpan<String> requested_locales, LocaleOptions const& options, ReadonlySpan<StringView> relevant_extension_keys);
ThrowCompletionOr<ResolvedOptions> resolve_options(VM& vm, IntlObject& object, Value locales, Value options_value, SpecialBehaviors special_behaviours = SpecialBehaviors::None, Function<void(LocaleOptions&)> modify_resolution_options = {});
ThrowCompletionOr<GC::Ref<Array>> filter_locales(VM& vm, ReadonlySpan<String> requested_locales, Value options);
ThrowCompletionOr<GC::Ref<Object>> coerce_options_to_object(VM&, Value options);
ThrowCompletionOr<StringOrBoolean> get_boolean_or_string_number_format_option(VM& vm, Object const& options, PropertyKey const& property, ReadonlySpan<StringView> string_values, StringOrBoolean fallback);
ThrowCompletionOr<Optional<int>> default_number_option(VM&, Value value, int minimum, int maximum, Optional<int> fallback);
ThrowCompletionOr<Optional<int>> get_number_option(VM&, Object const& options, PropertyKey const& property, int minimum, int maximum, Optional<int> fallback);
JS_API bool is_structurally_valid_language_tag(StringView locale);
JS_API String canonicalize_unicode_locale_id(StringView locale);
JS_API bool is_well_formed_currency_code(StringView currency);
JS_API Vector<TimeZoneIdentifier> const& available_named_time_zone_identifiers();
JS_API Optional<TimeZoneIdentifier const&> get_available_named_time_zone_identifier(StringView time_zone_identifier);
JS_API bool is_well_formed_unit_identifier(StringView unit_identifier);
JS_API ThrowCompletionOr<Vector<String>> canonicalize_locale_list(VM&, Value locales);
JS_API Optional<MatchedLocale> lookup_matching_locale_by_prefix(ReadonlySpan<String> requested_locales);
JS_API Optional<MatchedLocale> lookup_matching_locale_by_best_fit(ReadonlySpan<String> requested_locales);
JS_API String insert_unicode_extension_and_canonicalize(Unicode::LocaleID locale_id, Vector<String> attributes, Vector<Unicode::Keyword> keywords);
JS_API ResolvedLocale resolve_locale(ReadonlySpan<String> requested_locales, LocaleOptions const& options, ReadonlySpan<StringView> relevant_extension_keys);
JS_API ThrowCompletionOr<ResolvedOptions> resolve_options(VM& vm, IntlObject& object, Value locales, Value options_value, SpecialBehaviors special_behaviours = SpecialBehaviors::None, Function<void(LocaleOptions&)> modify_resolution_options = {});
JS_API ThrowCompletionOr<GC::Ref<Array>> filter_locales(VM& vm, ReadonlySpan<String> requested_locales, Value options);
JS_API ThrowCompletionOr<GC::Ref<Object>> coerce_options_to_object(VM&, Value options);
JS_API ThrowCompletionOr<StringOrBoolean> get_boolean_or_string_number_format_option(VM& vm, Object const& options, PropertyKey const& property, ReadonlySpan<StringView> string_values, StringOrBoolean fallback);
JS_API ThrowCompletionOr<Optional<int>> default_number_option(VM&, Value value, int minimum, int maximum, Optional<int> fallback);
JS_API ThrowCompletionOr<Optional<int>> get_number_option(VM&, Object const& options, PropertyKey const& property, int minimum, int maximum, Optional<int> fallback);
template<size_t Size>
ThrowCompletionOr<StringOrBoolean> get_boolean_or_string_number_format_option(VM& vm, Object const& options, PropertyKey const& property, StringView const (&string_values)[Size], StringOrBoolean fallback)

View file

@ -14,7 +14,7 @@
namespace JS::Intl {
class Collator final : public IntlObject {
class JS_API Collator final : public IntlObject {
JS_OBJECT(Collator, IntlObject);
GC_DECLARE_ALLOCATOR(Collator);

View file

@ -10,7 +10,7 @@
namespace JS::Intl {
class CollatorCompareFunction : public NativeFunction {
class JS_API CollatorCompareFunction : public NativeFunction {
JS_OBJECT(CollatorCompareFunction, NativeFunction);
GC_DECLARE_ALLOCATOR(CollatorCompareFunction);
@ -30,6 +30,6 @@ private:
GC::Ref<Collator> m_collator; // [[Collator]]
};
int compare_strings(Collator const&, StringView x, StringView y);
JS_API int compare_strings(Collator const&, StringView x, StringView y);
}

View file

@ -10,7 +10,7 @@
namespace JS::Intl {
class CollatorConstructor final : public NativeFunction {
class JS_API CollatorConstructor final : public NativeFunction {
JS_OBJECT(CollatorConstructor, NativeFunction);
GC_DECLARE_ALLOCATOR(CollatorConstructor);

View file

@ -11,7 +11,7 @@
namespace JS::Intl {
class CollatorPrototype final : public PrototypeObject<CollatorPrototype, Collator> {
class JS_API CollatorPrototype final : public PrototypeObject<CollatorPrototype, Collator> {
JS_PROTOTYPE_OBJECT(CollatorPrototype, Collator, Collator);
GC_DECLARE_ALLOCATOR(CollatorPrototype);

View file

@ -19,7 +19,7 @@
namespace JS::Intl {
class DateTimeFormat final : public IntlObject {
class JS_API DateTimeFormat final : public IntlObject {
JS_OBJECT(DateTimeFormat, IntlObject);
GC_DECLARE_ALLOCATOR(DateTimeFormat);
@ -135,27 +135,27 @@ struct ValueFormat {
double epoch_milliseconds { 0 }; // [[EpochNanoseconds]]
};
Vector<Unicode::DateTimeFormat::Partition> format_date_time_pattern(ValueFormat const&);
ThrowCompletionOr<Vector<Unicode::DateTimeFormat::Partition>> partition_date_time_pattern(VM&, DateTimeFormat&, FormattableDateTime const&);
ThrowCompletionOr<String> format_date_time(VM&, DateTimeFormat&, FormattableDateTime const&);
ThrowCompletionOr<GC::Ref<Array>> format_date_time_to_parts(VM&, DateTimeFormat&, FormattableDateTime const&);
ThrowCompletionOr<Vector<Unicode::DateTimeFormat::Partition>> partition_date_time_range_pattern(VM&, DateTimeFormat&, FormattableDateTime const& start, FormattableDateTime const& end);
ThrowCompletionOr<String> format_date_time_range(VM&, DateTimeFormat&, FormattableDateTime const& start, FormattableDateTime const& end);
ThrowCompletionOr<GC::Ref<Array>> format_date_time_range_to_parts(VM&, DateTimeFormat&, FormattableDateTime const& start, FormattableDateTime const& end);
JS_API Vector<Unicode::DateTimeFormat::Partition> format_date_time_pattern(ValueFormat const&);
JS_API ThrowCompletionOr<Vector<Unicode::DateTimeFormat::Partition>> partition_date_time_pattern(VM&, DateTimeFormat&, FormattableDateTime const&);
JS_API ThrowCompletionOr<String> format_date_time(VM&, DateTimeFormat&, FormattableDateTime const&);
JS_API ThrowCompletionOr<GC::Ref<Array>> format_date_time_to_parts(VM&, DateTimeFormat&, FormattableDateTime const&);
JS_API ThrowCompletionOr<Vector<Unicode::DateTimeFormat::Partition>> partition_date_time_range_pattern(VM&, DateTimeFormat&, FormattableDateTime const& start, FormattableDateTime const& end);
JS_API ThrowCompletionOr<String> format_date_time_range(VM&, DateTimeFormat&, FormattableDateTime const& start, FormattableDateTime const& end);
JS_API ThrowCompletionOr<GC::Ref<Array>> format_date_time_range_to_parts(VM&, DateTimeFormat&, FormattableDateTime const& start, FormattableDateTime const& end);
Optional<Unicode::CalendarPattern> get_date_time_format(Unicode::CalendarPattern const& options, OptionRequired, OptionDefaults, OptionInherit);
Unicode::CalendarPattern adjust_date_time_style_format(Unicode::CalendarPattern const& base_format, ReadonlySpan<Unicode::CalendarPattern::Field> allowed_options);
ThrowCompletionOr<FormattableDateTime> to_date_time_formattable(VM&, Value);
bool is_temporal_object(FormattableDateTime const&);
bool same_temporal_type(FormattableDateTime const&, FormattableDateTime const&);
ThrowCompletionOr<ValueFormat> handle_date_time_temporal_date(VM&, DateTimeFormat&, Temporal::PlainDate const&);
ThrowCompletionOr<ValueFormat> handle_date_time_temporal_year_month(VM&, DateTimeFormat&, Temporal::PlainYearMonth const&);
ThrowCompletionOr<ValueFormat> handle_date_time_temporal_month_day(VM&, DateTimeFormat&, Temporal::PlainMonthDay const&);
ThrowCompletionOr<ValueFormat> handle_date_time_temporal_time(VM&, DateTimeFormat&, Temporal::PlainTime const&);
ThrowCompletionOr<ValueFormat> handle_date_time_temporal_date_time(VM&, DateTimeFormat&, Temporal::PlainDateTime const&);
ValueFormat handle_date_time_temporal_instant(DateTimeFormat&, Temporal::Instant const&);
ThrowCompletionOr<ValueFormat> handle_date_time_others(VM&, DateTimeFormat&, double);
ThrowCompletionOr<ValueFormat> handle_date_time_value(VM&, DateTimeFormat&, FormattableDateTime const&);
JS_API Optional<Unicode::CalendarPattern> get_date_time_format(Unicode::CalendarPattern const& options, OptionRequired, OptionDefaults, OptionInherit);
JS_API Unicode::CalendarPattern adjust_date_time_style_format(Unicode::CalendarPattern const& base_format, ReadonlySpan<Unicode::CalendarPattern::Field> allowed_options);
JS_API ThrowCompletionOr<FormattableDateTime> to_date_time_formattable(VM&, Value);
JS_API bool is_temporal_object(FormattableDateTime const&);
JS_API bool same_temporal_type(FormattableDateTime const&, FormattableDateTime const&);
JS_API ThrowCompletionOr<ValueFormat> handle_date_time_temporal_date(VM&, DateTimeFormat&, Temporal::PlainDate const&);
JS_API ThrowCompletionOr<ValueFormat> handle_date_time_temporal_year_month(VM&, DateTimeFormat&, Temporal::PlainYearMonth const&);
JS_API ThrowCompletionOr<ValueFormat> handle_date_time_temporal_month_day(VM&, DateTimeFormat&, Temporal::PlainMonthDay const&);
JS_API ThrowCompletionOr<ValueFormat> handle_date_time_temporal_time(VM&, DateTimeFormat&, Temporal::PlainTime const&);
JS_API ThrowCompletionOr<ValueFormat> handle_date_time_temporal_date_time(VM&, DateTimeFormat&, Temporal::PlainDateTime const&);
JS_API ValueFormat handle_date_time_temporal_instant(DateTimeFormat&, Temporal::Instant const&);
JS_API ThrowCompletionOr<ValueFormat> handle_date_time_others(VM&, DateTimeFormat&, double);
JS_API ThrowCompletionOr<ValueFormat> handle_date_time_value(VM&, DateTimeFormat&, FormattableDateTime const&);
template<typename Callback>
ThrowCompletionOr<void> for_each_calendar_field(VM& vm, Unicode::CalendarPattern& pattern, Callback&& callback)

View file

@ -10,7 +10,7 @@
namespace JS::Intl {
class DateTimeFormatConstructor final : public NativeFunction {
class JS_API DateTimeFormatConstructor final : public NativeFunction {
JS_OBJECT(DateTimeFormatConstructor, NativeFunction);
GC_DECLARE_ALLOCATOR(DateTimeFormatConstructor);

View file

@ -12,7 +12,7 @@
namespace JS::Intl {
class DateTimeFormatFunction final : public NativeFunction {
class JS_API DateTimeFormatFunction final : public NativeFunction {
JS_OBJECT(DateTimeFormatFunction, NativeFunction);
GC_DECLARE_ALLOCATOR(DateTimeFormatFunction);

View file

@ -11,7 +11,7 @@
namespace JS::Intl {
class DateTimeFormatPrototype final : public PrototypeObject<DateTimeFormatPrototype, DateTimeFormat> {
class JS_API DateTimeFormatPrototype final : public PrototypeObject<DateTimeFormatPrototype, DateTimeFormat> {
JS_PROTOTYPE_OBJECT(DateTimeFormatPrototype, DateTimeFormat, Intl.DateTimeFormat);
GC_DECLARE_ALLOCATOR(DateTimeFormatPrototype);

View file

@ -15,7 +15,7 @@
namespace JS::Intl {
class DisplayNames final : public IntlObject {
class JS_API DisplayNames final : public IntlObject {
JS_OBJECT(DisplayNames, IntlObject);
GC_DECLARE_ALLOCATOR(DisplayNames);
@ -71,7 +71,7 @@ private:
Optional<Unicode::LanguageDisplay> m_language_display; // [[LanguageDisplay]]
};
ThrowCompletionOr<Value> canonical_code_for_display_names(VM&, DisplayNames::Type, StringView code);
bool is_valid_date_time_field_code(StringView field);
JS_API ThrowCompletionOr<Value> canonical_code_for_display_names(VM&, DisplayNames::Type, StringView code);
JS_API bool is_valid_date_time_field_code(StringView field);
}

View file

@ -10,7 +10,7 @@
namespace JS::Intl {
class DisplayNamesConstructor final : public NativeFunction {
class JS_API DisplayNamesConstructor final : public NativeFunction {
JS_OBJECT(DisplayNamesConstructor, NativeFunction);
GC_DECLARE_ALLOCATOR(DisplayNamesConstructor);

View file

@ -11,7 +11,7 @@
namespace JS::Intl {
class DisplayNamesPrototype final : public PrototypeObject<DisplayNamesPrototype, DisplayNames> {
class JS_API DisplayNamesPrototype final : public PrototypeObject<DisplayNamesPrototype, DisplayNames> {
JS_PROTOTYPE_OBJECT(DisplayNamesPrototype, DisplayNames, Intl.DisplayNames);
GC_DECLARE_ALLOCATOR(DisplayNamesPrototype);

View file

@ -16,7 +16,7 @@
namespace JS::Intl {
class DurationFormat final : public IntlObject {
class JS_API DurationFormat final : public IntlObject {
JS_OBJECT(DurationFormat, IntlObject);
GC_DECLARE_ALLOCATOR(DurationFormat);
@ -66,7 +66,7 @@ public:
};
// 13.5.6.1 Duration Unit Options Records, https://tc39.es/ecma402/#sec-durationformat-unit-options-record
struct DurationUnitOptions {
struct JS_API DurationUnitOptions {
ValueStyle style { ValueStyle::Long };
Display display { Display::Auto };
};
@ -148,7 +148,7 @@ private:
Optional<u8> m_fractional_digits; // [[FractionalDigits]]
};
struct DurationInstanceComponent {
struct JS_API DurationInstanceComponent {
double (Temporal::Duration::*value_slot)() const;
DurationFormat::DurationUnitOptions (DurationFormat::*get_internal_slot)() const;
void (DurationFormat::*set_internal_slot)(DurationFormat::DurationUnitOptions);
@ -176,21 +176,21 @@ static constexpr auto duration_instances_components = to_array<DurationInstanceC
{ &Temporal::Duration::nanoseconds, &DurationFormat::nanoseconds_options, &DurationFormat::set_nanoseconds_options, DurationFormat::Unit::Nanoseconds, sub_second_styles, DurationFormat::ValueStyle::Numeric },
});
struct DurationFormatPart {
struct JS_API DurationFormatPart {
StringView type;
String value;
StringView unit;
};
ThrowCompletionOr<DurationFormat::DurationUnitOptions> get_duration_unit_options(VM&, DurationFormat::Unit unit, Object const& options, DurationFormat::Style base_style, ReadonlySpan<StringView> styles_list, DurationFormat::ValueStyle digital_base, Optional<DurationFormat::ValueStyle> previous_style, bool two_digit_hours);
Crypto::BigFraction compute_fractional_digits(DurationFormat const&, Temporal::Duration const&);
bool next_unit_fractional(DurationFormat const&, DurationFormat::Unit unit);
Vector<DurationFormatPart> format_numeric_hours(VM&, DurationFormat const&, MathematicalValue const& hours_value, bool sign_displayed);
Vector<DurationFormatPart> format_numeric_minutes(VM&, DurationFormat const&, MathematicalValue const& minutes_value, bool hours_displayed, bool sign_displayed);
Vector<DurationFormatPart> format_numeric_seconds(VM&, DurationFormat const&, MathematicalValue const& seconds_value, bool minutes_displayed, bool sign_displayed);
Vector<DurationFormatPart> format_numeric_units(VM&, DurationFormat const&, Temporal::Duration const&, DurationFormat::Unit first_numeric_unit, bool sign_displayed);
bool is_fractional_second_unit_name(DurationFormat::Unit);
Vector<DurationFormatPart> list_format_parts(VM&, DurationFormat const&, Vector<Vector<DurationFormatPart>>& partitioned_parts_list);
Vector<DurationFormatPart> partition_duration_format_pattern(VM&, DurationFormat const&, Temporal::Duration const&);
JS_API ThrowCompletionOr<DurationFormat::DurationUnitOptions> get_duration_unit_options(VM&, DurationFormat::Unit unit, Object const& options, DurationFormat::Style base_style, ReadonlySpan<StringView> styles_list, DurationFormat::ValueStyle digital_base, Optional<DurationFormat::ValueStyle> previous_style, bool two_digit_hours);
JS_API Crypto::BigFraction compute_fractional_digits(DurationFormat const&, Temporal::Duration const&);
JS_API bool next_unit_fractional(DurationFormat const&, DurationFormat::Unit unit);
JS_API Vector<DurationFormatPart> format_numeric_hours(VM&, DurationFormat const&, MathematicalValue const& hours_value, bool sign_displayed);
JS_API Vector<DurationFormatPart> format_numeric_minutes(VM&, DurationFormat const&, MathematicalValue const& minutes_value, bool hours_displayed, bool sign_displayed);
JS_API Vector<DurationFormatPart> format_numeric_seconds(VM&, DurationFormat const&, MathematicalValue const& seconds_value, bool minutes_displayed, bool sign_displayed);
JS_API Vector<DurationFormatPart> format_numeric_units(VM&, DurationFormat const&, Temporal::Duration const&, DurationFormat::Unit first_numeric_unit, bool sign_displayed);
JS_API bool is_fractional_second_unit_name(DurationFormat::Unit);
JS_API Vector<DurationFormatPart> list_format_parts(VM&, DurationFormat const&, Vector<Vector<DurationFormatPart>>& partitioned_parts_list);
JS_API Vector<DurationFormatPart> partition_duration_format_pattern(VM&, DurationFormat const&, Temporal::Duration const&);
}

View file

@ -10,7 +10,7 @@
namespace JS::Intl {
class DurationFormatConstructor final : public NativeFunction {
class JS_API DurationFormatConstructor final : public NativeFunction {
JS_OBJECT(DurationFormatConstructor, NativeFunction);
GC_DECLARE_ALLOCATOR(DurationFormatConstructor);

View file

@ -11,7 +11,7 @@
namespace JS::Intl {
class DurationFormatPrototype final : public PrototypeObject<DurationFormatPrototype, DurationFormat> {
class JS_API DurationFormatPrototype final : public PrototypeObject<DurationFormatPrototype, DurationFormat> {
JS_PROTOTYPE_OBJECT(DurationFormatPrototype, DurationFormat, Intl.DurationFormat);
GC_DECLARE_ALLOCATOR(DurationFormatPrototype);

View file

@ -10,7 +10,7 @@
namespace JS::Intl {
class Intl final : public Object {
class JS_API Intl final : public Object {
JS_OBJECT(Intl, Object);
GC_DECLARE_ALLOCATOR(Intl);

View file

@ -15,14 +15,14 @@
namespace JS::Intl {
// https://tc39.es/ecma402/#resolution-option-descriptor
struct ResolutionOptionDescriptor {
struct JS_API ResolutionOptionDescriptor {
StringView key;
PropertyKey property;
OptionType type { OptionType::String };
ReadonlySpan<StringView> values {};
};
class IntlObject : public Object {
class JS_API IntlObject : public Object {
JS_OBJECT(IntlObject, Object);
public:

View file

@ -15,7 +15,7 @@
namespace JS::Intl {
class ListFormat final : public IntlObject {
class JS_API ListFormat final : public IntlObject {
JS_OBJECT(ListFormat, IntlObject);
GC_DECLARE_ALLOCATOR(ListFormat);
@ -57,9 +57,9 @@ private:
OwnPtr<Unicode::ListFormat> m_formatter;
};
Vector<Unicode::ListFormat::Partition> create_parts_from_list(ListFormat const&, ReadonlySpan<String> list);
String format_list(ListFormat const&, ReadonlySpan<String> list);
GC::Ref<Array> format_list_to_parts(VM&, ListFormat const&, ReadonlySpan<String> list);
ThrowCompletionOr<Vector<String>> string_list_from_iterable(VM&, Value iterable);
JS_API Vector<Unicode::ListFormat::Partition> create_parts_from_list(ListFormat const&, ReadonlySpan<String> list);
JS_API String format_list(ListFormat const&, ReadonlySpan<String> list);
JS_API GC::Ref<Array> format_list_to_parts(VM&, ListFormat const&, ReadonlySpan<String> list);
JS_API ThrowCompletionOr<Vector<String>> string_list_from_iterable(VM&, Value iterable);
}

View file

@ -10,7 +10,7 @@
namespace JS::Intl {
class ListFormatConstructor final : public NativeFunction {
class JS_API ListFormatConstructor final : public NativeFunction {
JS_OBJECT(ListFormatConstructor, NativeFunction);
GC_DECLARE_ALLOCATOR(ListFormatConstructor);

View file

@ -11,7 +11,7 @@
namespace JS::Intl {
class ListFormatPrototype final : public PrototypeObject<ListFormatPrototype, ListFormat> {
class JS_API ListFormatPrototype final : public PrototypeObject<ListFormatPrototype, ListFormat> {
JS_PROTOTYPE_OBJECT(ListFormatPrototype, ListFormat, Intl.ListFormat);
GC_DECLARE_ALLOCATOR(ListFormatPrototype);

View file

@ -18,7 +18,7 @@
namespace JS::Intl {
class Locale final : public Object {
class JS_API Locale final : public Object {
JS_OBJECT(Locale, Object);
GC_DECLARE_ALLOCATOR(Locale);
@ -85,21 +85,21 @@ private:
};
// Table 1: WeekInfo Record Fields, https://tc39.es/proposal-intl-locale-info/#table-locale-weekinfo-record
struct WeekInfo {
struct JS_API WeekInfo {
u8 minimal_days { 0 }; // [[MinimalDays]]
u8 first_day { 0 }; // [[FirstDay]]
Vector<u8> weekend; // [[Weekend]]
};
Optional<String> get_locale_variants(Unicode::LocaleID const&);
JS_API Optional<String> get_locale_variants(Unicode::LocaleID const&);
GC::Ref<Array> calendars_of_locale(VM&, Locale const&);
GC::Ref<Array> collations_of_locale(VM&, Locale const& locale);
GC::Ref<Array> hour_cycles_of_locale(VM&, Locale const& locale);
GC::Ref<Array> numbering_systems_of_locale(VM&, Locale const&);
GC::Ref<Array> time_zones_of_locale(VM&, Locale const&);
StringView weekday_to_string(StringView weekday);
Optional<u8> string_to_weekday_value(StringView weekday);
WeekInfo week_info_of_locale(Locale const&);
JS_API GC::Ref<Array> calendars_of_locale(VM&, Locale const&);
JS_API GC::Ref<Array> collations_of_locale(VM&, Locale const& locale);
JS_API GC::Ref<Array> hour_cycles_of_locale(VM&, Locale const& locale);
JS_API GC::Ref<Array> numbering_systems_of_locale(VM&, Locale const&);
JS_API GC::Ref<Array> time_zones_of_locale(VM&, Locale const&);
JS_API StringView weekday_to_string(StringView weekday);
JS_API Optional<u8> string_to_weekday_value(StringView weekday);
JS_API WeekInfo week_info_of_locale(Locale const&);
}

View file

@ -10,7 +10,7 @@
namespace JS::Intl {
class LocaleConstructor final : public NativeFunction {
class JS_API LocaleConstructor final : public NativeFunction {
JS_OBJECT(LocaleConstructor, NativeFunction);
GC_DECLARE_ALLOCATOR(LocaleConstructor);

View file

@ -11,7 +11,7 @@
namespace JS::Intl {
class LocalePrototype final : public PrototypeObject<LocalePrototype, Locale> {
class JS_API LocalePrototype final : public PrototypeObject<LocalePrototype, Locale> {
JS_PROTOTYPE_OBJECT(LocalePrototype, Locale, Intl.Locale);
GC_DECLARE_ALLOCATOR(LocalePrototype);

View file

@ -16,7 +16,7 @@
namespace JS::Intl {
// https://tc39.es/ecma402/#intl-mathematical-value
class MathematicalValue {
class JS_API MathematicalValue {
public:
enum class Symbol {
PositiveInfinity,

View file

@ -16,7 +16,7 @@
namespace JS::Intl {
class NumberFormatBase : public IntlObject {
class JS_API NumberFormatBase : public IntlObject {
JS_OBJECT(NumberFormatBase, IntlObject);
GC_DECLARE_ALLOCATOR(NumberFormatBase);
@ -108,7 +108,7 @@ private:
OwnPtr<Unicode::NumberFormat> m_formatter;
};
class NumberFormat final : public NumberFormatBase {
class JS_API NumberFormat final : public NumberFormatBase {
JS_OBJECT(NumberFormat, NumberFormatBase);
GC_DECLARE_ALLOCATOR(NumberFormat);
@ -179,14 +179,14 @@ private:
GC::Ptr<NativeFunction> m_bound_format; // [[BoundFormat]]
};
int currency_digits(StringView currency);
String format_numeric_to_string(NumberFormatBase const& intl_object, MathematicalValue const& number);
Vector<Unicode::NumberFormat::Partition> partition_number_pattern(NumberFormat const&, MathematicalValue const& number);
String format_numeric(NumberFormat const&, MathematicalValue const& number);
GC::Ref<Array> format_numeric_to_parts(VM&, NumberFormat const&, MathematicalValue const& number);
ThrowCompletionOr<MathematicalValue> to_intl_mathematical_value(VM&, Value value);
ThrowCompletionOr<Vector<Unicode::NumberFormat::Partition>> partition_number_range_pattern(VM&, NumberFormat const&, MathematicalValue const& start, MathematicalValue const& end);
ThrowCompletionOr<String> format_numeric_range(VM&, NumberFormat const&, MathematicalValue const& start, MathematicalValue const& end);
ThrowCompletionOr<GC::Ref<Array>> format_numeric_range_to_parts(VM&, NumberFormat const&, MathematicalValue const& start, MathematicalValue const& end);
JS_API int currency_digits(StringView currency);
JS_API String format_numeric_to_string(NumberFormatBase const& intl_object, MathematicalValue const& number);
JS_API Vector<Unicode::NumberFormat::Partition> partition_number_pattern(NumberFormat const&, MathematicalValue const& number);
JS_API String format_numeric(NumberFormat const&, MathematicalValue const& number);
JS_API GC::Ref<Array> format_numeric_to_parts(VM&, NumberFormat const&, MathematicalValue const& number);
JS_API ThrowCompletionOr<MathematicalValue> to_intl_mathematical_value(VM&, Value value);
JS_API ThrowCompletionOr<Vector<Unicode::NumberFormat::Partition>> partition_number_range_pattern(VM&, NumberFormat const&, MathematicalValue const& start, MathematicalValue const& end);
JS_API ThrowCompletionOr<String> format_numeric_range(VM&, NumberFormat const&, MathematicalValue const& start, MathematicalValue const& end);
JS_API ThrowCompletionOr<GC::Ref<Array>> format_numeric_range_to_parts(VM&, NumberFormat const&, MathematicalValue const& start, MathematicalValue const& end);
}