ladybird/Meta/Lagom/Tools/CodeGenerators/LibUnicode
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
..
CMakeLists.txt LibUnicode: Move number formatting code generator to UnicodeNumberFormat 2021-11-12 20:46:38 +00:00
GenerateUnicodeData.cpp Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
GenerateUnicodeLocale.cpp LibUnicode: Ensure UnicodeNumberFormat is aware of default content 2021-11-13 11:52:45 +00:00
GenerateUnicodeNumberFormat.cpp LibJS+LibUnicode: Don't remove {currency} keys in GetNumberFormatPattern 2021-11-13 19:01:25 +00:00
GeneratorUtil.h LibUnicode: Ensure UnicodeNumberFormat is aware of default content 2021-11-13 11:52:45 +00:00