Skip to content

Commit

Permalink
Editorial: Use consistent wording for List interactions
Browse files Browse the repository at this point in the history
  • Loading branch information
gibson042 authored Nov 14, 2023
1 parent 89a600a commit 578eaec
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 77 deletions.
4 changes: 2 additions & 2 deletions spec/collator.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ <h1>Intl.Collator ( [ _locales_ [ , _options_ ] ] )</h1>
1. If NewTarget is *undefined*, let _newTarget_ be the active function object, else let _newTarget_ be NewTarget.
1. Let _internalSlotsList_ be &laquo; [[InitializedCollator]], [[Locale]], [[Usage]], [[Sensitivity]], [[IgnorePunctuation]], [[Collation]], [[BoundCompare]] &raquo;.
1. If %Collator%.[[RelevantExtensionKeys]] contains *"kn"*, then
1. Append [[Numeric]] as the last element of _internalSlotsList_.
1. Append [[Numeric]] to _internalSlotsList_.
1. If %Collator%.[[RelevantExtensionKeys]] contains *"kf"*, then
1. Append [[CaseFirst]] as the last element of _internalSlotsList_.
1. Append [[CaseFirst]] to _internalSlotsList_.
1. Let _collator_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%Collator.prototype%"*, _internalSlotsList_).
1. Return ? InitializeCollator(_collator_, _locales_, _options_).
</emu-alg>
Expand Down
43 changes: 22 additions & 21 deletions spec/datetimeformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ <h1>
1. Let _bestFormat_ be BasicFormatMatcher(_formatOptions_, _formats_).
1. Else,
1. Let _bestFormat_ be BestFitFormatMatcher(_formatOptions_, _formats_).
1. For each row in <emu-xref href="#table-datetimeformat-components"></emu-xref>, except the header row, in table order, do
1. For each row of <emu-xref href="#table-datetimeformat-components"></emu-xref>, except the header row, in table order, do
1. Let _prop_ be the name given in the Property column of the row.
1. If _bestFormat_ has a field [[&lt;_prop_&gt;]], then
1. Let _p_ be _bestFormat_.[[&lt;_prop_&gt;]].
Expand Down Expand Up @@ -896,7 +896,8 @@ <h1>
1. Assert: Type(_formats_) is List.
1. For each element _format_ of _formats_, do
1. Let _score_ be 0.
1. For each property name _property_ shown in <emu-xref href="#table-datetimeformat-components"></emu-xref>, do
1. For each row of <emu-xref href="#table-datetimeformat-components"></emu-xref>, except the header row, in table order, do
1. Let _property_ be the name given in the Property column of the row.
1. If _options_ has a field [[&lt;_property_&gt;]], let _optionsProp_ be _options_.[[&lt;_property_&gt;]]; else let _optionsProp_ be *undefined*.
1. If _format_ has a field [[&lt;_property_&gt;]], let _formatProp_ be _format_.[[&lt;_property_&gt;]]; else let _formatProp_ be *undefined*.
1. If _optionsProp_ is *undefined* and _formatProp_ is not *undefined*, then
Expand Down Expand Up @@ -1007,25 +1008,25 @@ <h1>
1. Let _nf3_ be ! Construct(%NumberFormat%, &laquo; _locale_, _nf3Options_ &raquo;).
1. Let _tm_ be ToLocalTime(ℤ(ℝ(_x_) &times; 10<sup>6</sup>), _dateTimeFormat_.[[Calendar]], _dateTimeFormat_.[[TimeZone]]).
1. Let _result_ be a new empty List.
1. For each Record { [[Type]], [[Value]] } _patternPart_ in _patternParts_, do
1. For each Record { [[Type]], [[Value]] } _patternPart_ of _patternParts_, do
1. Let _p_ be _patternPart_.[[Type]].
1. If _p_ is *"literal"*, then
1. Append a new Record { [[Type]]: *"literal"*, [[Value]]: _patternPart_.[[Value]] } as the last element of the list _result_.
1. Append the Record { [[Type]]: *"literal"*, [[Value]]: _patternPart_.[[Value]] } to _result_.
1. Else if _p_ is equal to *"fractionalSecondDigits"*, then
1. Assert: _fractionalSecondDigits_ is not *undefined*.
1. Let _v_ be _tm_.[[Millisecond]].
1. Set _v_ to floor(_v_ &times; 10<sup>( _fractionalSecondDigits_ - 3 )</sup>).
1. Let _fv_ be FormatNumeric(_nf3_, _v_).
1. Append a new Record { [[Type]]: *"fractionalSecond"*, [[Value]]: _fv_ } as the last element of _result_.
1. Append the Record { [[Type]]: *"fractionalSecond"*, [[Value]]: _fv_ } to _result_.
1. Else if _p_ is equal to *"dayPeriod"*, then
1. Let _f_ be _dateTimeFormat_.[[DayPeriod]].
1. Let _fv_ be a String value representing the day period of _tm_ in the form given by _f_; the String value depends upon the implementation and the effective locale of _dateTimeFormat_.
1. Append a new Record { [[Type]]: _p_, [[Value]]: _fv_ } as the last element of the list _result_.
1. Append the Record { [[Type]]: _p_, [[Value]]: _fv_ } to _result_.
1. Else if _p_ is equal to *"timeZoneName"*, then
1. Let _f_ be _dateTimeFormat_.[[TimeZoneName]].
1. Let _v_ be _dateTimeFormat_.[[TimeZone]].
1. Let _fv_ be a String value representing _v_ in the form given by _f_; the String value depends upon the implementation and the effective locale of _dateTimeFormat_. The String value may also depend on the value of the [[InDST]] field of _tm_ if _f_ is *"short"*, *"long"*, *"shortOffset"*, or *"longOffset"*. If the implementation does not have such a localized representation of _v_, then use the String value of _v_ itself.
1. Append a new Record { [[Type]]: _p_, [[Value]]: _fv_ } as the last element of the list _result_.
1. Append the Record { [[Type]]: _p_, [[Value]]: _fv_ } to _result_.
1. Else if _p_ matches a Property column of the row in <emu-xref href="#table-datetimeformat-components"></emu-xref>, then
1. If _rangeFormatOptions_ is not *undefined*, let _f_ be the value of _rangeFormatOptions_'s field whose name matches _p_.
1. Else, let _f_ be the value of _dateTimeFormat_'s internal slot whose name is the Internal Slot column of the matching row.
Expand All @@ -1044,25 +1045,25 @@ <h1>
1. If the *"length"* property of _fv_ is greater than 2, set _fv_ to the substring of _fv_ containing the last two characters.
1. Else if _f_ is *"narrow"*, *"short"*, or *"long"*, then
1. Let _fv_ be a String value representing _v_ in the form given by _f_; the String value depends upon the implementation and the effective locale and calendar of _dateTimeFormat_. If _p_ is *"month"* and _rangeFormatOptions_ is *undefined*, then the String value may also depend on whether _dateTimeFormat_.[[Day]] is *undefined*. If _p_ is *"month"* and _rangeFormatOptions_ is not *undefined*, then the String value may also depend on whether _rangeFormatOptions_.[[day]] is *undefined*. If _p_ is *"era"* and _rangeFormatOptions_ is *undefined*, then the String value may also depend on whether _dateTimeFormat_.[[Era]] is *undefined*. If _p_ is *"era"* and _rangeFormatOptions_ is not *undefined*, then the String value may also depend on whether _rangeFormatOptions_.[[era]] is *undefined*. If the implementation does not have such a localized representation of _v_, then use ! ToString(_v_).
1. Append a new Record { [[Type]]: _p_, [[Value]]: _fv_ } as the last element of the list _result_.
1. Append the Record { [[Type]]: _p_, [[Value]]: _fv_ } to _result_.
1. Else if _p_ is equal to *"ampm"*, then
1. Let _v_ be _tm_.[[Hour]].
1. If _v_ is greater than 11, then
1. Let _fv_ be an implementation and locale dependent String value representing *"post meridiem"*.
1. Else,
1. Let _fv_ be an implementation and locale dependent String value representing *"ante meridiem"*.
1. Append a new Record { [[Type]]: *"dayPeriod"*, [[Value]]: _fv_ } as the last element of the list _result_.
1. Append the Record { [[Type]]: *"dayPeriod"*, [[Value]]: _fv_ } to _result_.
1. Else if _p_ is equal to *"relatedYear"*, then
1. Let _v_ be _tm_.[[RelatedYear]].
1. Let _fv_ be FormatNumeric(_nf_, _v_).
1. Append a new Record { [[Type]]: *"relatedYear"*, [[Value]]: _fv_ } as the last element of the list _result_.
1. Append the Record { [[Type]]: *"relatedYear"*, [[Value]]: _fv_ } to _result_.
1. Else if _p_ is equal to *"yearName"*, then
1. Let _v_ be _tm_.[[YearName]].
1. Let _fv_ be an implementation and locale dependent String value representing _v_.
1. Append a new Record { [[Type]]: *"yearName"*, [[Value]]: _fv_ } as the last element of the list _result_.
1. Append the Record { [[Type]]: *"yearName"*, [[Value]]: _fv_ } to _result_.
1. Else,
1. Let _unknown_ be an implementation-, locale-, and numbering system-dependent String based on _x_ and _p_.
1. Append a new Record { [[Type]]: *"unknown"*, [[Value]]: _unknown_ } as the last element of _result_.
1. Append the Record { [[Type]]: *"unknown"*, [[Value]]: _unknown_ } to _result_.
1. Return _result_.
</emu-alg>

