mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00:00
LibJS: Generalize Intl.NumberFormat to operate on Value types
Intl.NumberFormat is meant to format both Number and BigInt types. To prepare for formatting BigInt types, this generalizes our NumberFormat implementation to operate on Value instances rather than doubles. All arithmetic is moved to static helpers that can now be updated with BigInt semantics.
This commit is contained in:
committed by
Linus Groh
parent
4ba4e4c777
commit
a0253af8c1
@@ -249,7 +249,7 @@ ThrowCompletionOr<Vector<PatternPartitionWithUnit>> partition_relative_time_patt
|
||||
auto patterns = find_patterns_for_tense_or_number(tense);
|
||||
|
||||
// 20. Let fv be ! PartitionNumberPattern(relativeTimeFormat.[[NumberFormat]], value).
|
||||
auto value_partitions = partition_number_pattern(relative_time_format.number_format(), value);
|
||||
auto value_partitions = partition_number_pattern(global_object, relative_time_format.number_format(), Value(value));
|
||||
|
||||
// 21. Let pr be ! ResolvePlural(relativeTimeFormat.[[PluralRules]], value).
|
||||
// 22. Let pattern be po.[[<pr>]].
|
||||
|
||||
Reference in New Issue
Block a user