a = a /a/ this will cause syntax error instead of
a = a; /a/ Regards, Eric Suen ----- Original Message ----- From: "David-Sarah Hopwood" <[EMAIL PROTECTED]> Newsgroups: gmane.comp.lang.javascript.ecmascript4.general To: <[EMAIL PROTECTED]> Sent: Sunday, November 30, 2008 9:41 AM Subject: "where both a division and a RegularExpressionLiteral are permitted" > Section 7 (Lexical Conventions): > > # Note that contexts exist in the syntactic grammar where both a division > # and a RegularExpressionLiteral are permitted by the syntactic grammar; > # [...] > > I believe this statement is incorrect [*1]. > If I'm wrong, what is an example of such a context? > > > [*1] A DivisionPunctuator must be preceded by an expression. > A RegularExpressionLiteral is itself an expression. > Therefore, for there to exist syntactic contexts in which either > a DivisionPunctuator or a RegularExpressionLiteral could occur, > it would have to be possible for an expression to immediately > follow [*2] another expression with no intervening operator. > The only case in which that can occur is where a semicolon is > automatically inserted between the two expressions. > Assume that case: then the second expression cannot begin > with [*2] a token whose first character is '/', because that > would have been interpreted as a DivisionPunctuator, and so > no semicolon insertion would have occurred (because semicolon > insertion only occurs where there would otherwise have been a > syntax error); contradiction. > > [*2] Ignoring comments and whitespace. > > -- > David-Sarah Hopwood _______________________________________________ Es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

