Bug 1080312 - Update iteration code from upstream. r=jesup, a=1.4+