Closed
Bug 564377
Opened 15 years ago
Closed 15 years ago
TM: xml[index] only works for JSXML_CLASS_LIST
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: gal, Assigned: gal)
References
Details
Attachments
(1 file)
(deleted),
patch
|
brendan
:
review+
|
Details | Diff | Splinter Review |
My iteration code uses getProperty to lookup kids. Currently we only allow this for JSXML_CLASS_LIST. I think the right thing to do is JSXML_HAS_KIDS(xml).
Assignee | ||
Comment 1•15 years ago
|
||
Assignee: general → gal
Assignee | ||
Updated•15 years ago
|
Attachment #444044 -
Flags: review?(brendan)
Assignee | ||
Comment 2•15 years ago
|
||
It seems inconsistent that we list these properties if you do a foreach over the object, but you can't actually get them with [index].
Assignee | ||
Comment 3•15 years ago
|
||
This fails e4x/Expressions/11.2.1.js
Assignee | ||
Comment 4•15 years ago
|
||
I can work around this, but this behavior is really beyond insane. I would prefer to land this patch, even if that is against the standard and breaks the web, because the web and the standard are just plain wrong on this one.
Assignee | ||
Updated•15 years ago
|
Blocks: fastiterators
Comment 5•15 years ago
|
||
(In reply to comment #4)
> I can work around this,
Hm, but why it is necessary to ask for indexes and not the ids representing the names of E4X kids?
Comment 6•15 years ago
|
||
(In reply to comment #5)
> (In reply to comment #4)
> > I can work around this,
>
> Hm, but why it is necessary to ask for indexes and not the ids representing the
> names of E4X kids?
Ok, I see it. The problem is that xml_enumerates returns the indexes of kids and not the names even for XML object. I guess that should be changed to return names, but your workaround in the fast iteration bug also does the job
Comment 7•15 years ago
|
||
(In reply to comment #4)
> because the web and the standard are just plain wrong on this one.
I 1oo% agree on this. We should either land this patch or make the enumerator over XML objects to return the names of children the iterator will go over if E4X is so insisting on not using indexes when accessing XML children.
Comment 8•15 years ago
|
||
What does AS3's E4X impl (in Flash) do here? I recall Michael Daumling doing some de-insanification of the insane ECMA-357 standard.
/be
Comment 9•15 years ago
|
||
Comment on attachment 444044 [details] [diff] [review]
patch
Please update the test to check for our deviation from the spec, and comment the test loudly about it.
/be
Attachment #444044 -
Flags: review?(brendan) → review+
Assignee | ||
Comment 10•15 years ago
|
||
Comment 11•15 years ago
|
||
(In reply to comment #10)
> http://hg.mozilla.org/tracemonkey/rev/4f4c01fb42c3
It would be nice to update the test to verify that xml[index] points into the corresponding child.
Assignee | ||
Comment 12•15 years ago
|
||
I was trying but I couldn't figure out how to get to the child without ... well [1].
Comment 13•15 years ago
|
||
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
•