Subj : Re: Object reference graph: is there a way? To : anton muhin From : Brendan Eich Date : Thu Sep 02 2004 01:03 pm anton muhin wrote: > Dear gurus, > > Is there a way to find out all the object that directly (or indirectly) > reference the given object with SpiderMonkey's api? > > Example: > > var o1 = new Object() > var o2 = new Object() > var o3 = new Object() > var o4 = new Object() > > o4.foo = o2 > o4.bar = o3 > > o2.foo = o1 > o3.bar = o1 > > For o1 I want to know that it is referenced by o2 & o3, and, indirectly, > by o3. I suppose that there could be a way as this issue seems to be > related to garbage collecting. Yes, and to uneval/toSource -- try uneval(o1). > The problem I'm trying to solve is notification on objects modification. Why do you want to walk an object graph to notify about modifications? /be .