mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-02 00:13:02 +00:00
LibJS: Support BigInt number formatting with Intl.NumberFormat
This commit is contained in:
parent
a0253af8c1
commit
d6e926e5b1
Notes:
sideshowbarker
2024-07-17 19:58:10 +09:00
Author: https://github.com/trflynn89
Commit: d6e926e5b1
Pull-request: https://github.com/SerenityOS/serenity/pull/12218
Reviewed-by: https://github.com/linusg ✅
5 changed files with 171 additions and 45 deletions
|
@ -44,10 +44,6 @@ ThrowCompletionOr<Value> NumberFormatFunction::call()
|
|||
// 4. Let x be ? ToNumeric(value).
|
||||
value = TRY(value.to_numeric(global_object));
|
||||
|
||||
// FIXME: Support BigInt number formatting.
|
||||
if (value.is_bigint())
|
||||
return vm.throw_completion<InternalError>(global_object, ErrorType::NotImplemented, "BigInt number formatting");
|
||||
|
||||
// 5. Return ? FormatNumeric(nf, x).
|
||||
// Note: Our implementation of FormatNumeric does not throw.
|
||||
auto formatted = format_numeric(global_object, m_number_format, value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue