From 51a7e8ecba2be5d89321af245a151ee8ee4f7fe2 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 git-svn-id: svn://10.0.0.236/trunk@178705 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/js/src/jsxml.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mozilla/js/src/jsxml.c b/mozilla/js/src/jsxml.c index e0e8ffa1b51..08d18020c6b 100644 --- a/mozilla/js/src/jsxml.c +++ b/mozilla/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; }