Bug 887558 (part 1) - Introduce ProxyObject and some sub-classes. r=jorendorff.
This commit is contained in:
@@ -106,7 +106,7 @@ Enumerate(JSContext *cx, HandleObject pobj, jsid id,
|
||||
if (JS_UNLIKELY(!pobj->getTaggedProto().isObject() && JSID_IS_ATOM(id, cx->names().proto)))
|
||||
return true;
|
||||
|
||||
if (!(flags & JSITER_OWNONLY) || pobj->isProxy() || pobj->getOps()->enumerate) {
|
||||
if (!(flags & JSITER_OWNONLY) || pobj->is<ProxyObject>() || pobj->getOps()->enumerate) {
|
||||
/* If we've already seen this, we definitely won't add it. */
|
||||
IdSet::AddPtr p = ht.lookupForAdd(id);
|
||||
if (JS_UNLIKELY(!!p))
|
||||
@@ -117,7 +117,7 @@ Enumerate(JSContext *cx, HandleObject pobj, jsid id,
|
||||
* the prototype chain, but custom enumeration behaviors might return
|
||||
* duplicated properties, so always add in such cases.
|
||||
*/
|
||||
if ((pobj->isProxy() || pobj->getProto() || pobj->getOps()->enumerate) && !ht.add(p, id))
|
||||
if ((pobj->is<ProxyObject>() || pobj->getProto() || pobj->getOps()->enumerate) && !ht.add(p, id))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ Snapshot(JSContext *cx, JSObject *pobj_, unsigned flags, AutoIdVector *props)
|
||||
if (!EnumerateNativeProperties(cx, pobj, flags, ht, props))
|
||||
return false;
|
||||
} else {
|
||||
if (pobj->isProxy()) {
|
||||
if (pobj->is<ProxyObject>()) {
|
||||
AutoIdVector proxyProps(cx);
|
||||
if (flags & JSITER_OWNONLY) {
|
||||
if (flags & JSITER_HIDDEN) {
|
||||
@@ -682,7 +682,7 @@ js::GetIterator(JSContext *cx, HandleObject obj, unsigned flags, MutableHandleVa
|
||||
}
|
||||
|
||||
miss:
|
||||
if (obj->isProxy()) {
|
||||
if (obj->is<ProxyObject>()) {
|
||||
types::MarkIteratorUnknown(cx);
|
||||
return Proxy::iterate(cx, obj, flags, vp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user