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

Allow "in" after empty yield expression #5216

Closed
wants to merge 1 commit into from

Conversation

zenparsing
Copy link
Contributor

I believe that this fixes #5203.

It also fixes a SyntaxError for the following case:

for (var i = () => {} in {});

(See v8 for reference.)

@rhuanjl Were you thinking of a different fix?

@akroshg Where should I put tests for this change?

@zenparsing
Copy link
Contributor Author

Ah, this causes a regression for:

function* g() {
  var x = yield in {};
}

Closing this PR for now.

@zenparsing zenparsing closed this May 23, 2018
@rhuanjl
Copy link
Collaborator

rhuanjl commented May 23, 2018

This seems like a better (and far simpler) approach than I had in mind.

That said seems we need to make it conditional on if its currently parsing the control section of a for loop - trying to work out an "easy" way to detect that.

@zenparsing zenparsing deleted the in-after-yield branch June 5, 2018 20:05
chakrabot pushed a commit that referenced this pull request Jul 27, 2018
#5203

Merge pull request #5219 from rhuanjl:fixYieldIn

Attempt at fixing issue #5203

Based on #5216

Not 100% sure I've got this right but it passes the mentioned cases and doesn't regress anything I'm aware of.

cc @zenparsing @akroshg
chakrabot pushed a commit that referenced this pull request Jul 27, 2018
…ons in for fixes #5203

Merge pull request #5219 from rhuanjl:fixYieldIn

Attempt at fixing issue #5203

Based on #5216

Not 100% sure I've got this right but it passes the mentioned cases and doesn't regress anything I'm aware of.

cc @zenparsing @akroshg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chakra throws a SyntaxError on for...in statement
2 participants