зеркало из https://github.com/mozilla/gecko-dev.git
Bug 673503 - Make sure the prototype here is in the right compartment. r=wmccloskey
This commit is contained in:
Родитель
6135d9b650
Коммит
39d4ccd938
|
@ -1175,6 +1175,8 @@ JS_FRIEND_API(JSObject *)
|
|||
NewProxyObject(JSContext *cx, JSProxyHandler *handler, const Value &priv, JSObject *proto,
|
||||
JSObject *parent, JSObject *call, JSObject *construct)
|
||||
{
|
||||
JS_ASSERT_IF(proto, cx->compartment == proto->compartment());
|
||||
JS_ASSERT_IF(parent, cx->compartment == parent->compartment());
|
||||
bool fun = call || construct;
|
||||
Class *clasp;
|
||||
if (fun)
|
||||
|
|
|
@ -111,7 +111,7 @@ WrapperFactory::WaiveXray(JSContext *cx, JSObject *obj)
|
|||
return nsnull;
|
||||
|
||||
JSAutoEnterCompartment ac;
|
||||
if (!ac.enter(cx, obj))
|
||||
if (!ac.enter(cx, obj) || !JS_WrapObject(cx, &proto))
|
||||
return nsnull;
|
||||
wobj = JSWrapper::New(cx, obj, proto, JS_GetGlobalForObject(cx, obj),
|
||||
&WaiveXrayWrapperWrapper);
|
||||
|
|
Загрузка…
Ссылка в новой задаче