-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove hint from GetIteratorFlattenable #271
Conversation
spec.html
Outdated
1. Set _alreadyAsync_ to *false*. | ||
1. If IsCallable(_method_) is *false*, then | ||
1. Let _method_ be ? GetMethod(_obj_, @@iterator). | ||
1. If _method_ is *undefined*, then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change from Get/IsCallable to GetMethod/undefined is technically normative, but it more closely matches the existing GetIterator
behaviour. If obj
has a Symbol.iterator
property that is non-callable, it will now throw instead of falling back to treating obj
as an iterator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this to split it into a separate PR.
edit: See #272.
1. Let _iterator_ be _obj_. | ||
1. Set _alreadyAsync_ to *true*. | ||
1. Else, | ||
1. Let _iterator_ be ? Call(_method_, _obj_). | ||
1. If _iterator_ is not an Object, throw a *TypeError* exception. | ||
1. Let _nextMethod_ be ? Get(_iterator_, *"next"*). | ||
1. If IsCallable(_nextMethod_) is *false*, throw a *TypeError* exception. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line diverges from GetIterator
but the early failure is IMO better. See related tc39/ecma262#3033.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is purely editorial: it's removing a parameter whose value never changes and the paths for handling other values for that parameter.
This should have been included with #263.