Skip to content

Commit

Permalink
Editorial: Fix various rebase errors
Browse files Browse the repository at this point in the history
  • Loading branch information
anba authored and ben-allen committed Jul 11, 2024
1 parent 53e7478 commit 3f029b0
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 57 deletions.
84 changes: 47 additions & 37 deletions spec/datetimeformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ <h1>
</dl>

<emu-alg>
1. Let _dateTimeFormat_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%DateTimeFormat.prototype%"*, &laquo; [[InitializedDateTimeFormat]], [[Locale]], [[Calendar]], [[NumberingSystem]], [[TimeZone]], [[HourCycle]], [[DateStyle]], [[TimeStyle]], [[DateTimeFormat]], [[BoundFormat]] &raquo;).
1. Let _dateTimeFormat_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%Intl.DateTimeFormat.prototype%"*, &laquo; [[InitializedDateTimeFormat]], [[Locale]], [[Calendar]], [[NumberingSystem]], [[TimeZone]], [[HourCycle]], [[DateStyle]], [[TimeStyle]], [[DateTimeFormat]], [[BoundFormat]] &raquo;).
1. Let _requestedLocales_ be ? CanonicalizeLocaleList(_locales_).
1. Set _options_ to ? CoerceOptionsToObject(_options_).
1. Let _opt_ be a new Record.
Expand Down Expand Up @@ -129,7 +129,16 @@ <h1>
1. Set _dateTimeFormat_.[[DateStyle]] to _dateStyle_.
1. Let _timeStyle_ be ? GetOption(_options_, *"timeStyle"*, ~string~, &laquo; *"full"*, *"long"*, *"medium"*, *"short"* &raquo;, *undefined*).
1. Set _dateTimeFormat_.[[TimeStyle]] to _timeStyle_.
1. If _dateStyle_ is *undefined* and _timeStyle_ is *undefined*, then
1. If _dateStyle_ is not *undefined* or _timeStyle_ is not *undefined*, then
1. If _hasExplicitFormatComponents_ is *true*, then
1. Throw a *TypeError* exception.
1. If _required_ is ~date~ and _timeStyle_ is not *undefined*, then
1. Throw a *TypeError* exception.
1. If _required_ is ~time~ and _dateStyle_ is not *undefined*, then
1. Throw a *TypeError* exception.
1. Let _styles_ be _resolvedLocaleData_.[[styles]].[[&lt;_resolvedCalendar_&gt;]].
1. Let _bestFormat_ be DateTimeStyleFormat(_dateStyle_, _timeStyle_, _styles_).
1. Else,
1. Let _needDefaults_ be *true*.
1. If _required_ is ~date~ or ~any~, then
1. For each property name _prop_ of &laquo; *"weekday"*, *"year"*, *"month"*, *"day"* &raquo;, do
Expand All @@ -150,7 +159,7 @@ <h1>
1. Let _bestFormat_ be BasicFormatMatcher(_formatOptions_, _formats_).
1. Else,
1. Let _bestFormat_ be BestFitFormatMatcher(_formatOptions_, _formats_).
1. Set _dateTimeFormat_.[[Patterns]] to _bestFormat_.
1. Set _dateTimeFormat_.[[DateTimeFormat]] to _bestFormat_.
1. If _bestFormat_ has a field [[hour]], then
1. Set _dateTimeFormat_.[[HourCycle]] to _hc_.
1. Return _dateTimeFormat_.
Expand Down Expand Up @@ -247,7 +256,7 @@ <h1>Internal slots</h1>
[[LocaleData]].[[&lt;_locale_&gt;]].[[hourCycle24]] must be one of the String values *"h23"* or *"h24"*.
</li>
<li>
[[LocaleData]].[[&lt;_locale_&gt;]] must have a [[formats]] field. The value of this [[formats]] field must be a Record with a [[&lt;_calendar_&gt;]] field for each calendar value _calendar_. The value of each [[&lt;_calendar_&gt;]] field must be a List of DateTimeFormat Patterns Record. Multiple Records in such a List may use the same subset of the fields as long as the corresponding values differ for at least one field. The following subsets must be available for each locale:
[[LocaleData]].[[&lt;_locale_&gt;]] must have a [[formats]] field. The value of this [[formats]] field must be a Record with a [[&lt;_calendar_&gt;]] field for each calendar value _calendar_. The value of each [[&lt;_calendar_&gt;]] field must be a List of DateTime Format Records. Multiple Records in such a List may use the same subset of the fields as long as the corresponding values differ for at least one field. The following subsets must be available for each locale:
<ul>
<li>weekday, year, month, day, hour, minute, second, fractionalSecondDigits</li>
<li>weekday, year, month, day, hour, minute, second</li>
Expand All @@ -264,18 +273,18 @@ <h1>Internal slots</h1>
</ul>
</li>
<li>
[[LocaleData]].[[&lt;_locale_&gt;]] must have a [[styles]] field. The value of this [[styles]] field must be a Record with a [[&lt;_calendar_&gt;]] field for each calendar value _calendar_. The value of each [[&lt;_calendar_&gt;]] field must be a DateTimeFormat Styles Record.
[[LocaleData]].[[&lt;_locale_&gt;]] must have a [[styles]] field. The value of this [[styles]] field must be a Record with a [[&lt;_calendar_&gt;]] field for each calendar value _calendar_. The value of each [[&lt;_calendar_&gt;]] field must be a DateTime Styles Record.
</li>
</ul>

