Closed KROT47 closed 4 years ago
Certainly if you have a circular reference, you should expect an infinite loop.
Your check certainly stops one level of infinite recursion due to a circular reference, but it'd be impossible toe fully fix this problem without keeping an array/Set of all seen objects, and checking that every time - a very expensive operation.
I don't think this is worth fixing on a shallow level, without fixing the entire problem. Circular references should be avoided anyways.
I was looking where program falls in recursion for hour)
Its just object had link to itself... Check yourself:
a = {}; a.a = a; extend( true, {}, a )
Hope it will save some time for somebody.