Bug 942390 - Don't use the iterator cache if the object has an __iterator__ property. r=bhackett

This commit is contained in:
Jan de Mooij
2013-11-28 11:09:40 +01:00
parent 0d80b003d4
commit 16db005c1d
2 changed files with 15 additions and 2 deletions

View File

@@ -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;
}