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

"yield" keyword with no value causes an error #121

Closed
hegemonic opened this issue Apr 6, 2015 · 2 comments
Closed

"yield" keyword with no value causes an error #121

hegemonic opened this issue Apr 6, 2015 · 2 comments

Comments

@hegemonic
Copy link

According to the ES 2015 spec, a YieldExpression with no value is valid. (You can see some examples in Axel Rauschmayer's article on generators.) However, Espree currently throws an error when it attempts to parse the following code, with generators enabled:

function* asyncFunc() {
    var caller = yield;
}

Changing yield to yield 1 allows parsing to succeed.

@nzakas
Copy link
Member

nzakas commented Apr 7, 2015

Thanks, I'll take a look.

@nzakas
Copy link
Member

nzakas commented Apr 11, 2015

Working on this.

@nzakas nzakas closed this as completed in 8ae98cf Apr 11, 2015
nzakas added a commit that referenced this issue Apr 11, 2015
Fix: Yield should parse without an argument (fixes #121)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants