archives

« Bugzilla Issues Index

#2342 — 12.1.5.1 Static Semantics of PropertyDefinition : IdentifierReference


From 12.1.5.1:

PropertyDefinition : IdentifierReference
• It is a Syntax Error if the PropertyDefinition is contained in strict code and if the IdentifierReference is: implements, interface, let, package, private, protected, public, static, or yield.
• It is a Syntax Error if IdentifierReference is a ReservedWord other than yield.

The second line seems incorrect to me. The first line implies we are banning future reserved words (and yield,) but the second line uses ReservedWord which would cover a superset of the list given on the first line. It would also be enforced in non-strict mode.

From 11.6.2:
ReservedWord ::
Keyword
FutureReservedWord
NullLiteral
BooleanLiteral

It seems to me that the intention here was to have the second line read:

It is a Syntax Error if IdentifierReference is a Keyword other than yield.


The set of FutureReservedWord tokens has been reduced to only contain the token 'enum', regardless of strict mode. That means 'implements', 'interface' etc. are never included in the ReservedWord token set.


You're correct. At a glance it seems that they are still part of FutureReservedWord. Perhaps we should highlight the difference a little more, since it looks similar to the ES5 version and may be missed.


In Rev23 I made sure that the NOTE about former future reserved words is correctly styled as a Note.