Bug 868782 - Fix rooting hazards in txMozillaXSLTProcessor.cpp; r=till

This commit is contained in:
Ehsan Akhgari 2013-05-04 19:45:20 -04:00
parent cfa035fed9
commit f52ea50f54

View File

@ -1438,11 +1438,11 @@ txVariable::Convert(nsIVariant *aValue, txAExprResult** aResult)
JSContext* cx = nsContentUtils::GetCurrentJSContext();
NS_ENSURE_TRUE(cx, NS_ERROR_NOT_AVAILABLE);
JSObject *jsobj;
rv = holder->GetJSObject(&jsobj);
JS::RootedObject jsobj(cx);
rv = holder->GetJSObject(jsobj.address());
NS_ENSURE_SUCCESS(rv, rv);
JSString *str = JS_ValueToString(cx, OBJECT_TO_JSVAL(jsobj));
JS::RootedString str(cx, JS_ValueToString(cx, OBJECT_TO_JSVAL(jsobj)));
NS_ENSURE_TRUE(str, NS_ERROR_FAILURE);
nsDependentJSString value;