Closed Bug 436624 Opened 16 years ago Closed 9 years ago

JS_DefineObject sets parent

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 805052

People

(Reporter: dmandelin, Unassigned)

Details

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
Assignee: general → nobody
'parent' was removed in bug 805052.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.