Skip to content

Commit

Permalink
Normative: Suppress GetMethod errors in IteratorClose (#1408)
Browse files Browse the repository at this point in the history
Fixes #1398
  • Loading branch information
Kevin Smith authored and ljharb committed Apr 30, 2020
1 parent 5e722af commit 0b89915
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -6109,9 +6109,11 @@ <h1>IteratorClose ( _iteratorRecord_, _completion_ )</h1>
1. Assert: Type(_iteratorRecord_.[[Iterator]]) is Object.
1. Assert: _completion_ is a Completion Record.
1. Let _iterator_ be _iteratorRecord_.[[Iterator]].
1. Let _return_ be ? GetMethod(_iterator_, *"return"*).
1. If _return_ is *undefined*, return Completion(_completion_).
1. Let _innerResult_ be Call(_return_, _iterator_).
1. Let _innerResult_ be GetMethod(_iterator_, *"return"*).
1. If _innerResult_.[[Type]] is ~normal~, then
1. Let _return_ be _innerResult_.[[Value]].
1. If _return_ is *undefined*, return Completion(_completion_).
1. Set _innerResult_ to Call(_return_, _iterator_).
1. If _completion_.[[Type]] is ~throw~, return Completion(_completion_).
1. If _innerResult_.[[Type]] is ~throw~, return Completion(_innerResult_).
1. If Type(_innerResult_.[[Value]]) is not Object, throw a *TypeError* exception.
Expand All @@ -6126,10 +6128,12 @@ <h1>AsyncIteratorClose ( _iteratorRecord_, _completion_ )</h1>
1. Assert: Type(_iteratorRecord_.[[Iterator]]) is Object.
1. Assert: _completion_ is a Completion Record.
1. Let _iterator_ be _iteratorRecord_.[[Iterator]].
1. Let _return_ be ? GetMethod(_iterator_, *"return"*).
1. If _return_ is *undefined*, return Completion(_completion_).
1. Let _innerResult_ be Call(_return_, _iterator_).
1. If _innerResult_.[[Type]] is ~normal~, set _innerResult_ to Await(_innerResult_.[[Value]]).
1. Let _innerResult_ be GetMethod(_iterator_, *"return"*).
1. If _innerResult_.[[Type]] is ~normal~, then
1. Let _return_ be _innerResult_.[[Value]].
1. If _return_ is *undefined*, return Completion(_completion_).
1. Set _innerResult_ to Call(_return_, _iterator_).
1. If _innerResult_.[[Type]] is ~normal~, set _innerResult_ to Await(_innerResult_.[[Value]]).
1. If _completion_.[[Type]] is ~throw~, return Completion(_completion_).
1. If _innerResult_.[[Type]] is ~throw~, return Completion(_innerResult_).
1. If Type(_innerResult_.[[Value]]) is not Object, throw a *TypeError* exception.
Expand Down

0 comments on commit 0b89915

Please sign in to comment.