1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 23:04:59 +00:00

LibJS: Do not revisit already visited values in update_function_name()

Fixes #3471, adds a test.
This commit is contained in:
AnotherTest 2020-09-18 18:00:57 +04:30 committed by Andreas Kling
parent e317ee7541
commit 21f513fe0f
2 changed files with 19 additions and 2 deletions

View file

@ -48,3 +48,10 @@ test("names of native functions", () => {
expect((console.debug.name = "warn")).toBe("warn");
expect(console.debug.name).toBe("debug");
});
test("cyclic members should not cause infinite recursion (#3471)", () => {
let a = [() => 4];
a[1] = a;
a = a;
expect(a[0].name).toBe("a");
});