archives

« Bugzilla Issues Index

#1577 — "This rule is recursively applied" rule is opaque


ES6 replaces the ES5 "early error" language with static semantics, a welcome change.

However, people seem to have trouble understanding the new rules about 'delete', especially the second rule. It says:

> * It is a Syntax Error if the derived UnaryExpression is
> PrimaryExpression : CoverParenthesisedExpressionAndArrowParameterList
> and derives a production that is used in place of UnaryExpression would
> produce a Syntax Error according to these rules. This rule is
> recursively applied.

https://people.mozilla.com/~jorendorff/es6-draft.html#sec-11.4.1

It means:

If `delete EXPR` is a syntax error, then so is `delete (EXPR)`.

Can the language be made clearer? Failing that, I think a NOTE is in order.


An example of an ES1-5 spec veteran not immediately grasping this rule occurs in the second paragraph of the comment here:

https://bugzilla.mozilla.org/show_bug.cgi?id=888002#c5


I just noticed there's a typo in the rule.
"that is used" should be "that if used".

I don't think that is the main issue here though.


fixed in rev16 editor's draft

tweaked the language of the recursive application rule and added a clarify note in: 11.4.4, 11.13.3.1, 12.6.4.1


fixed in rev16 draft. July 15, 2013