Expand Down Expand Up @@ -1101,7 +1102,7 @@ <h1>
<emu-alg>
1. Let _parts_ be ? PartitionDateTimePattern(_dateTimeFormat_, _x_).
1. Let _result_ be the empty String.
1. For each Record { [[Type]], [[Value]] } _part_ in _parts_, do
1. For each Record { [[Type]], [[Value]] } _part_ of _parts_, do
1. Set _result_ to the string-concatenation of _result_ and _part_.[[Value]].
1. Return _result_.
</emu-alg>
Expand All @@ -1120,7 +1121,7 @@ <h1>
1. Let _parts_ be ? PartitionDateTimePattern(_dateTimeFormat_, _x_).
1. Let _result_ be ! ArrayCreate(0).
1. Let _n_ be 0.
1. For each Record { [[Type]], [[Value]] } _part_ in _parts_, do
1. For each Record { [[Type]], [[Value]] } _part_ of _parts_, do
1. Let _O_ be OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"type"*, _part_.[[Type]]).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"value"*, _part_.[[Value]]).
Expand Down Expand Up @@ -1184,13 +1185,13 @@ <h1>
1. Let _pattern_ be _dateTimeFormat_.[[Pattern]].
1. Let _patternParts_ be PartitionPattern(_pattern_).
1. Let _resultParts_ be ! FormatDateTimePattern(_dateTimeFormat_, _patternParts_, _x_, *undefined*).
1. For each Record { [[Type]], [[Value]] } _r_ in _resultParts_, do
1. Append a new Record { [[Type]]: _r_.[[Type]], [[Value]]: _r_.[[Value]], [[Source]]: *"shared"* } as the last element of _collapsedResult_.
1. For each Record { [[Type]], [[Value]] } _r_ of _resultParts_, do
1. Append the Record { [[Type]]: _r_.[[Type]], [[Value]]: _r_.[[Value]], [[Source]]: *"shared"* } to _collapsedResult_.
1. Return _collapsedResult_.
1. Let _rangeResult_ be a new empty List.
1. If _selectedRangePattern_ is *undefined*, then
1. Set _selectedRangePattern_ to _rangePatterns_.[[Default]].
1. For each Record { [[Pattern]], [[Source]] } _rangePatternPart_ in _selectedRangePattern_.[[PatternParts]], do
1. For each Record { [[Pattern]], [[Source]] } _rangePatternPart_ of _selectedRangePattern_.[[PatternParts]], do
1. Let _pattern_ be _rangePatternPart_.[[Pattern]].
1. Let _source_ be _rangePatternPart_.[[Source]].
1. If _source_ is *"startRange"* or *"shared"*, then
Expand All @@ -1199,8 +1200,8 @@ <h1>
1. Let _z_ be _y_.
1. Let _patternParts_ be PartitionPattern(_pattern_).
1. Let _resultParts_ be ! FormatDateTimePattern(_dateTimeFormat_, _patternParts_, _z_, _selectedRangePattern_).
1. For each Record { [[Type]], [[Value]] } _r_ in _resultParts_, do
1. Append a new Record { [[Type]]: _r_.[[Type]], [[Value]]: _r_.[[Value]], [[Source]]: _source_ } as the last element of _rangeResult_.
1. For each Record { [[Type]], [[Value]] } _r_ of _resultParts_, do
1. Append the Record { [[Type]]: _r_.[[Type]], [[Value]]: _r_.[[Value]], [[Source]]: _source_ } to _rangeResult_.
1. Return _rangeResult_.
</emu-alg>
</emu-clause>
Expand All @@ -1218,7 +1219,7 @@ <h1>
<emu-alg>
1. Let _parts_ be ? PartitionDateTimeRangePattern(_dateTimeFormat_, _x_, _y_).
1. Let _result_ be the empty String.
1. For each Record { [[Type]], [[Value]], [[Source]] } _part_ in _parts_, do
1. For each Record { [[Type]], [[Value]], [[Source]] } _part_ of _parts_, do
1. Set _result_ to the string-concatenation of _result_ and _part_.[[Value]].
1. Return _result_.
</emu-alg>
Expand All @@ -1238,7 +1239,7 @@ <h1>
1. Let _parts_ be ? PartitionDateTimeRangePattern(_dateTimeFormat_, _x_, _y_).
1. Let _result_ be ! ArrayCreate(0).
1. Let _n_ be 0.
1. For each Record { [[Type]], [[Value]], [[Source]] } _part_ in _parts_, do
1. For each Record { [[Type]], [[Value]], [[Source]] } _part_ of _parts_, do
1. Let _O_ be OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"type"*, _part_.[[Type]]).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"value"*, _part_.[[Value]]).
Expand Down
8 changes: 4 additions & 4 deletions spec/listformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ <h1>
1. For each Record { [[Type]], [[Value]] } _patternPart_ of _patternParts_, do
1. Let _part_ be _patternPart_.[[Type]].
1. If _part_ is *"literal"*, then
1. Append Record { [[Type]]: *"literal"*, [[Value]]: _patternPart_.[[Value]] } to _result_.
1. Append the Record { [[Type]]: *"literal"*, [[Value]]: _patternPart_.[[Value]] } to _result_.
1. Else,
1. Assert: _placeables_ has a field [[&lt;_part_&gt;]].
1. Let _subst_ be _placeables_.[[&lt;_part_&gt;]].
Expand Down Expand Up @@ -341,7 +341,7 @@ <h1>
<emu-alg>
1. Let _parts_ be CreatePartsFromList(_listFormat_, _list_).
1. Let _result_ be an empty String.
1. For each Record { [[Type]], [[Value]] } _part_ in _parts_, do
1. For each Record { [[Type]], [[Value]] } _part_ of _parts_, do
1. Set _result_ to the string-concatenation of _result_ and _part_.[[Value]].
1. Return _result_.
</emu-alg>
Expand All @@ -360,7 +360,7 @@ <h1>
1. Let _parts_ be CreatePartsFromList(_listFormat_, _list_).
1. Let _result_ be ! ArrayCreate(0).
1. Let _n_ be 0.
1. For each Record { [[Type]], [[Value]] } _part_ in _parts_, do
1. For each Record { [[Type]], [[Value]] } _part_ of _parts_, do
1. Let _O_ be OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"type"*, _part_.[[Type]]).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"value"*, _part_.[[Value]]).
Expand Down Expand Up @@ -391,7 +391,7 @@ <h1>
1. If Type(_nextValue_) is not String, then
1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _error_).
1. Append _nextValue_ to the end of the List _list_.
1. Append _nextValue_ to _list_.
1. Return _list_.
</emu-alg>
<emu-note>
Expand Down
4 changes: 2 additions & 2 deletions spec/locale.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ <h1>Intl.Locale ( _tag_ [ , _options_ ] )</h1>
1. Let _relevantExtensionKeys_ be %Locale%.[[RelevantExtensionKeys]].
1. Let _internalSlotsList_ be &laquo; [[InitializedLocale]], [[Locale]], [[Calendar]], [[Collation]], [[HourCycle]], [[NumberingSystem]] &raquo;.
1. If _relevantExtensionKeys_ contains *"kf"*, then
1. Append [[CaseFirst]] as the last element of _internalSlotsList_.
1. Append [[CaseFirst]] to _internalSlotsList_.
1. If _relevantExtensionKeys_ contains *"kn"*, then
1. Append [[Numeric]] as the last element of _internalSlotsList_.
1. Append [[Numeric]] to _internalSlotsList_.
1. Let _locale_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%Locale.prototype%"*, _internalSlotsList_).
1. If Type(_tag_) is not String or Object, throw a *TypeError* exception.
1. If Type(_tag_) is Object and _tag_ has an [[InitializedLocale]] internal slot, then
Expand Down
4 changes: 2 additions & 2 deletions spec/locales-currencies-tz.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ <h1>
1. Let _components_ be UnicodeExtensionComponents(_extension_).
1. For each element _attr_ of _components_.[[Attributes]], do
1. Set _newExtension_ to the string-concatenation of _newExtension_, *"-"*, and _attr_.
1. For each Record { [[Key]], [[Value]] } _keyword_ in _components_.[[Keywords]], do
1. For each Record { [[Key]], [[Value]] } _keyword_ of _components_.[[Keywords]], do
1. Set _newExtension_ to the string-concatenation of _newExtension_, *"-"*, and _keyword_.[[Key]].
1. If _keyword_.[[Value]] is not the empty String, then
1. Set _newExtension_ to the string-concatenation of _newExtension_, *"-"*, and _keyword_.[[Value]].
Expand Down Expand Up @@ -231,7 +231,7 @@ <h1>
1. Assert: IsValidTimeZoneName( _name_ ) is *true*.
1. Let _canonical_ be CanonicalizeTimeZoneName( _name_ ).
1. If _result_ does not contain _canonical_, then
1. Append _canonical_ to the end of _result_.
1. Append _canonical_ to _result_.
1. [declared="comparefn"] Sort _result_ in order as if an Array of the same values had been sorted using %Array.prototype.sort% using *undefined* as _comparefn_.
1. Return _result_.
</emu-alg>
Expand Down
10 changes: 5 additions & 5 deletions spec/negotiation.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h1>
1. Let _tag_ be ? ToString(_kValue_).
1. If IsStructurallyValidLanguageTag(_tag_) is *false*, throw a *RangeError* exception.
1. Let _canonicalizedTag_ be CanonicalizeUnicodeLocaleId(_tag_).
1. If _canonicalizedTag_ is not an element of _seen_, append _canonicalizedTag_ as the last element of _seen_.
1. If _seen_ does not contain _canonicalizedTag_, append _canonicalizedTag_ to _seen_.
1. Set _k_ to _k_ + 1.
1. Return _seen_.
</emu-alg>
Expand Down Expand Up @@ -291,7 +291,7 @@ <h1>
1. For each element _locale_ of _requestedLocales_, do
1. Let _noExtensionsLocale_ be the String value that is _locale_ with any Unicode locale extension sequences removed.
1. Let _availableLocale_ be BestAvailableLocale(_availableLocales_, _noExtensionsLocale_).
1. If _availableLocale_ is not *undefined*, append _locale_ to the end of _subset_.
1. If _availableLocale_ is not *undefined*, append _locale_ to _subset_.
1. Return _subset_.
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -492,14 +492,14 @@ <h1>
1. Assert: _endIndex_ is greater than _beginIndex_.
1. If _beginIndex_ is greater than _nextIndex_, then
1. Let _literal_ be a substring of _pattern_ from position _nextIndex_, inclusive, to position _beginIndex_, exclusive.
1. Append a new Record { [[Type]]: *"literal"*, [[Value]]: _literal_ } as the last element of the list _result_.
1. Append the Record { [[Type]]: *"literal"*, [[Value]]: _literal_ } to _result_.
1. Let _p_ be the substring of _pattern_ from position _beginIndex_, exclusive, to position _endIndex_, exclusive.
1. Append a new Record { [[Type]]: _p_, [[Value]]: *undefined* } as the last element of the list _result_.
1. Append the Record { [[Type]]: _p_, [[Value]]: *undefined* } to _result_.
1. Set _nextIndex_ to _endIndex_ + 1.
1. Set _beginIndex_ to StringIndexOf(_pattern_, *"{"*, _nextIndex_).
1. If _nextIndex_ is less than _length_, then
1. Let _literal_ be the substring of _pattern_ from position _nextIndex_, inclusive, to position _length_, exclusive.
1. Append a new Record { [[Type]]: *"literal"*, [[Value]]: _literal_ } as the last element of the list _result_.
1. Append the Record { [[Type]]: *"literal"*, [[Value]]: _literal_ } to _result_.
1. Return _result_.
</emu-alg>
</emu-clause>
Expand Down
Loading

0 comments on commit 578eaec

Please sign in to comment.