Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: Eliminate CoveredFoo SDOs #2350

Merged
merged 5 commits into from
Mar 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 21 additions & 75 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -5846,7 +5846,7 @@ <h1>Static Semantics: BoundNames</h1>
</emu-alg>
<emu-grammar>ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList</emu-grammar>
<emu-alg>
1. Let _formals_ be CoveredFormalsList of |CoverParenthesizedExpressionAndArrowParameterList|.
1. Let _formals_ be the |ArrowFormalParameters| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
1. Return the BoundNames of _formals_.
</emu-alg>
<emu-grammar>GeneratorDeclaration : `function` `*` BindingIdentifier `(` FormalParameters `)` `{` GeneratorBody `}`</emu-grammar>
Expand Down Expand Up @@ -5889,7 +5889,7 @@ <h1>Static Semantics: BoundNames</h1>
CoverCallExpressionAndAsyncArrowHead : MemberExpression Arguments
</emu-grammar>
<emu-alg>
1. Let _head_ be CoveredAsyncArrowHead of |CoverCallExpressionAndAsyncArrowHead|.
1. Let _head_ be the |AsyncArrowHead| that is covered by |CoverCallExpressionAndAsyncArrowHead|.
1. Return the BoundNames of _head_.
</emu-alg>
<emu-grammar>ImportDeclaration : `import` ImportClause FromClause `;`</emu-grammar>
Expand Down Expand Up @@ -7345,7 +7345,7 @@ <h1>Function Name Inference</h1>
<h1>Static Semantics: HasName</h1>
<emu-grammar>PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList</emu-grammar>
<emu-alg>
1. Let _expr_ be CoveredParenthesizedExpression of |CoverParenthesizedExpressionAndArrowParameterList|.
1. Let _expr_ be the |ParenthesizedExpression| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
1. If IsFunctionDefinition of _expr_ is *false*, return *false*.
1. Return HasName of _expr_.
</emu-alg>
Expand Down Expand Up @@ -7398,7 +7398,7 @@ <h1>Static Semantics: HasName</h1>
<h1>Static Semantics: IsFunctionDefinition</h1>
<emu-grammar>PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList</emu-grammar>
<emu-alg>
1. Let _expr_ be CoveredParenthesizedExpression of |CoverParenthesizedExpressionAndArrowParameterList|.
1. Let _expr_ be the |ParenthesizedExpression| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
1. Return IsFunctionDefinition of _expr_.
</emu-alg>
<emu-grammar>
Expand Down Expand Up @@ -7587,7 +7587,7 @@ <h1>Runtime Semantics: NamedEvaluation</h1>
<p>With parameter _name_.</p>
<emu-grammar>PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList</emu-grammar>
<emu-alg>
1. Let _expr_ be CoveredParenthesizedExpression of |CoverParenthesizedExpressionAndArrowParameterList|.
1. Let _expr_ be the |ParenthesizedExpression| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
1. Return the result of performing NamedEvaluation for _expr_ with argument _name_.
</emu-alg>
<emu-grammar>ParenthesizedExpression : `(` Expression `)`</emu-grammar>
Expand Down Expand Up @@ -7707,7 +7707,7 @@ <h1>Static Semantics: Contains</h1>
</emu-alg>
<emu-grammar>ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList</emu-grammar>
<emu-alg>
1. Let _formals_ be CoveredFormalsList of |CoverParenthesizedExpressionAndArrowParameterList|.
1. Let _formals_ be the |ArrowFormalParameters| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
1. Return _formals_ Contains _symbol_.
</emu-alg>
<emu-grammar>
Expand All @@ -7722,7 +7722,7 @@ <h1>Static Semantics: Contains</h1>
</emu-grammar>
<emu-alg>
1. If _symbol_ is not one of |NewTarget|, |SuperProperty|, |SuperCall|, `super`, or `this`, return *false*.
1. Let _head_ be CoveredAsyncArrowHead of |CoverCallExpressionAndAsyncArrowHead|.
1. Let _head_ be the |AsyncArrowHead| that is covered by |CoverCallExpressionAndAsyncArrowHead|.
1. If _head_ Contains _symbol_ is *true*, return *true*.
1. Return |AsyncConciseBody| Contains _symbol_.
</emu-alg>
Expand Down Expand Up @@ -8071,7 +8071,7 @@ <h1>Runtime Semantics: IteratorBindingInitialization</h1>
</emu-alg>
<emu-grammar>ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList</emu-grammar>
<emu-alg>
1. Let _formals_ be CoveredFormalsList of |CoverParenthesizedExpressionAndArrowParameterList|.
1. Let _formals_ be the |ArrowFormalParameters| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
1. Return IteratorBindingInitialization of _formals_ with arguments _iteratorRecord_ and _environment_.
</emu-alg>
<emu-grammar>
Expand Down Expand Up @@ -8121,7 +8121,7 @@ <h1>Static Semantics: AssignmentTargetType</h1>
CoverParenthesizedExpressionAndArrowParameterList
</emu-grammar>
<emu-alg>
1. Let _expr_ be CoveredParenthesizedExpression of |CoverParenthesizedExpressionAndArrowParameterList|.
1. Let _expr_ be the |ParenthesizedExpression| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
1. Return AssignmentTargetType of _expr_.
</emu-alg>
<emu-grammar>
Expand Down Expand Up @@ -14798,18 +14798,6 @@ <h2>Supplemental Syntax</h2>
`(` Expression[+In, ?Yield, ?Await] `)`
</emu-grammar>

