mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 16:59:43 +01:00
A realm made with Options::es2015 reads function* declarations and expressions, *name() methods in object literals, yield and yield*, as ECMA-262 11th edition sections 14.4 and 25.4 define them. A suspended generator keeps its frame in its object; next, return and throw on %GeneratorPrototype% push it back on the interpreter's frame stack, so a resumption takes fuel and counts against the frame limit, and return runs the finally blocks around the yield. Resuming a running generator throws a TypeError. yield* passes next, throw and return on to its iterator and closes one without throw before throwing a TypeError. %GeneratorFunction% is reached through a generator function's constructor. Outside generators, sloppy code still reads yield as a name, and a realm without the option reads function* as a syntax error. An engine that #targetengine kept from a .jsx run has no generator built-ins, so a generator function called there throws a TypeError. cargo xtask test262 runs the generator folders: 509 of 549 runs pass (94 of 96 before). Docs: docs/mcp.md, docs/target-app-parity.md.