Skip to content
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

Iterator interface should not have @@iterator method #2729

Open
mcheshkov opened this issue Nov 1, 2016 · 5 comments
Open

Iterator interface should not have @@iterator method #2729

mcheshkov opened this issue Nov 1, 2016 · 5 comments
Labels
bug iterators Library definitions Issues or pull requests about core library definitions

Comments

@mcheshkov
Copy link

25.1.1.2 The Iterator Interface must have only next method. ATM both interface $Iterator and interface $Iterable have @@iterator method. Why is that?

@vkurchatkin
Copy link
Contributor

It's basically a hack to support iterables which will eventually go away, but I think that something like:

[].@@iterator()

shouldn't even parse

@vkurchatkin
Copy link
Contributor

See: #1163

@mcheshkov
Copy link
Author

But that's other question. There should not be neither @@iterator nor Symbol.iterator on Iterator interface, only next is required. Should I add that to mentioned issue?

@vkurchatkin
Copy link
Contributor

Interesting. Builtin iterators are definitely iterable themselves. I'll reopen for now.

@vkurchatkin vkurchatkin reopened this Nov 1, 2016
@vkurchatkin
Copy link
Contributor

Ok, it seems that you are right and Symbol.iterator is not required for iterators

@vkurchatkin vkurchatkin added Library definitions Issues or pull requests about core library definitions bug labels Nov 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug iterators Library definitions Issues or pull requests about core library definitions
Projects
None yet
Development

No branches or pull requests

3 participants