mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 942390 - Don't use the iterator cache if the object has an __iterator__ property. r=bhackett
This commit is contained in:
parent
334e43f829
commit
cbfe81d2aa
11
js/src/jit-test/tests/basic/bug942390.js
Normal file
11
js/src/jit-test/tests/basic/bug942390.js
Normal file
@ -0,0 +1,11 @@
|
||||
var count = 0;
|
||||
Object.defineProperty(__proto__, "__iterator__", {
|
||||
get: (function() {
|
||||
count++;
|
||||
})
|
||||
})
|
||||
__proto__ = (function(){})
|
||||
for (var m = 0; m < 7; ++m) {
|
||||
for (var a in 6) {}
|
||||
}
|
||||
assertEq(count, 7);
|
@ -618,8 +618,10 @@ js::GetIterator(JSContext *cx, HandleObject obj, unsigned flags, MutableHandleVa
|
||||
if (!pobj->isNative() ||
|
||||
!pobj->hasEmptyElements() ||
|
||||
pobj->hasUncacheableProto() ||
|
||||
obj->getOps()->enumerate ||
|
||||
pobj->getClass()->enumerate != JS_EnumerateStub) {
|
||||
pobj->getOps()->enumerate ||
|
||||
pobj->getClass()->enumerate != JS_EnumerateStub ||
|
||||
pobj->nativeContainsPure(cx->names().iteratorIntrinsic))
|
||||
{
|
||||
shapes.clear();
|
||||
goto miss;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user