1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:37:46 +00:00

LibJS+LibUnicode: Rename the generated compact_identifier to identifier

This field is currently used to store the StringView into the compact
name/symbol in the format string. Units will need to store a similar
field, so rename the field to be more generic, and extract the parser
for it.
This commit is contained in:
Timothy Flynn 2021-11-16 10:09:17 -05:00 committed by Linus Groh
parent 6d34a0b4e8
commit 3b68370212
3 changed files with 49 additions and 41 deletions

View file

@ -966,7 +966,7 @@ Vector<PatternPartition> partition_notation_sub_pattern(NumberFormat& number_for
// Note: Our implementation combines "compactSymbol" and "compactName" into one field, "compactIdentifier".
// 1. Let compactSymbol be an ILD string representing exponent in short form, which may depend on x in languages having different plural forms. The implementation must be able to provide this string, or else the pattern would not have a "{compactSymbol}" placeholder.
auto compact_identifier = number_format.compact_format().compact_identifier;
auto compact_identifier = number_format.compact_format().identifier;
// 2. Append a new Record { [[Type]]: "compact", [[Value]]: compactSymbol } as the last element of result.
result.append({ "compact"sv, compact_identifier });