From d4b43f3df0a3df69630fef262dff76849318b14d Mon Sep 17 00:00:00 2001 From: Brian Hackett Date: Fri, 27 Aug 2010 11:07:18 -0700 Subject: [PATCH] Fix crash on nested Iterator iteration, bug 590813. r=gal --- js/src/jsiter.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/js/src/jsiter.cpp b/js/src/jsiter.cpp index 079de7c2a43..607253a9805 100644 --- a/js/src/jsiter.cpp +++ b/js/src/jsiter.cpp @@ -123,16 +123,11 @@ NativeIterator::mark(JSTracer *trc) MarkObject(trc, obj, "obj"); } -/* - * Shared code to close iterator's state either through an explicit call or - * when GC detects that the iterator is no longer reachable. - */ static void iterator_finalize(JSContext *cx, JSObject *obj) { JS_ASSERT(obj->getClass() == &js_IteratorClass); - /* Avoid double work if the iterator was closed by JSOP_ENDITER. */ NativeIterator *ni = obj->getNativeIterator(); if (ni) { cx->free(ni); @@ -811,8 +806,6 @@ js_CloseIterator(JSContext *cx, JSObject *obj) ni->props_cursor = ni->props_array; ni->next = *hp; *hp = obj; - } else { - iterator_finalize(cx, obj); } } #if JS_HAS_GENERATORS