<emu-clause id="sec-primary-expression-semantics">
<h1>Semantics</h1>

<emu-clause id="sec-static-semantics-coveredparenthesizedexpression" type="sdo" aoid="CoveredParenthesizedExpression">
<h1>Static Semantics: CoveredParenthesizedExpression</h1>
<emu-grammar>CoverParenthesizedExpressionAndArrowParameterList : `(` Expression `)`</emu-grammar>
<emu-alg>
1. Return the |ParenthesizedExpression| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
</emu-alg>
</emu-clause>
</emu-clause>

<emu-clause id="sec-this-keyword">
<h1>The `this` Keyword</h1>

Expand Down Expand Up @@ -15498,7 +15486,7 @@ <h1>Static Semantics: Early Errors</h1>
It is a Syntax Error if |CoverParenthesizedExpressionAndArrowParameterList| is not covering a |ParenthesizedExpression|.
</li>
<li>
All Early Error rules for |ParenthesizedExpression| and its derived productions also apply to CoveredParenthesizedExpression of |CoverParenthesizedExpressionAndArrowParameterList|.
All Early Error rules for |ParenthesizedExpression| and its derived productions also apply to the |ParenthesizedExpression| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
</li>
</ul>
</emu-clause>
Expand All @@ -15507,7 +15495,7 @@ <h1>Static Semantics: Early Errors</h1>
<h1>Runtime Semantics: Evaluation</h1>
<emu-grammar>PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList</emu-grammar>
<emu-alg>
1. Let _expr_ be CoveredParenthesizedExpression of |CoverParenthesizedExpressionAndArrowParameterList|.
1. Let _expr_ be the |ParenthesizedExpression| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
1. Return the result of evaluating _expr_.
</emu-alg>
<emu-grammar>ParenthesizedExpression : `(` Expression `)`</emu-grammar>
Expand Down Expand Up @@ -15648,16 +15636,6 @@ <h1>Static Semantics: Early Errors</h1>
</li>
</ul>
</emu-clause>

<emu-clause id="sec-left-hand-side-expressions-static-semantics-coveredcallexpression" type="sdo" aoid="CoveredCallExpression">
<h1>Static Semantics: CoveredCallExpression</h1>
<emu-grammar>
CoverCallExpressionAndAsyncArrowHead : MemberExpression Arguments
</emu-grammar>
<emu-alg>
1. Return the |CallMemberExpression| that is covered by |CoverCallExpressionAndAsyncArrowHead|.
</emu-alg>
</emu-clause>
</emu-clause>

