archives

« Bugzilla Issues Index

#4082 — 13.5.1 + 13.6.0.1: "any occurrence of Statement in these rules"


In 13.5.1 "Static Semantics: Early Errors"
and 13.6.0.1 "Static Semantics: Early Errors",
the bullet says:
It is a Syntax Error if IsLabelledFunction(Statement) is true
for any occurrence of Statement in these rules.

The phrase "in these rules" is puzzling.
Changing it to "in this production" would make a bit more sense.


fixed in rev35 editor's draft

...in code matching these productions.


So:
"... for any occurrence of /Statement/ in code matching these productions"

But this could be interpreted to mean statements occurring *anywhere*
(i.e., at any level) within that code, which presumably is not intended.


(The terminology could be something like:
"... for any /Statement/ that is a child of this /IfStatement/"
or
"... for any /Statement/ that is a child of the target node"
but that's probably too much of a shift for ES6.)

---

Here's a different approach:

In 13.6.0.1, every RHS has exactly one /Statement/, so you can just say:
It is a Syntax Error if IsLabelledFunction(/Statement/) is true.

In 13.5.1, it's not so easy, since one RHS has 2 /Statement/s and the other has
1. Probably the clearest approach is to handle the two RHSs separately:
-- For the single-Statement form, you can use the same rule as in 13.6.0.1.
-- For the two-Statement form, you can say:
It is a Syntax Error if IsLabelledFunction(the first /Statement/) is true,
or IsLabelledFunction(the second /Statement/) is true.


I think it is sufficient to say

• It is a Syntax Error if IsLabelledFunction(Statement) is true.

for 13.5.1 it is obvious enough that when Statement occurs twice that the test has to be applied twice.


Well, I disagree, but I'll live with it.


fixed in rev35