mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 774257 - Fix accessor inlining for watched objects. (r=dvander)
This commit is contained in:
parent
5380036e57
commit
374edb776d
@ -4962,6 +4962,14 @@ IonBuilder::TestCommonPropFunc(JSContext *cx, types::TypeSet *types, HandleId id
|
||||
while (curObj != foundProto) {
|
||||
if (curObj->getType(cx)->unknownProperties())
|
||||
return true;
|
||||
|
||||
// If anyone on the chain is watched, TI thinks they have an own
|
||||
// property, which means if they were to actually overwrite the
|
||||
// property accessors, we would never know, since we are freezing on
|
||||
// setting that flag.
|
||||
if (!isGetter && curObj->watched())
|
||||
return true;
|
||||
|
||||
curObj = curObj->getProto();
|
||||
}
|
||||
}
|
||||
|
8
js/src/jit-test/tests/ion/bug774257-1.js
Normal file
8
js/src/jit-test/tests/ion/bug774257-1.js
Normal file
@ -0,0 +1,8 @@
|
||||
Object.defineProperty(Object.prototype, 'x', {
|
||||
set: function() { evalcx('lazy'); }
|
||||
});
|
||||
var obj = {};
|
||||
obj.watch("x", function (id, oldval, newval) {});
|
||||
for (var str in 'A') {
|
||||
obj.x = 1;
|
||||
}
|
10
js/src/jit-test/tests/ion/bug774257-2.js
Normal file
10
js/src/jit-test/tests/ion/bug774257-2.js
Normal file
@ -0,0 +1,10 @@
|
||||
Object.defineProperty(Object.prototype, 'x', {
|
||||
set: function() { evalcx('lazy'); }
|
||||
});
|
||||
var obj = {};
|
||||
var prot = {};
|
||||
obj.__proto__ = prot;
|
||||
obj.watch("x", function (id, oldval, newval) {});
|
||||
for (var str in 'A') {
|
||||
obj.x = 1;
|
||||
}
|
Loading…
Reference in New Issue
Block a user