Bug 780370 - Clarify the compartment situation in ChromeObjectWrapper. r=mrbkap

Not sure what I was thinking before. We should always be in the compartment of the wrapper here.
This commit is contained in:
Bobby Holley 2012-08-23 19:07:13 -07:00
Родитель 98889870b9
Коммит 847bc05271
1 изменённых файлов: 3 добавлений и 3 удалений

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

@ -34,7 +34,7 @@ ChromeObjectWrapper::getPropertyDescriptor(JSContext *cx, JSObject *wrapper,
return true;
// If not, try doing the lookup on the prototype.
JSAutoCompartment ac(cx, wrapper);
JS_ASSERT(js::IsObjectInContextCompartment(wrapper, cx));
return JS_GetPropertyDescriptorById(cx, wrapperProto, id, 0, desc);
}
@ -51,7 +51,7 @@ ChromeObjectWrapper::has(JSContext *cx, JSObject *wrapper, jsid id, bool *bp)
return true;
// Try the prototype if that failed.
JSAutoCompartment ac(cx, wrapper);
JS_ASSERT(js::IsObjectInContextCompartment(wrapper, cx));
JSPropertyDescriptor desc;
if (!JS_GetPropertyDescriptorById(cx, wrapperProto, id, 0, &desc))
return false;
@ -73,7 +73,7 @@ ChromeObjectWrapper::get(JSContext *cx, JSObject *wrapper, JSObject *receiver,
return true;
// Try the prototype.
JSAutoCompartment ac(cx, wrapper);
JS_ASSERT(js::IsObjectInContextCompartment(wrapper, cx));
return js::GetGeneric(cx, wrapperProto, receiver, id, vp);
}