From 27d65f3d6ebd7fd104df49910230e96eca27f60d Mon Sep 17 00:00:00 2001 From: "mrbkap%gmail.com" Date: Tue, 23 Aug 2005 17:10:47 +0000 Subject: [PATCH] bug 305583: Toggle on the XML option, even if the script wasn't invoked with it when the XMLList constructor is used. r=brendan --- js/src/jsxml.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/src/jsxml.c b/js/src/jsxml.c index e0e8ffa1b51a..08d18020c6b5 100644 --- a/js/src/jsxml.c +++ b/js/src/jsxml.c @@ -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; }