Conversation
3d0c24c to
7a79833
Compare
|
I'd prefer to see the Evaluation definition for BindingIdentifier moved to the main spec and just drop the definition for ForBinding, as you suggest in your commit message. Less fiddling with things in Annex B is better. |
|
I notice here there's a lot of cases defined for MV that are covered by the chain rule. It'd be nice to drop those cases. edit: Not blocking this PR, of course. Feel free to add that change here or we can do it as a separate PR. |
0b1f1ca to
0215356
Compare
Done. (Modified the first commit.) |
Yeah, I had been thinking of that as a separate PR, but I guess it fits okay here. I've added a commit that removes all definitions that are covered by the chain rule, but it's possible there are cases where stating the definition explicitly might be helpful to the reader, so let me know if you'd like any reinstated. |
|
@jmdyck We have decided to minimise unnecessary definitions: #1933 (comment) |
PR tc39#614 defined (in Annex B) an additional form for ForInOfStatement. Performing ForInOfLoopEvaluation on it ends with a call to ForIn/OfBodyEvaluation, with |BindingIdentifier| as first arg, passed to the _lhs_ param. ForIn/OfBodyEvaluation (at step 6.g.i.1) evaluates this param, but there's no definition of Evaluation for |BindingIdentifier|. This PR adds the necessary definition. Rather than add it to the annex that defines the additional form of ForInOfStatement, this commit substitutes it for the (main body) definition of `Evaluation` for `ForBinding : BindingIdentifier`, allowing the latter to chain to the new definition, since it has the same semantics.
Specifically: - LexicallyDeclaredNames - LexicallyScopedDeclarations - VarDeclaredNames - VarScopedDeclarations Fixes tc39#2354.
The `Evaluation` SDO doesn't reach AsyncFunctionDeclaration; it stops at `HoistableDeclaration : AsyncFunctionDeclaration`.
…opLevelLexicallyScopedDeclarations` (tc39#2406) TopLevelLexicallyDeclaredNames is only invoked on |StatementList| and (recursively) |StatementListItem|), so it never reaches |LabelledStatement|. Ditto all that for TopLevelLexicallyScopedDeclarations. Also, TopLevelLexicallyScopedDeclarations never reaches |Block|.
…lVarScopedDeclarations` (tc39#2406) TopLevelVarDeclaredNames & TopLevelVarScopedDeclarations are invoked on |Statement|, but only when it's a |LabelledStatement|, so they never reach |BlockStatement|, let alone |Block|.
VarDeclaredNames is invoked on |ModuleItemList|, but not on |Module|.
0215356 to
0bd3ace
Compare
PR tc39#614 defined (in Annex B) an additional form for ForInOfStatement. Performing ForInOfLoopEvaluation on it ends with a call to ForIn/OfBodyEvaluation, with |BindingIdentifier| as first arg, passed to the _lhs_ param. ForIn/OfBodyEvaluation (at step 6.g.i.1) evaluates this param, but there's no definition of Evaluation for |BindingIdentifier|. This PR adds the necessary definition. Rather than add it to the annex that defines the additional form of ForInOfStatement, this commit substitutes it for the (main body) definition of `Evaluation` for `ForBinding : BindingIdentifier`, allowing the latter to chain to the new definition, since it has the same semantics.
Specifically: - LexicallyDeclaredNames - LexicallyScopedDeclarations - VarDeclaredNames - VarScopedDeclarations Fixes tc39#2354.
The `Evaluation` SDO doesn't reach AsyncFunctionDeclaration; it stops at `HoistableDeclaration : AsyncFunctionDeclaration`.
…opLevelLexicallyScopedDeclarations` (tc39#2406) TopLevelLexicallyDeclaredNames is only invoked on |StatementList| and (recursively) |StatementListItem|), so it never reaches |LabelledStatement|. Ditto all that for TopLevelLexicallyScopedDeclarations. Also, TopLevelLexicallyScopedDeclarations never reaches |Block|.
…lVarScopedDeclarations` (tc39#2406) TopLevelVarDeclaredNames & TopLevelVarScopedDeclarations are invoked on |Statement|, but only when it's a |LabelledStatement|, so they never reach |BlockStatement|, let alone |Block|.
VarDeclaredNames is invoked on |ModuleItemList|, but not on |Module|.
Add some needed SDO definitions.
Drop some unused SDO definitions.
Fixes #2354.