Adds full ECMAScript generator support end-to-end: parser recognizes function*/yield/yield* syntax, the bytecode compiler emits MakeGenerator, Yield, YieldStar, and GeneratorReturn opcodes, and the VM implements ECMAScript §27.5 generator state machines with scope save/restore across yield points so local variables survive suspension. The iterator protocol (bc_get_iterator/bc_iterator_next) is generalized to dispatch through GeneratorObject.next(), and generator objects implement Symbol.iterator returning themselves. Fourteen new bytecode-path tests cover basic yields, parameters, for-of, independent instances, .return()/.throw(), and generator expressions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
276 KiB
276 KiB