<emu-clause id="sec-property-accessors">
Expand Down Expand Up @@ -15788,7 +15766,7 @@ <h1>Function Calls</h1>
<h1>Runtime Semantics: Evaluation</h1>
<emu-grammar>CallExpression : CoverCallExpressionAndAsyncArrowHead</emu-grammar>
<emu-alg>
1. Let _expr_ be CoveredCallExpression of |CoverCallExpressionAndAsyncArrowHead|.
1. Let _expr_ be the |CallMemberExpression| that is covered by |CoverCallExpressionAndAsyncArrowHead|.
1. Let _memberExpr_ be the |MemberExpression| of _expr_.
1. Let _arguments_ be the |Arguments| of _expr_.
1. Let _ref_ be the result of evaluating _memberExpr_.
Expand Down Expand Up @@ -19503,7 +19481,7 @@ <h1>Static Semantics: ContainsExpression</h1>
</emu-alg>
<emu-grammar>ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList</emu-grammar>
<emu-alg>
1. Let _formals_ be CoveredFormalsList of |CoverParenthesizedExpressionAndArrowParameterList|.
1. Let _formals_ be the |ArrowFormalParameters| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
1. Return ContainsExpression of _formals_.
</emu-alg>
<emu-grammar>
Expand Down Expand Up @@ -19559,7 +19537,7 @@ <h1>Static Semantics: IsSimpleParameterList</h1>
</emu-alg>
<emu-grammar>ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList</emu-grammar>
<emu-alg>
1. Let _formals_ be CoveredFormalsList of |CoverParenthesizedExpressionAndArrowParameterList|.
1. Let _formals_ be the |ArrowFormalParameters| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
1. Return IsSimpleParameterList of _formals_.
</emu-alg>
<emu-grammar>
Expand All @@ -19572,7 +19550,7 @@ <h1>Static Semantics: IsSimpleParameterList</h1>
CoverCallExpressionAndAsyncArrowHead : MemberExpression Arguments
</emu-grammar>
<emu-alg>
1. Let _head_ be CoveredAsyncArrowHead of |CoverCallExpressionAndAsyncArrowHead|.
1. Let _head_ be the |AsyncArrowHead| that is covered by |CoverCallExpressionAndAsyncArrowHead|.
1. Return IsSimpleParameterList of _head_.
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -19636,7 +19614,7 @@ <h1>Static Semantics: ExpectedArgumentCount</h1>
</emu-alg>
<emu-grammar>ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList</emu-grammar>
<emu-alg>
1. Let _formals_ be CoveredFormalsList of |CoverParenthesizedExpressionAndArrowParameterList|.
1. Let _formals_ be the |ArrowFormalParameters| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
1. Return ExpectedArgumentCount of _formals_.
</emu-alg>
<emu-grammar>PropertySetParameterList : FormalParameter</emu-grammar>
Expand Down Expand Up @@ -19886,7 +19864,7 @@ <h1>Static Semantics: Early Errors</h1>
It is a Syntax Error if |CoverParenthesizedExpressionAndArrowParameterList| is not covering an |ArrowFormalParameters|.
</li>
<li>
All early error rules for |ArrowFormalParameters| and its derived productions also apply to CoveredFormalsList of |CoverParenthesizedExpressionAndArrowParameterList|.
All early error rules for |ArrowFormalParameters| and its derived productions also apply to the |ArrowFormalParameters| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
</li>
</ul>
</emu-clause>
Expand All @@ -19903,27 +19881,6 @@ <h1>Static Semantics: ConciseBodyContainsUseStrict</h1>
</emu-alg>
</emu-clause>

<emu-clause id="sec-static-semantics-coveredformalslist" type="sdo" aoid="CoveredFormalsList">
<h1>Static Semantics: CoveredFormalsList</h1>
<emu-grammar>ArrowParameters : BindingIdentifier</emu-grammar>
<emu-alg>
1. Return this |ArrowParameters|.
</emu-alg>
<emu-grammar>
CoverParenthesizedExpressionAndArrowParameterList :
`(` Expression `)`
`(` Expression `,` `)`
`(` `)`
`(` `...` BindingIdentifier `)`
`(` `...` BindingPattern `)`
`(` Expression `,` `...` BindingIdentifier `)`
`(` Expression `,` `...` BindingPattern `)`
</emu-grammar>
<emu-alg>
1. Return the |ArrowFormalParameters| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
</emu-alg>
</emu-clause>

