1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:58:12 +00:00
serenity/Userland/Libraries/LibJS/Runtime/Intl
Timothy Flynn c65dea64bd LibJS+LibUnicode: Don't remove {currency} keys in GetNumberFormatPattern
In order to implement Intl.NumberFormat.prototype.formatToParts, do not
replace {currency} keys in the format pattern before ECMA-402 tells us
to. Otherwise, the array return by formatToParts will not contain the
expected currency key.

Early replacement was done to avoid resolving the currency display more
than once, as it involves a couple of round trips to search through
LibUnicode data. So this adds a non-standard method to NumberFormat to
do this resolution and cache the result.

Another side effect of this change is that LibUnicode must replace unit
format patterns of the form "{0} {1}" during code generation. These were
previously skipped during code generation because LibJS would just
replace the keys with the currency display at runtime. But now that the
currency display injection is delayed, any {0} or {1} keys in the format
pattern will cause PartitionNumberPattern to abort.
2021-11-13 19:01:25 +00:00
..
AbstractOperations.cpp Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
AbstractOperations.h LibJS: Change Intl's PatternPartition record to hold a String value 2021-11-12 09:17:08 +00:00
DisplayNames.cpp LibJS: Use implicit ThrowCompletionOr<T> constructor where possible 2021-10-21 09:02:23 +01:00
DisplayNames.h LibJS: Convert DisplayNames AOs to ThrowCompletionOr 2021-09-18 22:59:15 +03:00
DisplayNamesConstructor.cpp LibJS: Convert Intl.DisplayNames functions to ThrowCompletionOr 2021-10-22 23:20:18 +01:00
DisplayNamesConstructor.h LibJS: Convert Intl.DisplayNames functions to ThrowCompletionOr 2021-10-22 23:20:18 +01:00
DisplayNamesPrototype.cpp LibJS+LibUnicode: Generate all styles of currency localizations 2021-11-13 11:52:45 +00:00
DisplayNamesPrototype.h LibJS: Convert Intl.DisplayNames functions to ThrowCompletionOr 2021-10-22 23:20:18 +01:00
Intl.cpp LibJS: Convert Intl.getCanonicalLocales() function to ThrowCompletionOr 2021-10-22 23:20:18 +01:00
Intl.h LibJS: Convert Intl.getCanonicalLocales() function to ThrowCompletionOr 2021-10-22 23:20:18 +01:00
ListFormat.cpp LibJS: Change Intl's PatternPartition record to hold a String value 2021-11-12 09:17:08 +00:00
ListFormat.h LibJS: Convert ListFormat AOs to ThrowCompletionOr 2021-09-18 22:59:15 +03:00
ListFormatConstructor.cpp LibJS: Convert Intl.ListFormat functions to ThrowCompletionOr 2021-10-22 23:20:18 +01:00
ListFormatConstructor.h LibJS: Convert Intl.ListFormat functions to ThrowCompletionOr 2021-10-22 23:20:18 +01:00
ListFormatPrototype.cpp LibJS: Convert Intl.ListFormat functions to ThrowCompletionOr 2021-10-22 23:20:18 +01:00
ListFormatPrototype.h LibJS: Convert Intl.ListFormat functions to ThrowCompletionOr 2021-10-22 23:20:18 +01:00
Locale.cpp LibJS: Move locale_relevant_extension_keys to Intl.Locale 2021-09-12 12:57:17 +01:00
Locale.h LibJS: Move locale_relevant_extension_keys to Intl.Locale 2021-09-12 12:57:17 +01:00
LocaleConstructor.cpp LibJS: Rename PropertyName to PropertyKey 2021-10-24 17:18:07 +02:00
LocaleConstructor.h LibJS: Convert NativeFunction::{call,construct}() to ThrowCompletionOr 2021-10-21 09:02:23 +01:00
LocalePrototype.cpp LibJS: Convert Intl.Locale functions to ThrowCompletionOr 2021-10-22 23:20:18 +01:00
LocalePrototype.h LibJS: Convert Intl.Locale functions to ThrowCompletionOr 2021-10-22 23:20:18 +01:00
NumberFormat.cpp LibJS+LibUnicode: Don't remove {currency} keys in GetNumberFormatPattern 2021-11-13 19:01:25 +00:00
NumberFormat.h LibJS+LibUnicode: Don't remove {currency} keys in GetNumberFormatPattern 2021-11-13 19:01:25 +00:00
NumberFormatConstructor.cpp LibJS: Convert Intl.NumberFormat functions to ThrowCompletionOr 2021-10-22 23:20:18 +01:00
NumberFormatConstructor.h LibJS: Convert Intl.NumberFormat functions to ThrowCompletionOr 2021-10-22 23:20:18 +01:00
NumberFormatFunction.cpp LibJS: Begin implementing Intl.NumberFormat.prototype.format 2021-11-12 09:17:08 +00:00
NumberFormatFunction.h LibJS: Begin implementing Intl.NumberFormat.prototype.format 2021-11-12 09:17:08 +00:00
NumberFormatPrototype.cpp LibJS: Begin implementing Intl.NumberFormat.prototype.format 2021-11-12 09:17:08 +00:00
NumberFormatPrototype.h LibJS: Begin implementing Intl.NumberFormat.prototype.format 2021-11-12 09:17:08 +00:00