Skip to content

Commit

Permalink
Editorial: Rename IsValidTimeZoneName to IsAvailableTimeZoneName
Browse files Browse the repository at this point in the history
In order to align with AvailableTimeZones and ECMA-402 terminology, use
"Available" in the name of the operation instead of "Valid".
  • Loading branch information
ptomato authored and Ms2ger committed Oct 11, 2022
1 parent b30c20c commit 873313b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion spec/abstractops.html
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ <h1>ToRelativeTemporalObject ( _options_ )</h1>
1. Let _timeZone_ be *undefined*.
1. Else,
1. If IsTimeZoneOffsetString(_timeZoneName_) is *false*, then
1. If IsValidTimeZoneName(_timeZoneName_) is *false*, throw a *RangeError* exception.
1. If IsAvailableTimeZoneName(_timeZoneName_) is *false*, throw a *RangeError* exception.
1. Set _timeZoneName_ to ! CanonicalizeTimeZoneName(_timeZoneName_).
1. Let _timeZone_ be ! CreateTemporalTimeZone(_timeZoneName_).
1. If _result_.[[TimeZone]].[[Z]] is *true*, then
Expand Down
4 changes: 2 additions & 2 deletions spec/intl.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h1><a href="https://tc39.es/ecma402/#sec-isvalidtimezonename">IsValidTimeZoneNa
<emu-clause id="sup-canonicalizetimezonename" type="abstract operation">
<h1>
CanonicalizeTimeZoneName (
_timeZone_: a String value that is a valid time zone name as verified by IsValidTimeZoneName,
_timeZone_: a String value that is <del>a valid</del><ins>an available</ins> time zone name as verified by <del>IsValidTimeZoneName</del><ins>IsAvailableTimeZoneName</ins>,
)
</h1>
<dl class="header">
Expand Down Expand Up @@ -216,7 +216,7 @@ <h1>InitializeDateTimeFormat ( _dateTimeFormat_, _locales_, _options_ )</h1>
1. Set _timeZone_ to DefaultTimeZone().
1. Else,
1. Set _timeZone_ to ? ToString(_timeZone_).
1. If the result of IsValidTimeZoneName(_timeZone_) is *false*, then
1. If <del>the result of IsValidTimeZoneName<!---->(_timeZone_)</del><ins>IsAvailableTimeZoneName(_timeZone_)</ins> is *false*, then
1. Throw a *RangeError* exception.
1. Set _timeZone_ to ! CanonicalizeTimeZoneName(_timeZone_).
1. Set _dateTimeFormat_.[[TimeZone]] to _timeZone_.
Expand Down
14 changes: 7 additions & 7 deletions spec/timezone.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1>Time Zone Names</h1>
In addition, implementations may support any number of other built-in time zones.
</p>
<p>
Built-in time zones may be <dfn variants="named time zone">named time zones</dfn>, represented by Strings for which IsValidTimeZoneName returns *true*.
Built-in time zones may be <dfn variants="named time zone">named time zones</dfn>, represented by Strings for which IsAvailableTimeZoneName returns *true*.
They may also be <dfn variants="offset time zone">offset time zones</dfn>, represented by Strings for which IsTimeZoneOffsetString returns *true*.
</p>
<p>
Expand All @@ -34,9 +34,9 @@ <h1>Time Zone Names</h1>
Other implementations are encouraged to do the same.
</p>

<emu-clause id="sec-isvalidtimezonename" type="abstract operation">
<emu-clause id="sec-isavailabletimezonename" type="abstract operation">
<h1>
IsValidTimeZoneName (
IsAvailableTimeZoneName (
_timeZone_: a String,
): a Boolean
</h1>
Expand All @@ -45,7 +45,7 @@ <h1>
<dd>The returned value is *true* if _timeZone_ is an ASCII-case-insensitive match for a supported time zone name, and *false* otherwise.</dd>
</dl>
<p>
Once IsValidTimeZoneName(_timeZone_) has returned *true*, for the lifetime of the surrounding agent, IsValidTimeZoneName(_variant_) must return *true* if _variant_ is an ASCII-case-insensitive match for either _timeZone_ or CanonicalizeTimeZoneName(_timeZone_).
Once IsAvailableTimeZoneName(_timeZone_) has returned *true*, for the lifetime of the surrounding agent, IsAvailableTimeZoneName(_variant_) must return *true* if _variant_ is an ASCII-case-insensitive match for either _timeZone_ or CanonicalizeTimeZoneName(_timeZone_).
</p>
<p>
For the purposes of this section, a String value _A_ is an ASCII-case-insensitive match for String value _B_ if the String value derived from _A_ by replacing each occurrence of a lowercase ASCII letter code unit (0x0061 through 0x007A, inclusive) with the corresponding uppercase ASCII letter code unit (0x0041 through 0x005A, inclusive) while preserving all other code units is exactly the same sequence of code units as the String value that is derived from _B_ in the same way.
Expand All @@ -62,7 +62,7 @@ <h1>
<emu-clause id="sec-canonicalizetimezonename" type="abstract operation">
<h1>
CanonicalizeTimeZoneName (
_timeZone_: a String that is a valid time zone name as verified by IsValidTimeZoneName,
_timeZone_: a String that is a valid time zone name as verified by IsAvailableTimeZoneName,
)
</h1>
<dl class="header">
Expand Down Expand Up @@ -137,7 +137,7 @@ <h1>Temporal.TimeZone ( _identifier_ )</h1>
1. Throw a *TypeError* exception.
1. Set _identifier_ to ? ToString(_identifier_).
1. If IsTimeZoneOffsetString(_identifier_) is *false*, then
1. If IsValidTimeZoneName(_identifier_) is *false*, then
1. If IsAvailableTimeZoneName(_identifier_) is *false*, then
1. Throw a *RangeError* exception.
1. Set _identifier_ to ! CanonicalizeTimeZoneName(_identifier_).
1. Return ? CreateTemporalTimeZone(_identifier_, NewTarget).
Expand Down Expand Up @@ -552,7 +552,7 @@ <h1>ToTemporalTimeZone ( _temporalTimeZoneLike_ )</h1>
1. If _parseResult_.[[Name]] is not *undefined*, then
1. Let _name_ be _parseResult_.[[Name]].
1. If IsTimeZoneOffsetString(_name_) is *false*, then
1. If IsValidTimeZoneName(_name_) is *false*, throw a *RangeError* exception.
1. If IsAvailableTimeZoneName(_name_) is *false*, throw a *RangeError* exception.
1. Set _name_ to ! CanonicalizeTimeZoneName(_name_).
1. Return ! CreateTemporalTimeZone(_name_).
1. If _parseResult_.[[Z]] is *true*, return ! CreateTemporalTimeZone(*"UTC"*).
Expand Down
2 changes: 1 addition & 1 deletion spec/zoneddatetime.html
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ <h1>
1. Let _timeZoneName_ be _result_.[[TimeZone]].[[Name]].
1. Assert: _timeZoneName_ is not *undefined*.
1. If IsTimeZoneOffsetString(_timeZoneName_) is *false*, then
1. If IsValidTimeZoneName(_timeZoneName_) is *false*, throw a *RangeError* exception.
1. If IsAvailableTimeZoneName(_timeZoneName_) is *false*, throw a *RangeError* exception.
1. Set _timeZoneName_ to ! CanonicalizeTimeZoneName(_timeZoneName_).
1. Let _offsetString_ be _result_.[[TimeZone]].[[OffsetString]].
1. If _result_.[[TimeZone]].[[Z]] is *true*, then
Expand Down

0 comments on commit 873313b

Please sign in to comment.