-
Notifications
You must be signed in to change notification settings - Fork 785
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
Generator: correctly distinguish yield as identifier vs keyword #1186
Comments
Closed
For a previous ref, see #1178 (comment). |
ariya
added a commit
to ariya/esprima
that referenced
this issue
Jul 7, 2015
`yield` is a keyword in strict mode, inside a generator, or as part of a yield expression. `yield` may be used as an identifier for the name of generators, methods, object properties, and function expressions. Fixes jquery#1186
Please note that there is also another issue with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Valid Syntax
Nested yield expression:
yield
as the name of a generator, declaration and method:yield
as the default value:Function expression:
Property name:
Object pattern:
Arrow expression:
Non-strict mode use of
yield
as an identifier:Parse Failures
yield
is not allowed as a binding identifier:Strict mode violation (each line is its own example):
Yield expression in a wrong place:
The text was updated successfully, but these errors were encountered: