mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:27:35 +00:00
LibJS: Throw an exception in NumberFormat.prototype.format for BigInts
Rather than crashing in the call to as_double(), throw an exception for now.
This commit is contained in:
parent
c65dea64bd
commit
40973814e9
2 changed files with 14 additions and 0 deletions
|
@ -14,6 +14,16 @@ describe("errors", () => {
|
|||
Intl.NumberFormat().format(Symbol.hasInstance);
|
||||
}).toThrowWithMessage(TypeError, "Cannot convert symbol to number");
|
||||
});
|
||||
|
||||
// FIXME: Remove this and add BigInt tests when BigInt number formatting is supported.
|
||||
test("bigint", () => {
|
||||
expect(() => {
|
||||
Intl.NumberFormat().format(1n);
|
||||
}).toThrowWithMessage(
|
||||
InternalError,
|
||||
"BigInt number formatting is not implemented in LibJS"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("special values", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue