mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-22 17:13:20 +00:00
22 lines
610 B
JavaScript
22 lines
610 B
JavaScript
![]() |
test("infinite recursion", () => {
|
||
|
function infiniteRecursion() {
|
||
|
infiniteRecursion();
|
||
|
}
|
||
|
|
||
|
try {
|
||
|
infiniteRecursion();
|
||
|
} catch (e) {
|
||
|
expect(e).toBeInstanceOf(Error);
|
||
|
expect(e.name).toBe("RuntimeError");
|
||
|
expect(e.message).toBe("Call stack size limit exceeded");
|
||
|
}
|
||
|
|
||
|
expect(() => {
|
||
|
JSON.stringify({}, () => ({ foo: "bar" }));
|
||
|
}).toThrowWithMessage(Error, "Call stack size limit exceeded");
|
||
|
|
||
|
expect(() => {
|
||
|
new Proxy({}, { get: (_, __, p) => p.foo }).foo;
|
||
|
}).toThrowWithMessage(Error, "Call stack size limit exceeded");
|
||
|
});
|