Exactly where is a RegularExpressionLiteral allowed?
Allen.Wirfs-Brock at microsoft.com
Mon Mar 23 19:04:55 PDT 2009
>From: es-discuss-bounces at mozilla.org [mailto:es-discuss-
>bounces at mozilla.org] On Behalf Of Brendan Eich
>Sent: Monday, March 23, 2009 6:39 PM
>> It should be Literal, not PrimaryExpression. There is no technical
>> difference (since Literal is only used as one of the alternatives
>> for PrimaryExpression), but it's just common sense that a
>> RegularExpressionLiteral is a literal.
>Agreed, presumably Allen agrees too. It's obvious now that you point
>it out ;-).
Homefully I'm relatively agreeable...Strictly speaking RegularExpressionLiteral is now semantically more like an ArrayLiteral or an Object literal in that one of them evaluates to a different object each time it is executed. However, I don't think it actually makes much of a difference whether it is a Literal or a PrimaryExpression and since I'm certainly not proposing that we move it from section 7 to section 11 at this point in time it probably makes more sense to say it is a Literal.
More information about the Es-discuss