[INFER] Scan entire prototype chain for a lookupProperty hook when nop-ing accesses on singleton objects, bug 673788.

This commit is contained in:
Brian Hackett 2011-07-25 15:00:42 -07:00
parent f3f515f0f4
commit 568dfb4413
2 changed files with 18 additions and 4 deletions

View File

@ -0,0 +1,10 @@
// |jit-test| error: ReferenceError
p = Proxy.create({
has: function() {}
})
Object.prototype.__proto__ = p
n = [];
(function() {
var a = [];
if (b) t = a.s()
})()

View File

@ -4622,10 +4622,14 @@ mjit::Compiler::testSingletonProperty(JSObject *obj, jsid id)
* properties to be explicitly marked with undefined.
*/
if (!obj->isNative())
return false;
if (obj->getClass()->ops.lookupProperty)
return false;
JSObject *nobj = obj;
while (nobj) {
if (!nobj->isNative())
return false;
if (nobj->getClass()->ops.lookupProperty)
return false;
nobj = nobj->getProto();
}
JSObject *holder;
JSProperty *prop = NULL;