xml[index] only works for JSXML_CLASS_LIST (564377, r=brendan, CLOSED TREE).

This commit is contained in:
Andreas Gal
2010-05-07 13:33:57 -07:00
parent b6035e5759
commit 3b6a95444b
2 changed files with 23 additions and 22 deletions

View File

@@ -3816,7 +3816,7 @@ GetProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
return true;
if (js_IdIsIndex(id, &index)) {
if (xml->xml_class != JSXML_CLASS_LIST) {
if (!JSXML_HAS_KIDS(xml)) {
*vp = (index == 0) ? OBJECT_TO_JSVAL(obj) : JSVAL_VOID;
} else {
/*