Bug 681061 - Avoid compartment mismatch error when displaying a growl notification. r=mrbkap

This commit is contained in:
Josh Matthews 2011-08-22 17:20:52 -04:00
Родитель 500348dd4e
Коммит 677290f8fb
1 изменённых файлов: 4 добавлений и 0 удалений

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

@ -79,6 +79,10 @@ GetWindowOfObserver(nsIObserver* aObserver)
NS_ENSURE_SUCCESS(rv, nsnull); NS_ENSURE_SUCCESS(rv, nsnull);
JSAutoRequest ar(cx); JSAutoRequest ar(cx);
JSAutoEnterCompartment ac;
if (!ac.enter(cx, obj)) {
return nsnull;
}
JSObject* global = JS_GetGlobalForObject(cx, obj); JSObject* global = JS_GetGlobalForObject(cx, obj);
NS_ENSURE_TRUE(global, nsnull); NS_ENSURE_TRUE(global, nsnull);