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)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: gal, Assigned: gal)

References

Details

Attachments

(1 file)

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).
Attached patch patch (deleted) — Splinter Review
Assignee: general → gal
Attachment #444044 - Flags: review?(brendan)
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].
This fails e4x/Expressions/11.2.1.js
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.
(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?
(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
(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.
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 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+
(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.
I was trying but I couldn't figure out how to get to the child without ... well [1].
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.

Attachment

General

Created:
Updated:
Size: