зеркало из https://github.com/mozilla/pjs.git
Use right compartment when resolving prototypes (bug 620028, r=jst).
This commit is contained in:
Родитель
22e5ea4090
Коммит
521afa6f81
|
@ -6266,6 +6266,11 @@ ResolvePrototype(nsIXPConnect *aXPConnect, nsGlobalWindow *aWin, JSContext *cx,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dot_prototype) {
|
if (dot_prototype) {
|
||||||
|
JSAutoEnterCompartment ac;
|
||||||
|
if (!ac.enter(cx, dot_prototype)) {
|
||||||
|
return NS_ERROR_UNEXPECTED;
|
||||||
|
}
|
||||||
|
|
||||||
JSObject *xpc_proto_proto = ::JS_GetPrototype(cx, dot_prototype);
|
JSObject *xpc_proto_proto = ::JS_GetPrototype(cx, dot_prototype);
|
||||||
|
|
||||||
if (proto &&
|
if (proto &&
|
||||||
|
@ -6277,6 +6282,11 @@ ResolvePrototype(nsIXPConnect *aXPConnect, nsGlobalWindow *aWin, JSContext *cx,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
JSAutoEnterCompartment ac;
|
||||||
|
if (!ac.enter(cx, winobj)) {
|
||||||
|
return NS_ERROR_UNEXPECTED;
|
||||||
|
}
|
||||||
|
|
||||||
dot_prototype = ::JS_NewObject(cx, &sDOMConstructorProtoClass, proto,
|
dot_prototype = ::JS_NewObject(cx, &sDOMConstructorProtoClass, proto,
|
||||||
winobj);
|
winobj);
|
||||||
NS_ENSURE_TRUE(dot_prototype, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(dot_prototype, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче