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:
parent
e317ee7541
commit
21f513fe0f
2 changed files with 19 additions and 2 deletions
|
@ -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");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue