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

This commit is contained in:
Bobby Holley 2014-06-05 22:32:38 -07:00
Родитель 6bb5e95a97
Коммит bbc449149e
1 изменённых файлов: 9 добавлений и 2 удалений

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

@ -347,8 +347,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))