mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibJS: Propogate allocation errors in BigInt constructor functions
This commit is contained in:
parent
8fda05d8b7
commit
8ed7dee0f0
Notes:
github-actions[bot]
2025-02-19 14:01:55 +00:00
Author: https://github.com/ttrssreal
Commit: 8ed7dee0f0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3615
3 changed files with 14 additions and 2 deletions
|
@ -22,6 +22,12 @@ describe("errors", () => {
|
|||
BigInt.asIntN(1, "foo");
|
||||
}).toThrowWithMessage(SyntaxError, "Invalid value for BigInt: foo");
|
||||
});
|
||||
|
||||
test("large allocation", () => {
|
||||
expect(() => {
|
||||
BigInt.asIntN(0x4000000000000, 1n);
|
||||
}).toThrowWithMessage(InternalError, "Out of memory");
|
||||
});
|
||||
});
|
||||
|
||||
describe("correct behavior", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue