JS_DefineObject sets parent

RESOLVED DUPLICATE of bug 805052

Status

()

Core
JavaScript Engine
RESOLVED DUPLICATE of bug 805052
10 years ago
2 years ago

People

(Reporter: dmandelin, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

10 years ago
 
(Reporter)

Comment 1

10 years ago
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)

Updated

3 years ago
Assignee: general → nobody
'parent' was removed in bug 805052.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 805052
You need to log in before you can comment on or make changes to this bug.