Trigger appropriate proxy trap for Object.getOwnPropertyNames (bug 628333, r=jwalden).

This commit is contained in:
Andreas Gal
2011-01-24 22:39:58 -08:00
parent 4cea35b9ce
commit af584ed263
2 changed files with 18 additions and 4 deletions

View File

@@ -286,8 +286,13 @@ Snapshot(JSContext *cx, JSObject *obj, uintN flags, AutoIdVector *props)
if (pobj->isProxy()) {
AutoIdVector proxyProps(cx);
if (flags & JSITER_OWNONLY) {
if (!JSProxy::keys(cx, pobj, proxyProps))
return false;
if (flags & JSITER_HIDDEN) {
if (!JSProxy::getOwnPropertyNames(cx, pobj, proxyProps))
return false;
} else {
if (!JSProxy::keys(cx, pobj, proxyProps))
return false;
}
} else {
if (!JSProxy::enumerate(cx, pobj, proxyProps))
return false;