Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[parser] `arguments` and `eval` as object shorthand should be valid in strict mode #10411
The object key shorthand syntax is checking the ident for being a keyword and triggers an error. This is not correct for
It will throw a syntax error
It will properly apply sloppy/strict mode exceptions (script vs module goal). So
Not sure if same bug, but definitely related is the next one, where the
It should not throw an error because it's a regular object key and a read from
Add exception path for
Hey @pvdz! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.
Oh wow, thanks for that. I completely missed that detail.
Looking explicitly at it now, https://tc39.es/ecma262/#prod-PropertyDefinition uses https://tc39.es/ecma262/#prod-IdentifierReference for a shorthand. This leads to https://tc39.es/ecma262/#prod-Identifier which forbids "keywords". So you're absolutely correct; this is a syntax error.