Generator now returns IteratorResult instead of throwing

Published: | Categories: JavaScript | Creative Commons BY-SA 3.0

Description

The ECMAScript 6 compliant syntax for Generators (yield) has been introduced with Firefox 26. The implementation has been updated for the latest spec, and a completed generator function now returns an IteratorResult object like { value: undefined, done: true } instead of throwing a TypeError. This behaviour matches the iterator of the Array, Map and Set interfaces, that the implementation has been updated with Firefox 27.

References