<emu-clause id="sec-datetimeformat-patterns-record">
<h1>DateTimeFormat Patterns Records</h1>
<emu-clause id="sec-datetimeformat-format-record">
<h1>DateTime Format Records</h1>

<p>
Each <dfn id="datetimeformat-patterns-record" variants="DateTimeFormat Patterns Records">DateTimeFormat Patterns Record</dfn> has the fields defined in <emu-xref href="#table-datetimeformat-patterns-record"></emu-xref>.
Each <dfn id="datetimeformat-format-record" variants="DateTime Format Records">DateTime Format Record</dfn> has the fields defined in <emu-xref href="#table-datetimeformat-format-record"></emu-xref>.
</p>
<emu-table id="table-datetimeformat-patterns-record">
<emu-caption>DateTimeFormat Patterns Record</emu-caption>
<emu-table id="table-datetimeformat-format-record">
<emu-caption>DateTime Format Record</emu-caption>
<table class="real-table">
<thead>
<tr>
Expand Down Expand Up @@ -548,14 +557,14 @@ <h1>DateTime Range Pattern Part Records</h1>
</emu-table>
</emu-clause>

<emu-clause id="sec-datetimeformat-calendar-style-record">
<h1>DateTime Calendar Style Records</h1>
<emu-clause id="sec-datetimeformat-styles-record">
<h1>DateTime Styles Records</h1>

