Bug 779631 - Don't inline calls to setters on watched singleton objects. (r=dvander)

This commit is contained in:
Eric Faust 2012-08-01 14:18:47 -07:00
parent 8cca0afc1c
commit ec43218a83
2 changed files with 13 additions and 0 deletions

View File

@ -5236,6 +5236,10 @@ IonBuilder::TestCommonPropFunc(JSContext *cx, types::TypeSet *types, HandleId id
// Otherwise try using the prototype.
curObj = typeObj->proto;
} else {
// Can't optimize setters on watched singleton objects.
if (!isGetter && curObj->watched())
return true;
}
// Turns out that we need to check for a property lookup op, else we

View File

@ -0,0 +1,9 @@
var flag = 0;
var a = {};
Object.defineProperty(a, "value", {set: function(x) {}});
a.watch("value", function(){flag++;});
for(var i = 0; i < 100; i++) {
a.value = i;
assertEq(flag, i+1);
}