Skip to content

Editorial: Fix some SDOs#2406

Merged
ljharb merged 8 commits intotc39:masterfrom
jmdyck:fix_some_SDOs
Sep 14, 2021
Merged

Editorial: Fix some SDOs#2406
ljharb merged 8 commits intotc39:masterfrom
jmdyck:fix_some_SDOs

Conversation

@jmdyck
Copy link
Collaborator

@jmdyck jmdyck commented May 9, 2021

Add some needed SDO definitions.
Drop some unused SDO definitions.

Fixes #2354.

@ljharb ljharb force-pushed the master branch 3 times, most recently from 3d0c24c to 7a79833 Compare June 29, 2021 02:21
@bakkot bakkot added the editor call to be discussed in the next editor call label Aug 23, 2021
@bakkot bakkot removed the editor call to be discussed in the next editor call label Aug 25, 2021
@michaelficarra
Copy link
Member

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.

@michaelficarra
Copy link
Member

michaelficarra commented Sep 13, 2021

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.

@jmdyck
Copy link
Collaborator Author

jmdyck commented Sep 14, 2021

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.

Done. (Modified the first commit.)

@jmdyck
Copy link
Collaborator Author

jmdyck commented Sep 14, 2021

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.

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.

@michaelficarra
Copy link
Member

@jmdyck We have decided to minimise unnecessary definitions: #1933 (comment)

@bakkot bakkot added the ready to merge Editors believe this PR needs no further reviews, and is ready to land. label Sep 14, 2021
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`.
MV is never invoked on NumericLiteral
(or on anything that would chain to NumericLiteral).
…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|.
@ljharb ljharb merged commit 0bd3ace into tc39:master Sep 14, 2021
mathiasbynens pushed a commit to mathiasbynens/ecma262 that referenced this pull request Oct 18, 2021
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.
mathiasbynens pushed a commit to mathiasbynens/ecma262 that referenced this pull request Oct 18, 2021
Specifically:
- LexicallyDeclaredNames
- LexicallyScopedDeclarations
- VarDeclaredNames
- VarScopedDeclarations

Fixes tc39#2354.
mathiasbynens pushed a commit to mathiasbynens/ecma262 that referenced this pull request Oct 18, 2021
The `Evaluation` SDO doesn't reach AsyncFunctionDeclaration;
it stops at `HoistableDeclaration : AsyncFunctionDeclaration`.
mathiasbynens pushed a commit to mathiasbynens/ecma262 that referenced this pull request Oct 18, 2021
MV is never invoked on NumericLiteral
(or on anything that would chain to NumericLiteral).
mathiasbynens pushed a commit to mathiasbynens/ecma262 that referenced this pull request Oct 18, 2021
…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|.
mathiasbynens pushed a commit to mathiasbynens/ecma262 that referenced this pull request Oct 18, 2021
…lVarScopedDeclarations` (tc39#2406)

TopLevelVarDeclaredNames & TopLevelVarScopedDeclarations
are invoked on |Statement|, but only when it's a |LabelledStatement|,
so they never reach |BlockStatement|, let alone |Block|.
mathiasbynens pushed a commit to mathiasbynens/ecma262 that referenced this pull request Oct 18, 2021
VarDeclaredNames is invoked on |ModuleItemList|, but not on |Module|.
mathiasbynens pushed a commit to mathiasbynens/ecma262 that referenced this pull request Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

editorial change ready to merge Editors believe this PR needs no further reviews, and is ready to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GlobalDeclarationInstantiation breaks on empty Script

4 participants