Bug 673503 - Make sure the prototype here is in the right compartment. r=wmccloskey

This commit is contained in:
Blake Kaplan 2011-07-22 12:14:02 -07:00
Родитель 6135d9b650
Коммит 39d4ccd938
2 изменённых файлов: 3 добавлений и 1 удалений

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

@ -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);