Skip to content

Commit

Permalink
Editorial: Throw on undefined early in GetIterator
Browse files Browse the repository at this point in the history
This is editorial because Call inside GetIteratorFromMethod would throw
on undefined anyways, and this keeps GetIteratorFromMethod cleaner in
only accepting function objects.
  • Loading branch information
syg committed Mar 2, 2023
1 parent ce7b60e commit e5edb51
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -6828,9 +6828,11 @@ <h1>
1. Let _method_ be ? GetMethod(_obj_, @@asyncIterator).
1. If _method_ is *undefined*, then
1. Let _syncMethod_ be ? GetMethod(_obj_, @@iterator).
1. If _syncMethod_ is *undefined*, throw a *TypeError* exception.
1. Let _syncIteratorRecord_ be ? GetIteratorFromMethod(_obj_, _syncMethod_).
1. Return CreateAsyncFromSyncIterator(_syncIteratorRecord_).
1. Otherwise, let _method_ be ? GetMethod(_obj_, @@iterator).
1. If _method_ is *undefined*, throw a *TypeError* exception.
1. Return ? GetIteratorFromMethod(_obj_, _method_).
</emu-alg>
</emu-clause>
Expand Down

0 comments on commit e5edb51

Please sign in to comment.