Bug 842940 - Don't squelch exceptions in Proxy::get. r=jorendorff

This commit is contained in:
Bobby Holley 2013-02-21 13:32:13 -08:00
parent 42fab6e49a
commit dd9c320e78
2 changed files with 9 additions and 2 deletions

View File

@ -0,0 +1 @@
try { for (let v of wrapWithProto(Proxy.create({}), [])) { } } catch (e) {}

View File

@ -2342,8 +2342,14 @@ Proxy::get(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id
{
JS_CHECK_RECURSION(cx, return false);
BaseProxyHandler *handler = GetProxyHandler(proxy);
bool own = false;
if (!handler->hasPrototype() || (handler->hasOwn(cx, proxy, id, &own) && own))
bool own;
if (!handler->hasPrototype()) {
own = true;
} else {
if (!handler->hasOwn(cx, proxy, id, &own))
return false;
}
if (own)
return handler->get(cx, proxy, receiver, id, vp.address());
INVOKE_ON_PROTOTYPE(cx, handler, proxy, JSObject::getGeneric(cx, proto, receiver, id, vp));
}