Implements issue 3mhn3peabad2h
Summary #
- Generator functions:
function*,yield,yield*,generator.next(value),generator.return(value),generator.throw(error) - Iterator protocol:
Symbol.iterator(@@iterator),for...ofloops using the iterator protocol - Built-in iterators:
Array.prototype[@@iterator],String.prototype[@@iterator],Map.prototype[@@iterator],Set.prototype[@@iterator], pluskeys()/values()/entries()returning proper iterators - Destructuring fixes: Fixed register allocation LIFO violations, added rest elements for both array (
[a, ...rest]) and object ({a, ...rest}) destructuring - Spread operator:
[...arr]in array literals using the iterator protocol - Bytecode: Added
YieldandSpreadopcodes,is_generatorflag on Function - 25 new tests covering generators, for...of, destructuring, spread, and custom iterables
All 495 JS unit tests pass. Clippy clean. Formatted.