Bug 1034239 - Add Proxies to ForceCOWBehavior. r=gabor

This commit is contained in:
Bobby Holley 2014-07-10 09:31:37 -07:00
Родитель 67c77aebbd
Коммит bba8240dd7
1 изменённых файлов: 7 добавлений и 3 удалений

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

@ -121,9 +121,8 @@ WrapperFactory::DoubleWrap(JSContext *cx, HandleObject obj, unsigned flags)
}
// In general, we're trying to deprecate COWs incrementally as we introduce
// Xrays to the corresponding object types. But switching off COWs for Object
// and Array instances would be too tumultuous at present, so we punt on that
// for later.
// Xrays to the corresponding object types. But switching off COWs for certain
// things would be too tumultuous at present, so we punt on them for later.
static bool
ForceCOWBehavior(JSObject *obj)
{
@ -134,6 +133,11 @@ ForceCOWBehavior(JSObject *obj)
"instances modulo this hack");
return true;
}
// Proxies get OpaqueXrayTraits, but we still need COWs to them for now to
// let the SpecialPowers wrapper work.
if (key == JSProto_Proxy)
return true;
return false;
}