Bug 963701 - Unscope the JSAutoCompartment in InitTargetObjects. r=bz

This commit is contained in:
Andrew McCreight 2014-01-24 15:01:48 -08:00
Родитель 8aa8afcb8d
Коммит a338b8d9f0
1 изменённых файлов: 5 добавлений и 7 удалений

Просмотреть файл

@ -172,13 +172,11 @@ nsXBLProtoImpl::InitTargetObjects(nsXBLPrototypeBinding* aBinding,
JS::Rooted<JSObject*> global(cx, sgo->GetGlobalJSObject());
JS::Rooted<JS::Value> v(cx);
{
JSAutoCompartment ac(cx, global);
// Make sure the interface object is created before the prototype object
// so that XULElement is hidden from content. See bug 909340.
bool defineOnGlobal = dom::XULElementBinding::ConstructorEnabled(cx, global);
dom::XULElementBinding::GetConstructorObject(cx, global, defineOnGlobal);
}
JSAutoCompartment ac(cx, global);
// Make sure the interface object is created before the prototype object
// so that XULElement is hidden from content. See bug 909340.
bool defineOnGlobal = dom::XULElementBinding::ConstructorEnabled(cx, global);
dom::XULElementBinding::GetConstructorObject(cx, global, defineOnGlobal);
rv = nsContentUtils::WrapNative(cx, global, aBoundElement, &v);
NS_ENSURE_SUCCESS(rv, rv);