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

Comments

Projects
None yet
5 participants
@jmdyck
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

This comment has been minimized.

Show comment
Hide comment
@littledan

littledan Feb 16, 2016

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.

Member

littledan commented Feb 16, 2016

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

This comment has been minimized.

Show comment
Hide comment
@michaelficarra

michaelficarra Feb 16, 2016

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.

Member

michaelficarra commented Feb 16, 2016

@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

This comment has been minimized.

Show comment
Hide comment
@allenwb

allenwb Feb 16, 2016

Member

yup

looks likes like an oversight in the ES6 grammar.

Member

allenwb commented Feb 16, 2016

yup

looks likes like an oversight in the ES6 grammar.

@littledan

This comment has been minimized.

Show comment
Hide comment
@littledan

littledan Feb 17, 2016

Member

Oh I see, my mistake.

Member

littledan commented Feb 17, 2016

Oh I see, my mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment