Message from JavaScript discussions

August 2018


var a;
a.a = a;


You won't know it's there unless you check every node against whats been seen before, to avoid traversing the same node twice

— You misunderstand what the problem is

— Any node in the tree can refer to any other node higher up in the tree

— Which would have been already seen

— Uh, right

— Using Map is barbaric simple slow way to check for this

— Aaaaa danger in one of my libs lol

— Compressed bit fields are better but more complex to track this

— It is tracking reachability of nodes

— I go a little further than Map and store a tuple of objects at once, that way I can correlate subsections of disjoint object structures as being seen together

Message permanent page

— Ie obj1.prop1 was seen also in the same tree path as obj2.prop1 etc...