The JSAPI function JS_DefineObject sets the parent property of the object that it creates (to the object whose property is set), via js_NewObject. This caused a problem for us because it generated very long parent chains (2000 elements in a linked list) which slowed down system performance--calls to js_NewObject become slower and slower. Setting the parent this way is surprising--it seems like a special case, not the usually wanted behavior. If it is functioning as intended, please add some documentation on the parent property and JS_DefineObject--it was very hard for us to understand what was going on.
This is an ancient API, used in the original Netscape DOM embedding where setting the parent to tree-parent is vital. DOM trees then (or now) never got too deep. I don't think we can change this, so documentation is the least we should do -- we could make a new API or option, but let's hold off and try doc first. If other API users want a new API we can add it. /be
'parent' was removed in bug 805052.