-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Behavior of for-in on null or undefined #377
Comments
It does eventually return an undefined value with a normal completion. The break completion value is handled uniformly in 13.1.7. I'm not sure if the break semantics are required for some reason but it does just work with the existing machinery so that's a plus. You could imagine (I think) checking the result of evaluating the head in each block of 13.7.5.11, though I'm not inclined to change this without good reason. |
Thank you, I missed that. |
What should happen when trying to enumerate (for-in) null or undefined? If I understand the spec correctly, currently such a for-in statement is equivalent to a break, which I find very strange:
http://tc39.github.io/ecma262/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind
(I would have expected that this returns a normal completion record with the undefined value.)
The text was updated successfully, but these errors were encountered: