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

PropertyName doesn't inherit Yield in AssignmentProperty #388

Closed
jmdyck opened this issue Feb 12, 2016 · 4 comments
Closed

PropertyName doesn't inherit Yield in AssignmentProperty #388

jmdyck opened this issue Feb 12, 2016 · 4 comments
Labels

Comments

@jmdyck
Copy link
Collaborator

jmdyck commented Feb 12, 2016

(Following up on #374 (comment) ...)

In the production

    AssignmentProperty[Yield] : PropertyName `:` AssignmentElement[?Yield]

I'm wondering why PropertyName isn't PropertyName[?Yield]. Everywhere else that PropertyName appears, it inherits the setting of the Yield parameter.

I've looked at other places in the grammar where a nonterminal could inherit a parameter-setting but doesn't, and I could generally see why, but not in this case.

And I looked in test262 and didn't find a test that would distinguish the two possibilities.

So I'm thinking it's maybe a bug.

@littledan
Copy link
Member

Generally properties can have any keyword name (e.g., return, throw, to take a couple examples used in primordials) so I think this is fine.

@michaelficarra
Copy link
Member

@littledan PropertyName only has the Yield flag so it can pass it on to ComputedPropertyName. As you said, it doesn't matter for LiteralPropertyName, which doesn't even accept the flag.

I believe the grammar says

function *g() {
  ({[yield]: x} = y);
}

would not be a valid program, but will become valid if this flag is added. 👍 This change sounds good.

@allenwb
Copy link
Member

allenwb commented Feb 16, 2016

yup

looks likes like an oversight in the ES6 grammar.

@littledan
Copy link
Member

Oh I see, my mistake.

jmdyck added a commit to jmdyck/ecma262 that referenced this issue Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants