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;" (tc39#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 Feb 24, 2022
1 parent cf7145e commit 40c52d0
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 37 deletions.
2 changes: 1 addition & 1 deletion scripts/check-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const authors = request(branchURL).then((json) => JSON.parse(json)).then(data =>
const teamURL = 'https://api.github.com/orgs/tc39/teams/delegates';

function getMembers(teamID, page = 1) {
const memberURL = `https://api.github.com/teams/${teamID}/members?per_page=100&page=${page}`;
const memberURL = `https://api.github.com/organizations/tc39/teams/${teamID}/members?per_page=100&page=${page}`;
const data = request(memberURL).then((json) => JSON.parse(json));
return data.then((data) => {
if (data.length > 0) {
Expand Down
71 changes: 35 additions & 36 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -7212,11 +7212,11 @@ <h1>Static Semantics: BoundNames</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 @@ -7724,7 +7724,7 @@ <h1>Static Semantics: LexicallyScopedDeclarations</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 @@ -8046,7 +8046,7 @@ <h1>Static Semantics: VarScopedDeclarations</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 @@ -8104,7 +8104,7 @@ <h1>Static Semantics: VarScopedDeclarations</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 @@ -8251,7 +8251,7 @@ <h1>Static Semantics: TopLevelLexicallyDeclaredNames</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 @@ -8276,8 +8276,8 @@ <h1>Static Semantics: TopLevelLexicallyScopedDeclarations</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 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 @@ -8353,7 +8353,7 @@ <h1>Static Semantics: TopLevelVarScopedDeclarations</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-clause>
</emu-clause>
Expand Down Expand Up @@ -18270,7 +18270,7 @@ <h1>Static Semantics: PropertyNameList</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 @@ -18516,7 +18516,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 @@ -18533,7 +18533,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 @@ -18550,7 +18550,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 @@ -18624,7 +18624,7 @@ <h1>Runtime Semantics: SubstitutionEvaluation</h1>
<emu-alg>
1. Let _subRef_ be the result of evaluating |Expression|.
1. Let _sub_ be ? GetValue(_subRef_).
1. Return a List whose sole element is _sub_.
1. Return &laquo; _sub_ &raquo;.
</emu-alg>
<emu-grammar>TemplateMiddleList : TemplateMiddleList TemplateMiddle Expression</emu-grammar>
<emu-alg>
Expand Down Expand Up @@ -19164,7 +19164,7 @@ <h1>Runtime Semantics: ArgumentListEvaluation</h1>
<emu-alg>
1. Let _ref_ be the result of evaluating |AssignmentExpression|.
1. Let _arg_ be ? GetValue(_ref_).
1. Return a List whose sole element is _arg_.
1. Return &laquo; _arg_ &raquo;.
</emu-alg>
<emu-grammar>ArgumentList : `...` AssignmentExpression</emu-grammar>
<emu-alg>
Expand Down Expand Up @@ -19200,7 +19200,7 @@ <h1>Runtime Semantics: ArgumentListEvaluation</h1>
<emu-alg>
1. Let _templateLiteral_ be this |TemplateLiteral|.
1. Let _siteObj_ be GetTemplateObject(_templateLiteral_).
1. Return a List whose sole element is _siteObj_.
1. Return &laquo; _siteObj_ &raquo;.
</emu-alg>
<emu-grammar>TemplateLiteral : SubstitutionTemplate</emu-grammar>
<emu-alg>
Expand Down Expand Up @@ -20731,15 +20731,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 @@ -21310,15 +21310,15 @@ <h1>
<emu-alg>
1. Let _name_ be the string that is the only element of BoundNames of |SingleNameBinding|.
1. Perform ? KeyedBindingInitialization of |SingleNameBinding| with arguments _value_, _environment_, and _name_.
1. Return a List whose sole element is _name_.
1. Return &laquo; _name_ &raquo;.
</emu-alg>

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

Expand Down Expand Up @@ -21695,7 +21695,7 @@ <h1>
1. If _forDcl_ is an abrupt completion, then
1. Set the running execution context's LexicalEnvironment to _oldEnv_.
1. Return Completion(_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 ForBodyEvaluation(the first |Expression|, the second |Expression|, |Statement|, _perIterationLets_, _labelSet_).
1. Set the running execution context's LexicalEnvironment to _oldEnv_.
1. Return Completion(_bodyResult_).
Expand Down Expand Up @@ -22501,7 +22501,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 @@ -22514,7 +22514,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 @@ -22643,8 +22643,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 @@ -24369,7 +24368,7 @@ <h1>Static Semantics: NonConstructorElements</h1>
<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 @@ -24390,7 +24389,7 @@ <h1>Static Semantics: PrototypePropertyNameList</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 @@ -28009,13 +28008,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 @@ -28031,14 +28030,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 @@ -28300,7 +28299,7 @@ <h1>Static Semantics: ExportEntries</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 @@ -28318,13 +28317,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 @@ -28967,7 +28966,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 @@ -47554,7 +47553,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 40c52d0

Please sign in to comment.