Skip to content

Commit

Permalink
Editorial: more consistently use "a new empty List" vs "« &raqu…
Browse files Browse the repository at this point in the history
…o;" (#2666)

Rubric used:
 - we should use syntax consistently when in argument lists, including arguments to SDOs, for both empty and non-empty lists
 - when returning a new empty list from an AO/SDO, we should use prose
 - when initializing or defaulting an alias to an empty list, use prose
 - for everything else, leave as-is ("author's choice"), for now
  • Loading branch information
ljharb committed Mar 2, 2022
1 parent 7575f74 commit 0bf22a9
Showing 1 changed file with 30 additions and 31 deletions.
61 changes: 30 additions & 31 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -7248,11 +7248,11 @@ <h1>Static Semantics: BoundNames ( ): a List of Strings</h1>
</emu-alg>
<emu-grammar>BindingIdentifier : `yield`</emu-grammar>
<emu-alg>
1. Return a List whose sole element is *"yield"*.
1. Return &laquo; *"yield"* &raquo;.
</emu-alg>
<emu-grammar>BindingIdentifier : `await`</emu-grammar>
<emu-alg>
1. Return a List whose sole element is *"await"*.
1. Return &laquo; *"await"* &raquo;.
</emu-alg>
<emu-grammar>LexicalDeclaration : LetOrConst BindingList `;`</emu-grammar>
<emu-alg>
Expand Down Expand Up @@ -7760,7 +7760,7 @@ <h1>Static Semantics: LexicallyScopedDeclarations ( ): a List of Parse Nodes</h1
</emu-alg>
<emu-grammar>LabelledItem : FunctionDeclaration</emu-grammar>
<emu-alg>
1. Return a List whose sole element is |FunctionDeclaration|.
1. Return &laquo; |FunctionDeclaration| &raquo;.
</emu-alg>
<emu-grammar>FunctionStatementList : [empty]</emu-grammar>
<emu-alg>
Expand Down Expand Up @@ -8082,7 +8082,7 @@ <h1>Static Semantics: VarScopedDeclarations ( ): a List of Parse Nodes</h1>
</emu-alg>
<emu-grammar>VariableDeclarationList : VariableDeclaration</emu-grammar>
<emu-alg>
1. Return a List whose sole element is |VariableDeclaration|.
1. Return &laquo; |VariableDeclaration| &raquo;.
</emu-alg>
<emu-grammar>VariableDeclarationList : VariableDeclarationList `,` VariableDeclaration</emu-grammar>
<emu-alg>
Expand Down Expand Up @@ -8140,7 +8140,7 @@ <h1>Static Semantics: VarScopedDeclarations ( ): a List of Parse Nodes</h1>
`for` `await` `(` `var` ForBinding `of` AssignmentExpression `)` Statement
</emu-grammar>
<emu-alg>
1. Let _declarations1_ be a List whose sole element is |ForBinding|.
1. Let _declarations1_ be &laquo; |ForBinding| &raquo;.
1. Let _declarations2_ be VarScopedDeclarations of |Statement|.
1. Return the list-concatenation of _declarations1_ and _declarations2_.
</emu-alg>
Expand Down Expand Up @@ -8287,7 +8287,7 @@ <h1>Static Semantics: TopLevelLexicallyDeclaredNames ( ): a List of Strings</h1>
<emu-grammar>StatementListItem : Declaration</emu-grammar>
<emu-alg>
1. If |Declaration| is <emu-grammar>Declaration : HoistableDeclaration</emu-grammar> , then
1. Return &laquo; &raquo;.
1. Return a new empty List.
1. Return the BoundNames of |Declaration|.
</emu-alg>
<emu-note>
Expand All @@ -8312,8 +8312,8 @@ <h1>Static Semantics: TopLevelLexicallyScopedDeclarations ( ): a List of Parse N
<emu-grammar>StatementListItem : Declaration</emu-grammar>
<emu-alg>
1. If |Declaration| is <emu-grammar>Declaration : HoistableDeclaration</emu-grammar> , then
1. Return &laquo; &raquo;.
1. Return a List whose sole element is |Declaration|.
1. Return a new empty List.
1. Return &laquo; |Declaration| &raquo;.
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -8389,7 +8389,7 @@ <h1>Static Semantics: TopLevelVarScopedDeclarations ( ): a List of Parse Nodes</
</emu-alg>
<emu-grammar>LabelledItem : FunctionDeclaration</emu-grammar>
<emu-alg>
1. Return a List whose sole element is |FunctionDeclaration|.
1. Return &laquo; |FunctionDeclaration| &raquo;.
</emu-alg>
</emu-clause>
</emu-clause>
Expand Down Expand Up @@ -18308,7 +18308,7 @@ <h1>Static Semantics: PropertyNameList ( ): a List of Strings</h1>
<emu-alg>
1. Let _propName_ be PropName of |PropertyDefinition|.
1. If _propName_ is ~empty~, return a new empty List.
1. Return a List whose sole element is _propName_.
1. Return &laquo; _propName_ &raquo;.
</emu-alg>
<emu-grammar>PropertyDefinitionList : PropertyDefinitionList `,` PropertyDefinition</emu-grammar>
<emu-alg>
Expand Down Expand Up @@ -18559,7 +18559,7 @@ <h1>
1. Let _string_ be the TV of |NoSubstitutionTemplate|.
1. Else,
1. Let _string_ be the TRV of |NoSubstitutionTemplate|.
1. Return a List whose sole element is _string_.
1. Return &laquo; _string_ &raquo;.
</emu-alg>
<emu-grammar>SubstitutionTemplate : TemplateHead Expression TemplateSpans</emu-grammar>
<emu-alg>
Expand All @@ -18576,7 +18576,7 @@ <h1>
1. Let _tail_ be the TV of |TemplateTail|.
1. Else,
1. Let _tail_ be the TRV of |TemplateTail|.
1. Return a List whose sole element is _tail_.
1. Return &laquo; _tail_ &raquo;.
</emu-alg>
<emu-grammar>TemplateSpans : TemplateMiddleList TemplateTail</emu-grammar>
<emu-alg>
Expand All @@ -18593,7 +18593,7 @@ <h1>
1. Let _string_ be the TV of |TemplateMiddle|.
1. Else,
1. Let _string_ be the TRV of |TemplateMiddle|.
1. Return a List whose sole element is _string_.
1. Return &laquo; _string_ &raquo;.
</emu-alg>
<emu-grammar>TemplateMiddleList : TemplateMiddleList TemplateMiddle Expression</emu-grammar>
<emu-alg>
Expand Down Expand Up @@ -20771,15 +20771,15 @@ <h1>
1. Let _defaultValue_ be the result of evaluating |Initializer|.
1. Set _v_ to ? GetValue(_defaultValue_).
1. Perform ? PutValue(_lref_, _v_).
1. Return a List whose sole element is _P_.
1. Return &laquo; _P_ &raquo;.
</emu-alg>

