зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
98889870b9
Коммит
847bc05271
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче