Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upPropertyName doesn't inherit Yield in AssignmentProperty #388
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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.
|
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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.
|
@littledan 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 comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
yup looks likes like an oversight in the ES6 grammar. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Oh I see, my mistake. |
jmdyck commentedFeb 12, 2016
(Following up on #374 (comment) ...)
In the production
I'm wondering why
PropertyNameisn'tPropertyName[?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.