<emu-clause id="sec-runtime-semantics-evaluateconcisebody" oldids="sec-arrow-function-definitions-runtime-semantics-evaluatebody" type="sdo" aoid="EvaluateConciseBody">
<h1>Runtime Semantics: EvaluateConciseBody</h1>
<p>With parameters _functionObject_ and _argumentsList_ (a List).</p>
Expand All @@ -19942,8 +19899,7 @@ <h1>Runtime Semantics: InstantiateArrowFunctionExpression</h1>
1. If _name_ is not present, set _name_ to *""*.
1. Let _scope_ be the LexicalEnvironment of the running execution context.
1. Let _sourceText_ be the source text matched by |ArrowFunction|.
1. Let _parameters_ be CoveredFormalsList of |ArrowParameters|.
1. [id="step-arrowfunction-evaluation-functioncreate"] Let _closure_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, _parameters_, |ConciseBody|, ~lexical-this~, _scope_).
1. [id="step-arrowfunction-evaluation-functioncreate"] Let _closure_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, |ArrowParameters|, |ConciseBody|, ~lexical-this~, _scope_).
1. Perform SetFunctionName(_closure_, _name_).
1. Return _closure_.
</emu-alg>
Expand Down Expand Up @@ -21056,20 +21012,10 @@ <h1>Static Semantics: Early Errors</h1>
<li>It is a Syntax Error if |CoverCallExpressionAndAsyncArrowHead| is not covering an |AsyncArrowHead|.</li>
<li>It is a Syntax Error if any element of the BoundNames of |CoverCallExpressionAndAsyncArrowHead| also occurs in the LexicallyDeclaredNames of |AsyncConciseBody|.</li>
<li>It is a Syntax Error if AsyncConciseBodyContainsUseStrict of |AsyncConciseBody| is *true* and IsSimpleParameterList of |CoverCallExpressionAndAsyncArrowHead| is *false*.</li>
<li>All Early Error rules for |AsyncArrowHead| and its derived productions apply to CoveredAsyncArrowHead of |CoverCallExpressionAndAsyncArrowHead|.</li>
<li>All Early Error rules for |AsyncArrowHead| and its derived productions apply to the |AsyncArrowHead| that is covered by |CoverCallExpressionAndAsyncArrowHead|.</li>
</ul>
</emu-clause>

<emu-clause id="sec-async-arrow-function-definitions-static-semantics-CoveredAsyncArrowHead" type="sdo" aoid="CoveredAsyncArrowHead">
<h1>Static Semantics: CoveredAsyncArrowHead</h1>
<emu-grammar>
CoverCallExpressionAndAsyncArrowHead : MemberExpression Arguments
</emu-grammar>
<emu-alg>
1. Return the |AsyncArrowHead| that is covered by |CoverCallExpressionAndAsyncArrowHead|.
</emu-alg>
</emu-clause>

<emu-clause id="sec-static-semantics-asyncconcisebodycontainsusestrict" oldids="sec-async-arrow-function-definitions-static-semantics-containsusestrict" type="sdo" aoid="AsyncConciseBodyContainsUseStrict">
<h1>Static Semantics: AsyncConciseBodyContainsUseStrict</h1>
<emu-grammar>AsyncConciseBody : ExpressionBody</emu-grammar>
Expand Down Expand Up @@ -21121,7 +21067,7 @@ <h1>Runtime Semantics: InstantiateAsyncArrowFunctionExpression</h1>
1. If _name_ is not present, set _name_ to *""*.
1. Let _scope_ be the LexicalEnvironment of the running execution context.
1. Let _sourceText_ be the source text matched by |AsyncArrowFunction|.
1. Let _head_ be CoveredAsyncArrowHead of |CoverCallExpressionAndAsyncArrowHead|.
1. Let _head_ be the |AsyncArrowHead| that is covered by |CoverCallExpressionAndAsyncArrowHead|.
1. Let _parameters_ be the |ArrowFormalParameters| of _head_.
1. Let _closure_ be ! OrdinaryFunctionCreate(%AsyncFunction.prototype%, _sourceText_, _parameters_, |AsyncConciseBody|, ~lexical-this~, _scope_).
1. Perform SetFunctionName(_closure_, _name_).
Expand Down Expand Up @@ -21470,7 +21416,7 @@ <h1>Expression Rules</h1>
</emu-alg>
<emu-grammar>PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList</emu-grammar>
<emu-alg>
1. Let _expr_ be CoveredParenthesizedExpression of |CoverParenthesizedExpressionAndArrowParameterList|.
1. Let _expr_ be the |ParenthesizedExpression| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
1. Return HasCallInTailPosition of _expr_ with argument _call_.
</emu-alg>
<emu-grammar>
Expand Down