<p>
Each <dfn id="datetimeformat-calendar-style-record">DateTime Calendar Style Record</dfn> has the fields defined in <emu-xref href="#table-datetimeformat-calendar-style-record"></emu-xref>.
Each <dfn id="datetimeformat-styles-record">DateTime Styles Record</dfn> has the fields defined in <emu-xref href="#table-datetimeformat-styles-record"></emu-xref>.
</p>
<emu-table id="table-datetimeformat-calendar-style-record">
<emu-caption>DateTime Calendar Style Record</emu-caption>
<emu-table id="table-datetimeformat-styles-record">
<emu-caption>DateTime Styles Record</emu-caption>
<table class="real-table">
<thead>
<tr>
Expand All @@ -564,15 +573,15 @@ <h1>DateTime Calendar Style Records</h1>
</tr>
</thead>
<tr>
<td>[[DateFormat]]</td>
<td>[[Date]]</td>
<td>a DateTime Style Record</td>
</tr>
<tr>
<td>[[TimeFormat]]</td>
<td>[[Time]]</td>
<td>a DateTime Style Record</td>
</tr>
<tr>
<td>[[DateTimeFormat]]</td>
<td>[[Connector]]</td>
<td>a DateTime Connector Record</td>
</tr>
<tr>
Expand Down Expand Up @@ -1241,7 +1250,7 @@ <h1>
DateTimeStyleFormat (
_dateStyle_: *"full"*, *"long"*, *"medium"*, *"short"*, or *undefined*,
_timeStyle_: *"full"*, *"long"*, *"medium"*, *"short"*, or *undefined*,
_styles_: a DateTime Calendar Style Record,
_styles_: a DateTime Styles Record,
): a DateTime Format Record
</h1>
<dl class="header">
Expand All @@ -1252,15 +1261,15 @@ <h1>
1. Assert: _dateStyle_ is not *undefined* or _timeStyle_ is not *undefined*.
1. If _timeStyle_ is not *undefined*, then
1. Assert: _timeStyle_ is one of *"full"*, *"long"*, *"medium"*, or *"short"*.
1. Let _timeFormat_ be _styles_.[[TimeFormat]].[[&lt;_timeStyle_&gt;]].
1. Let _timeFormat_ be _styles_.[[Time]].[[&lt;_timeStyle_&gt;]].
1. If _dateStyle_ is not *undefined*, then
1. Assert: _dateStyle_ is one of *"full"*, *"long"*, *"medium"*, or *"short"*.
1. Let _dateFormat_ be _styles_.[[DateFormat]].[[&lt;_dateStyle_&gt;]].
1. Let _dateFormat_ be _styles_.[[Date]].[[&lt;_dateStyle_&gt;]].
1. If _dateStyle_ is not *undefined* and _timeStyle_ is not *undefined*, then
1. Let _format_ be a new DateTime Format Record.
1. Add to _format_ all fields from _dateFormat_ except [[pattern]] and [[rangePatterns]].
1. Add to _format_ all fields from _timeFormat_ except [[pattern]], [[rangePatterns]], [[pattern12]], and [[rangePatterns12]], if present.
1. Let _connector_ be _styles_.[[DateTimeFormat]].[[&lt;_dateStyle_&gt;]].
1. Let _connector_ be _styles_.[[Connector]].[[&lt;_dateStyle_&gt;]].
1. Let _pattern_ be the string _connector_ with the substring *"{0}"* replaced with _timeFormat_.[[pattern]] and the substring *"{1}"* replaced with _dateFormat_.[[pattern]].
1. Set _format_.[[pattern]] to _pattern_.
1. If _timeFormat_ has a [[pattern12]] field, then
Expand Down Expand Up @@ -1403,31 +1412,31 @@ <h1>
1. Perform ! CreateDataPropertyOrThrow(_nf2Options_, *"minimumIntegerDigits"*, *2*<sub>𝔽</sub>).
1. Perform ! CreateDataPropertyOrThrow(_nf2Options_, *"useGrouping"*, *false*).
1. Let _nf2_ be ! Construct(%Intl.NumberFormat%, &laquo; _locale_, _nf2Options_ &raquo;).
1. Let _fractionalSecondDigits_ be _dateTimeFormat_.[[FractionalSecondDigits]].
1. If _fractionalSecondDigits_ is *undefined*, set _fractionalSecondDigits_ to 1.
1. Let _nf3Options_ be OrdinaryObjectCreate(*null*).
1. Perform ! CreateDataPropertyOrThrow(_nf3Options_, *"minimumIntegerDigits"*, 𝔽(_fractionalSecondDigits_)).
1. Perform ! CreateDataPropertyOrThrow(_nf3Options_, *"useGrouping"*, *false*).
1. Let _nf3_ be ! Construct(%NumberFormat%, &laquo; _locale_, _nf3Options_ &raquo;).
1. If _format_ has a field [[fractionalSecondDigits]], then
1. Let _fractionalSecondDigits_ be _format_.[[fractionalSecondDigits]].
1. Let _nf3Options_ be OrdinaryObjectCreate(*null*).
1. Perform ! CreateDataPropertyOrThrow(_nf3Options_, *"minimumIntegerDigits"*, 𝔽(_fractionalSecondDigits_)).
1. Perform ! CreateDataPropertyOrThrow(_nf3Options_, *"useGrouping"*, *false*).
1. Let _nf3_ be ! Construct(%Intl.NumberFormat%, &laquo; _locale_, _nf3Options_ &raquo;).
1. Let _tm_ be ToLocalTime(ℤ(ℝ(_x_) &times; 10<sup>6</sup>), _dateTimeFormat_.[[Calendar]], _dateTimeFormat_.[[TimeZone]]).
1. Let _patternParts_ be PartitionPattern(_pattern_).
1. Let _result_ be a new empty List.
1. For each Record { [[Type]], [[Value]] } _patternPart_ of _patternParts_, do
1. Let _p_ be _patternPart_.[[Type]].
1. If _p_ is *"literal"*, then
1. Append the Record { [[Type]]: *"literal"*, [[Value]]: _patternPart_.[[Value]] } to _result_.
1. Else if _p_ is equal to *"fractionalSecondDigits"*, then
1. Else if _p_ is *"fractionalSecondDigits"*, then
1. Assert: _format_ has a field [[fractionalSecondDigits]].
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 the Record { [[Type]]: *"fractionalSecond"*, [[Value]]: _fv_ } to _result_.
1. Else if _p_ is equal to *"dayPeriod"*, then
1. Else if _p_ is *"dayPeriod"*, then
1. Assert: _format_ has a field [[dayPeriod]].
1. Let _f_ be _format_.[[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 the Record { [[Type]]: _p_, [[Value]]: _fv_ } to _result_.
1. Else if _p_ is equal to *"timeZoneName"*, then
1. Else if _p_ is *"timeZoneName"*, then
1. Assert: _format_ has a field [[timeZoneName]].
1. Let _f_ be _format_.[[timeZoneName]].
1. Let _v_ be _dateTimeFormat_.[[TimeZone]].
Expand Down Expand Up @@ -1468,7 +1477,7 @@ <h1>
1. Let _v_ be _tm_.[[RelatedYear]].
1. Let _fv_ be FormatNumeric(_nf_, _v_).
1. Append the Record { [[Type]]: *"relatedYear"*, [[Value]]: _fv_ } to _result_.
1. Else if _p_ is equal to *"yearName"*, then
1. Else if _p_ is *"yearName"*, then
1. Let _v_ be _tm_.[[YearName]].
1. Let _fv_ be an implementation and locale dependent String value representing _v_.
1. Append the Record { [[Type]]: *"yearName"*, [[Value]]: _fv_ } to _result_.
Expand Down Expand Up @@ -1590,9 +1599,10 @@ <h1>
1. Let _v1_ be a String value representing the day period of _tm1_; the String value depends upon the implementation and the effective locale of _dateTimeFormat_.
1. Let _v2_ be a String value representing the day period of _tm2_; the String value depends upon the implementation and the effective locale of _dateTimeFormat_.
1. Else if _fieldName_ is [[FractionalSecondDigits]], then
1. Let _fractionalSecondDigits_ be _dateTimeFormat_.[[FractionalSecondDigits]].
1. If _fractionalSecondDigits_ is *undefined*, then
1. Set _fractionalSecondDigits_ to 3.
1. If _format_ has a [[fractionalSecondDigits]] field, then
1. Let _fractionalSecondDigits_ be _format_.[[fractionalSecondDigits]].
1. Else,
1. Let _fractionalSecondDigits_ be 3.
1. Let _exp_ be _fractionalSecondDigits_ - 3.
1. Let _v1_ be floor(_tm1_.[[Millisecond]] &times; 10<sup>_exp_</sup>).
1. Let _v2_ be floor(_tm2_.[[Millisecond]] &times; 10<sup>_exp_</sup>).
Expand All @@ -1604,7 +1614,7 @@ <h1>
1. If _relevantFieldsEqual_ is *true*, then
1. Let _collapsedResult_ be a new empty List.
1. Let _resultParts_ be ! FormatDateTimePattern(_dateTimeFormat_, _format_, _pattern_, _x_).
1. For each Record { [[Type]], [[Value]] } _r_ in _resultParts_, do
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.
Expand All @@ -1618,7 +1628,7 @@ <h1>
1. Else,
1. Let _z_ be _y_.
1. Let _resultParts_ be ! FormatDateTimePattern(_dateTimeFormat_, _selectedRangePattern_, _pattern_, _z_).
1. For each Record { [[Type]], [[Value]] } _r_ in _resultParts_, do
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>
Expand Down
2 changes: 1 addition & 1 deletion spec/listformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ <h1>
</dl>
<emu-alg>
1. Let _parts_ be CreatePartsFromList(_listFormat_, _list_).
1. Let _result_ be an empty String.
1. Let _result_ be the empty String.
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_.
Expand Down
3 changes: 1 addition & 2 deletions spec/locale-sensitive-functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ <h1>
1. Let _requestedLocale_ be _requestedLocales_[0].
1. Else,
1. Let _requestedLocale_ be DefaultLocale().
1. Let _noExtensionsLocale_ be the String value that is _requestedLocale_ with any Unicode locale extension sequences removed.
1. Let _availableLocales_ be an Available Locales List which includes the language tags for which the Unicode Character Database contains language-sensitive case mappings. If the implementation supports additional locale-sensitive case mappings, _availableLocales_ should also include their corresponding language tags.
1. Let _match_ be LookupMatchingLocaleByPrefix(_availableLocales_, _noExtensionsLocale_).
1. Let _match_ be LookupMatchingLocaleByPrefix(_availableLocales_, &laquo; _requestedLocale_ &raquo;).
1. If _match_ is not *undefined*, let _locale_ be _match_.[[locale]]; else let _locale_ be *"und"*.
1. Let _codePoints_ be StringToCodePoints(_S_).
1. If _targetCase_ is ~lower~, then
Expand Down
2 changes: 0 additions & 2 deletions spec/locales-currencies-tz.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,6 @@ <h1>AvailableNamedTimeZoneIdentifiers ( ): a List of Time Zone Identifier Record
Its result describes all available named time zone identifiers in this implementation, as well as the primary time zone identifier corresponding to each available named time zone identifier.
The List is ordered according to the [[Identifier]] field of each Time Zone Identifier Record.
</dd>
<dt>redefinition</dt>
<dd>true</dd>
</dl>
<p>This definition supersedes the definition provided in <emu-xref href="#sec-availablenamedtimezoneidentifiers"></emu-xref>.</p>
<emu-alg>
Expand Down
8 changes: 4 additions & 4 deletions spec/negotiation.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ <h1>
1. Let _canonicalizedTag_ be CanonicalizeUnicodeLocaleId(_tag_).
1. If _seen_ does not contain _canonicalizedTag_, append _canonicalizedTag_ to _seen_.
1. Set _k_ to _k_ + 1.
1. Return _seen_.
</emu-alg>

<emu-note>
Expand Down Expand Up @@ -283,7 +284,7 @@ <h1>
1. If _supportedKeywords_ is not empty, then
1. Let _supportedAttributes_ be a new empty List.
1. Set _foundLocale_ to InsertUnicodeExtensionAndCanonicalize(_foundLocale_, _supportedAttributes_, _supportedKeywords_).
1. Set _result_.[[locale]] to _foundLocale_.
1. Set _result_.[[Locale]] to _foundLocale_.
1. Return _result_.
</emu-alg>
</emu-clause>
Expand All @@ -305,11 +306,10 @@ <h1>
1. Let _matcher_ be ? GetOption(_options_, *"localeMatcher"*, ~string~, &laquo; *"lookup"*, *"best fit"* &raquo;, *"best fit"*).
1. Let _subset_ be a new empty List.
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. If _matcher_ is *"lookup"*, then
1. Let _match_ be LookupMatchingLocaleByPrefix(_availableLocales_, _noExtensionsLocale_).
1. Let _match_ be LookupMatchingLocaleByPrefix(_availableLocales_, &laquo; _locale_ &raquo;).
1. Else,
1. Let _match_ be LookupMatchingLocaleByBestFit(_availableLocales_, _noExtensionsLocale_).
1. Let _match_ be LookupMatchingLocaleByBestFit(_availableLocales_, &laquo; _locale_ &raquo;).
1. If _match_ is not *undefined*, append _locale_ to _subset_.
1. Return CreateArrayFromList(_subset_).
</emu-alg>
Expand Down
Loading

0 comments on commit 3f029b0

Please sign in to comment.