You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All Early Error rules for Y and its derived productions
also apply to the Y that is covered by X.
[As of the merge of PR #2604, these are now bundled into the definition of "must cover".]
But talking about the application of EE rules to the Y makes me wonder about the application of EE rules to the X.
The spec says very little on this topic. About the only thing I could find is in 13.2.5.1, where it says (roughly) that if an ObjectLiteral occurs in X, then don't apply a particular EE rule. (B.3.1 has similar wording.) This seems to imply that one should apply EE rules to X except where specifically told otherwise (as here).
But it seems to me that if X is (roughly speaking) a parsing hack, and Y represents the 'true' structure of the text (in the sense that it's the structure upon which the spec defines the semantics of the text), then you should never apply EE rules to the X, only the Y.
So can anyone give an example of where you actually need to apply EE rules to the X (the initial parse), to find an error that you wouldn't find by applying EE rules to only the Y (the thing that X covers)?
Or conversely, an example where applying EE rules to the X (other than where explicitly forbidden) finds a spurious error in a valid script (valid according to test262 or web reality, say).
The text was updated successfully, but these errors were encountered:
Every Early Error (EE) rule of the form:
is accompanied by a rule of the form:
[As of the merge of PR #2604, these are now bundled into the definition of "must cover".]
But talking about the application of EE rules to the Y makes me wonder about the application of EE rules to the X.
The spec says very little on this topic. About the only thing I could find is in 13.2.5.1, where it says (roughly) that if an ObjectLiteral occurs in X, then don't apply a particular EE rule. (B.3.1 has similar wording.) This seems to imply that one should apply EE rules to X except where specifically told otherwise (as here).
But it seems to me that if X is (roughly speaking) a parsing hack, and Y represents the 'true' structure of the text (in the sense that it's the structure upon which the spec defines the semantics of the text), then you should never apply EE rules to the X, only the Y.
So can anyone give an example of where you actually need to apply EE rules to the X (the initial parse), to find an error that you wouldn't find by applying EE rules to only the Y (the thing that X covers)?
Or conversely, an example where applying EE rules to the X (other than where explicitly forbidden) finds a spurious error in a valid script (valid according to test262 or web reality, say).
The text was updated successfully, but these errors were encountered: