Bug 777546 - Root the minimum XML stuff necessary to pass jstests

--HG--
extra : rebase_source : 531766441ca042d9588e68a479fb402ad8c399be
This commit is contained in:
Steve Fink 2012-07-25 16:10:19 -07:00
parent 40cc44ab0e
commit 49d155b6fc
2 changed files with 8 additions and 5 deletions

View File

@ -7310,8 +7310,9 @@ NewXMLObject(JSContext *cx, JSXML *xml)
}
JSObject *
js_GetXMLObject(JSContext *cx, JSXML *xml)
js_GetXMLObject(JSContext *cx, JSXML *xmlArg)
{
Rooted<JSXML*> xml(cx, xmlArg);
JSObject *obj;
obj = xml->object;
@ -7399,12 +7400,12 @@ js_InitXMLClass(JSContext *cx, JSObject *obj)
cx->runtime->gcExactScanningEnabled = false;
JS_ASSERT(obj->isNative());
GlobalObject *global = &obj->asGlobal();
Rooted<GlobalObject*> global(cx, &obj->asGlobal());
JSObject *xmlProto = global->createBlankPrototype(cx, &XMLClass);
RootedObject xmlProto(cx, global->createBlankPrototype(cx, &XMLClass));
if (!xmlProto)
return NULL;
JSXML *xml = js_NewXML(cx, JSXML_CLASS_TEXT);
Rooted<JSXML*> xml(cx, js_NewXML(cx, JSXML_CLASS_TEXT));
if (!xml)
return NULL;
xmlProto->setPrivate(xml);
@ -7449,7 +7450,7 @@ js_InitXMLClass(JSContext *cx, JSObject *obj)
return NULL;
/* Define the isXMLName function. */
if (!JS_DefineFunction(cx, obj, js_isXMLName_str, xml_isXMLName, 1, 0))
if (!JS_DefineFunction(cx, global, js_isXMLName_str, xml_isXMLName, 1, 0))
return NULL;
return xmlProto;

View File

@ -177,6 +177,8 @@ struct JSXML : js::gc::Cell {
static void writeBarrierPre(JSXML *xml);
static void writeBarrierPost(JSXML *xml, void *addr);
static inline js::ThingRootKind rootKind() { return js::THING_ROOT_XML; }
};
/* xml_flags values */