// |reftest| shell-option(--enable-iterator-helpers) skip-if(!this.hasOwnProperty('Iterator')||!xulRuntime.shell) -- iterator-helpers is not enabled unconditionally, requires shell-options // Copyright (C) 2023 Michael Ficarra. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- esid: sec-iteratorprototype.every description: > Underlying iterator next returns object with throwing done getter info: | %Iterator.prototype%.every ( predicate ) 4.a. Let next be ? IteratorStep(iterated). features: [iterator-helpers] flags: [] ---*/ class ThrowingIterator extends Iterator { next() { return { get done() { throw new Test262Error(); }, value: 1, }; } return() { throw new Error(); } } let iterator = new ThrowingIterator(); assert.throws(Test262Error, function () { iterator.every(() => {}); }); reportCompare(0, 0);