Closed
Bug 362910
Opened 18 years ago
Closed 15 years ago
xml[elem]() does not call XML method
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: igor, Assigned: igor)
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file, 1 obsolete file)
34.47 KB,
patch
|
brendan
:
review+
|
Details | Diff | Splinter Review |
Consider the following js shell session: js> xml=<a><b/><c/></a> <a> <b/> <c/> </a> js> xml['children']() xml['children']() <b/> <c/> js> xml[tmp = 'children']() xml[tmp = 'children']() typein:18: TypeError: xml[tmp = "children"] is not a function js> Here xml[tmp = 'children']() instead of the expected call to XML method generates an error since SpiderMonkey does not call GetMethod for [] operator in the call context. xml['children']() works because that is optimized as xml.children().
Assignee | ||
Comment 1•15 years ago
|
||
The patch adds js_GetMethod to consolidate various queries for a XML/!XML method property spread throughout the code. JSOP_CALLELEM uses the new method. The patch also removes JSXMLObjectOps - they are useless as in all cases the code use OBJECT_IS_XML guards before casting JSObjectOps to them. As such the code can always call the function in question directly.
Assignee: general → igor
Attachment #367062 -
Flags: review?(brendan)
Assignee | ||
Comment 2•15 years ago
|
||
In the previous patch I have added a bogus assert to GetXMLFunction.
Attachment #367062 -
Attachment is obsolete: true
Attachment #367067 -
Flags: review?(brendan)
Attachment #367062 -
Flags: review?(brendan)
Updated•15 years ago
|
Attachment #367067 -
Flags: review?(brendan) → review+
Comment 3•15 years ago
|
||
Comment on attachment 367067 [details] [diff] [review] v2 Looks good, we can always evolve JSObjectOps directly in bug 408416. /be
Comment 4•15 years ago
|
||
This is a good cleanup that reduces code size; with baking time it can go into 1.9.1 for b4. /be
Flags: wanted1.9.1?
Comment 5•15 years ago
|
||
Well, OK, but let's try to focus on blockers. Code cleanup is not a late in the cycle activity.
Flags: wanted1.9.1? → wanted1.9.1+
Comment 6•15 years ago
|
||
True, not sure if this is on the radar for another bug. It doesn't block anything. Igor? /be
Comment 7•15 years ago
|
||
Igor mentioned another bug relating to this in IRC, I don't remember which it was.
Assignee | ||
Comment 8•15 years ago
|
||
(In reply to comment #7) > Igor mentioned another bug relating to this in IRC, I don't remember which it > was. Most of the cleanup (js_GetMethod) comes from an initial prototype for bug 369696 to implement "the proper" solution there. That does not work (I will comment in the bug), but at least instead of throwing it away completely that part ended up in this bug.
Assignee | ||
Comment 9•15 years ago
|
||
landed to TM - http://hg.mozilla.org/tracemonkey/rev/4650f81f1853
Assignee | ||
Updated•15 years ago
|
Whiteboard: fixed-in-tracemonkey
Comment 10•15 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/4650f81f1853
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•