mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 10:33:33 +00:00
bug 305583: Toggle on the XML option, even if the script wasn't invoked with it when the XMLList constructor is used. r=brendan
This commit is contained in:
parent
40a183b424
commit
27d65f3d6e
@ -7028,6 +7028,7 @@ XMLList(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
jsval v;
|
||||
JSObject *vobj, *listobj;
|
||||
JSXML *xml, *list;
|
||||
uint32 oldopts;
|
||||
|
||||
v = argv[0];
|
||||
if (JSVAL_IS_NULL(v) || JSVAL_IS_VOID(v))
|
||||
@ -7051,9 +7052,14 @@ XMLList(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
}
|
||||
}
|
||||
|
||||
/* Toggle on XML support since the script has explicitly requested it. */
|
||||
oldopts = cx->options;
|
||||
JS_SetOptions(cx, oldopts | JSOPTION_XML);
|
||||
listobj = ToXMLList(cx, v);
|
||||
JS_SetOptions(cx, oldopts);
|
||||
if (!listobj)
|
||||
return JS_FALSE;
|
||||
|
||||
*rval = OBJECT_TO_JSVAL(listobj);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user