<emu-grammar>AssignmentProperty : PropertyName `:` AssignmentElement</emu-grammar>
<emu-alg>
1. Let _name_ be the result of evaluating |PropertyName|.
1. ReturnIfAbrupt(_name_).
1. Perform ? KeyedDestructuringAssignmentEvaluation of |AssignmentElement| with arguments _value_ and _name_.
1. Return a List whose sole element is _name_.
1. Return &laquo; _name_ &raquo;.
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -21739,7 +21739,7 @@ <h1>
1. If _forDcl_ is an abrupt completion, then
1. Set the running execution context's LexicalEnvironment to _oldEnv_.
1. Return ? _forDcl_.
1. If _isConst_ is *false*, let _perIterationLets_ be _boundNames_; otherwise let _perIterationLets_ be &laquo; &raquo;.
1. If _isConst_ is *false*, let _perIterationLets_ be _boundNames_; otherwise let _perIterationLets_ be a new empty List.
1. Let _bodyResult_ be Completion(ForBodyEvaluation(the first |Expression|, the second |Expression|, |Statement|, _perIterationLets_, _labelSet_)).
1. Set the running execution context's LexicalEnvironment to _oldEnv_.
1. Return ? _bodyResult_.
Expand Down Expand Up @@ -22546,7 +22546,7 @@ <h1>
1. If the first |CaseClauses| is present, then
1. Let _A_ be the List of |CaseClause| items in the first |CaseClauses|, in source text order.
1. Else,
1. Let _A_ be &laquo; &raquo;.
1. Let _A_ be a new empty List.
1. Let _found_ be *false*.
1. For each |CaseClause| _C_ of _A_, do
1. If _found_ is *false*, then
Expand All @@ -22559,7 +22559,7 @@ <h1>
1. If the second |CaseClauses| is present, then
1. Let _B_ be the List of |CaseClause| items in the second |CaseClauses|, in source text order.
1. Else,
1. Let _B_ be &laquo; &raquo;.
1. Let _B_ be a new empty List.
1. If _found_ is *false*, then
1. For each |CaseClause| _C_ of _B_, do
1. If _foundInB_ is *false*, then
Expand Down Expand Up @@ -22688,8 +22688,7 @@ <h1>
<h1>Runtime Semantics: Evaluation</h1>
<emu-grammar>LabelledStatement : LabelIdentifier `:` LabelledItem</emu-grammar>
<emu-alg>
1. Let _newLabelSet_ be a new empty List.
1. Return ? LabelledEvaluation of this |LabelledStatement| with argument _newLabelSet_.
1. Return ? LabelledEvaluation of this |LabelledStatement| with argument &laquo; &raquo;.
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -24413,7 +24412,7 @@ <h1>Static Semantics: NonConstructorElements ( ): a List of |ClassElement| Parse
<emu-grammar>ClassElementList : ClassElement</emu-grammar>
<emu-alg>
1. If ClassElementKind of |ClassElement| is ~NonConstructorMethod~, then
1. Return a List whose sole element is |ClassElement|.
1. Return &laquo; |ClassElement| &raquo;.
1. Return a new empty List.
</emu-alg>
<emu-grammar>ClassElementList : ClassElementList ClassElement</emu-grammar>
Expand All @@ -24434,7 +24433,7 @@ <h1>Static Semantics: PrototypePropertyNameList ( ): a List of property keys</h1
1. Let _propName_ be PropName of |ClassElement|.
1. If _propName_ is ~empty~, return a new empty List.
1. If IsStatic of |ClassElement| is *true*, return a new empty List.
1. Return a List whose sole element is _propName_.
1. Return &laquo; _propName_ &raquo;.
</emu-alg>
<emu-grammar>ClassElementList : ClassElementList ClassElement</emu-grammar>
<emu-alg>
Expand Down Expand Up @@ -28060,13 +28059,13 @@ <h1>
<emu-alg>
1. Let _localName_ be the sole element of BoundNames of |ImportedBinding|.
1. Let _defaultEntry_ be the ImportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: *"default"*, [[LocalName]]: _localName_ }.
1. Return a List whose sole element is _defaultEntry_.
1. Return &laquo; _defaultEntry_ &raquo;.
</emu-alg>
<emu-grammar>NameSpaceImport : `*` `as` ImportedBinding</emu-grammar>
<emu-alg>
1. Let _localName_ be the StringValue of |ImportedBinding|.
1. Let _entry_ be the ImportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: ~namespace-object~, [[LocalName]]: _localName_ }.
1. Return a List whose sole element is _entry_.
1. Return &laquo; _entry_ &raquo;.
</emu-alg>
<emu-grammar>NamedImports : `{` `}`</emu-grammar>
<emu-alg>
Expand All @@ -28082,14 +28081,14 @@ <h1>
<emu-alg>
1. Let _localName_ be the sole element of BoundNames of |ImportedBinding|.
1. Let _entry_ be the ImportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: _localName_, [[LocalName]]: _localName_ }.
1. Return a List whose sole element is _entry_.
1. Return &laquo; _entry_ &raquo;.
</emu-alg>
<emu-grammar>ImportSpecifier : ModuleExportName `as` ImportedBinding</emu-grammar>
<emu-alg>
1. Let _importName_ be the StringValue of |ModuleExportName|.
1. Let _localName_ be the StringValue of |ImportedBinding|.
1. Let _entry_ be the ImportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: _importName_, [[LocalName]]: _localName_ }.
1. Return a List whose sole element is _entry_.
1. Return &laquo; _entry_ &raquo;.
</emu-alg>
</emu-clause>
</emu-clause>
Expand Down Expand Up @@ -28351,7 +28350,7 @@ <h1>Static Semantics: ExportEntries ( ): a List of ExportEntry Records</h1>
<emu-grammar>ExportDeclaration : `export` `default` AssignmentExpression `;`</emu-grammar>
<emu-alg>
1. Let _entry_ be the ExportEntry Record { [[ModuleRequest]]: *null*, [[ImportName]]: *null*, [[LocalName]]: *"\*default\*"*, [[ExportName]]: *"default"* }.
1. Return a List whose sole element is _entry_.
1. Return &laquo; _entry_ &raquo;.
</emu-alg>
<emu-note>
<p>*"\*default\*"* is used within this specification as a synthetic name for anonymous default export values. See <emu-xref href="#note-star-default-star">this note</emu-xref> for more details.</p>
Expand All @@ -28369,13 +28368,13 @@ <h1>
<emu-grammar>ExportFromClause : `*`</emu-grammar>
<emu-alg>
1. Let _entry_ be the ExportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: ~all-but-default~, [[LocalName]]: *null*, [[ExportName]]: *null* }.
1. Return a List whose sole element is _entry_.
1. Return &laquo; _entry_ &raquo;.
</emu-alg>
<emu-grammar>ExportFromClause : `*` `as` ModuleExportName</emu-grammar>
<emu-alg>
1. Let _exportName_ be the StringValue of |ModuleExportName|.
1. Let _entry_ be the ExportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: ~all~, [[LocalName]]: *null*, [[ExportName]]: _exportName_ }.
1. Return a List whose sole element is _entry_.
1. Return &laquo; _entry_ &raquo;.
</emu-alg>
<emu-grammar>NamedExports : `{` `}`</emu-grammar>
<emu-alg>
Expand Down Expand Up @@ -29018,7 +29017,7 @@ <h1>
1. Else,
1. If _n_ = 1 or _n_ &gt; 4, throw a *URIError* exception.
1. If _k_ + (3 &times; (_n_ - 1)) &ge; _strLen_, throw a *URIError* exception.
1. Let _Octets_ be a List whose sole element is _B_.
1. Let _Octets_ be &laquo; _B_ &raquo;.
1. Let _j_ be 1.
1. Repeat, while _j_ &lt; _n_,
1. Set _k_ to _k_ + 1.
Expand Down Expand Up @@ -47614,7 +47613,7 @@ <h1>Initializers in ForIn Statement Heads</h1>
<p>The static semantics of VarScopedDeclarations in <emu-xref href="#sec-static-semantics-varscopeddeclarations"></emu-xref> are augmented with the following:</p>
<emu-grammar>ForInOfStatement : `for` `(` `var` BindingIdentifier Initializer `in` Expression `)` Statement</emu-grammar>
<emu-alg>
1. Let _declarations1_ be a List whose sole element is |BindingIdentifier|.
1. Let _declarations1_ be &laquo; |BindingIdentifier| &raquo;.
1. Let _declarations2_ be the VarScopedDeclarations of |Statement|.
1. Return the list-concatenation of _declarations1_ and _declarations2_.
</emu-alg>
Expand Down

0 comments on commit 0bf22a9

Please sign in to comment.