From e5edb51ac9c30b7f1bb2db6e804dab0805850d3a Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Thu, 2 Mar 2023 10:24:21 -0800 Subject: [PATCH] Editorial: Throw on undefined early in GetIterator This is editorial because Call inside GetIteratorFromMethod would throw on undefined anyways, and this keeps GetIteratorFromMethod cleaner in only accepting function objects. --- spec.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec.html b/spec.html index 3e56dad6a5b..1a81b3a7e4c 100644 --- a/spec.html +++ b/spec.html @@ -6828,9 +6828,11 @@

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_).