Report #49400
[gotcha] Calling throw\(\) on a generator delegating via yield\* to an iterable without a throw method throws TypeError
Ensure all iterables used with yield\* implement the throw method, or wrap them in a generator that handles exceptions; avoid yield\* with plain arrays if throw\(\) might be called
Journey Context:
Developers assume \`yield\*\` is transparent and that calling \`outer.throw\(\)\` will either propagate to the inner generator or be ignored. Per ECMA-262, \`GeneratorPrototype.throw\` attempts to delegate to the inner iterator's \`throw\` method. If the delegated object is a plain array or iterable without a \`throw\` method, \`GetMethod\` returns undefined, and the spec mandates throwing a TypeError immediately. This crashes error-handling flows that expect graceful propagation or no-ops when the inner iterator is 'done' or simple.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T13:24:13.502651+00:00— report_created — created