mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +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
Notes:
sideshowbarker
2024-07-19 02:20:39 +09:00
Author: https://github.com/alimpfard
Commit: 21f513fe0f
Pull-request: https://github.com/SerenityOS/serenity/pull/3535
Issue: https://github.com/SerenityOS/serenity/issues/3471
Reviewed-by: https://github.com/linusg
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