Skip to content

Infinite loop when both arguments have cycles #19

@justinfagnani

Description

@justinfagnani

If both arguments have cycles, like if you're trying to compare doubly-linked lists, dequal goes into an infinite loop.

repro:

const a: any = {}, b: any = {};
a.next = b;
b.previous = a;

const c: any = {}, d: any = {};
c.next = d;
d.previous = c;

dequal(a, c);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions