Bug 987111 - Handle the Object.prototype case in Xray getPrototypeOf. r=gabor

This commit is contained in:
Bobby Holley 2014-06-04 15:12:26 -07:00
Родитель ce6b82c251
Коммит 6c6c52d3ec
1 изменённых файлов: 9 добавлений и 2 удалений

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

@ -346,8 +346,15 @@ public:
JS::MutableHandleObject protop)
{
RootedObject holder(cx, ensureHolder(cx, wrapper));
JSProtoKey key = isPrototype(holder) ? JSProto_Object
: getProtoKey(holder);
JSProtoKey key = getProtoKey(holder);
if (isPrototype(holder)) {
if (key == JSProto_Object) {
protop.set(nullptr);
return true;
}
key = JSProto_Object;
}
{
JSAutoCompartment ac(cx, target);
if (!JS_GetClassPrototype(cx, key, protop))