Skip to content
Permalink
Browse files

Normative: Fix yield * semantics when calling .throw

Previously, when the outer generator was resumed via .throw and
the delegate generator returned instead of threw, the yield *
would terminate with a return signal. Now, the result from the
delegate generator is passed through.

Fixes #293.
  • Loading branch information...
bterlson committed Feb 22, 2016
1 parent 5457a2f commit f0ef98ae9ecdfd1ed1e14721e795f6188a3107ee
Showing with 1 addition and 2 deletions.
  1. +1 −2 spec.html
1. If Type(_innerResult_) is not Object, throw a *TypeError* exception.
1. Let _done_ be ? IteratorComplete(_innerResult_).
1. If _done_ is *true*, then
1. Let _value_ be ? IteratorValue(_innerResult_).
1. Return Completion{[[type]]: ~return~ , [[value]]:_value_, [[target]]:~empty~}.
1. Return ? IteratorValue(_innerResult_).
1. Let _received_ be GeneratorYield(_innerResult_).
1. Else,
1. NOTE: If _iterator_ does not have a `throw` method, this throw is going to terminate the `yield*` loop. But first we need to give _iterator_ a chance to clean up.

0 comments on commit f0ef98a

Please sign in to comment.
You can’t perform that action at this time.