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
Annex B 3.2 could be made more strict by making a second type of LabelledStatement, which is only permitted as a StatementListItem and not as a Statement, which allows FunctionDeclaration as the LabelledItem, and the ordinary LabelledStatement could be left alone
The spec could explicitly give Annex B 3.4-style semantics to a whole bunch more constructs.
Based on the general design of Annex B, trying to be minimal, I think we might want to go with the first option. Thoughts?
With all of Annex B 3 in effect, it seems like the syntax permits statements like this in sloppy mode:
This is based on Annex B 3.2 https://tc39.github.io/ecma262/#sec-functiondeclarations-in-ifstatement-statement-clauses, which permits FunctionDeclarations as the LabelledItem in a LabelledStatement in sloppy mode. LabelledStatements are Statements, so they are permitted as the body of an IterationStatement.
What are the semantics of such a usage? The only guide I see is Annex B 3.4 https://tc39.github.io/ecma262/#sec-functiondeclarations-in-ifstatement-statement-clauses which says that FunctionDeclarations as the body of an IfStatement act like they are enclosed in a block. But I don't see any of this logic for LabelledStatements.
I see a couple possibilities:
Based on the general design of Annex B, trying to be minimal, I think we might want to go with the first option. Thoughts?
@bterlson @allenwb @jugglinmike
The text was updated successfully, but these errors were encountered: