Skip to content

Commit

Permalink
Editorial: Replace uses of Type(...) notation
Browse files Browse the repository at this point in the history
Updated to match <tc39/ecma262#2874>.
  • Loading branch information
anba committed Aug 14, 2023
1 parent 06aa7e7 commit ef3a5dc
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion spec/collator.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ <h1>Collator Compare Functions</h1>

<emu-alg>
1. Let _collator_ be _F_.[[Collator]].
1. Assert: Type(_collator_) is Object and _collator_ has an [[InitializedCollator]] internal slot.
1. Assert: _collator_ is an Object and _collator_ has an [[InitializedCollator]] internal slot.
1. If _x_ is not provided, let _x_ be *undefined*.
1. If _y_ is not provided, let _y_ be *undefined*.
1. Let _X_ be ? ToString(_x_).
Expand Down
4 changes: 2 additions & 2 deletions spec/datetimeformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,7 @@ <h1>DateTime Format Functions</h1>

<emu-alg>
1. Let _dtf_ be _F_.[[DateTimeFormat]].
1. Assert: Type(_dtf_) is Object and _dtf_ has an [[InitializedDateTimeFormat]] internal slot.
1. Assert: _dtf_ is an Object and _dtf_ has an [[InitializedDateTimeFormat]] internal slot.
1. If _date_ is not provided or is *undefined*, then
1. Let _x_ be ! Call(%Date.now%, *undefined*).
1. Else,
Expand Down Expand Up @@ -1681,7 +1681,7 @@ <h1>
</dd>
</dl>
<emu-alg>
1. If Type(_dtf_) is not Object, throw a *TypeError* exception.
1. If _dtf_ is not an Object, throw a *TypeError* exception.
1. If _dtf_ does not have an [[InitializedDateTimeFormat]] internal slot and ? OrdinaryHasInstance(%DateTimeFormat%, _dtf_) is *true*, then
1. Return ? Get(_dtf_, %Intl%.[[FallbackSymbol]]).
1. Return _dtf_.
Expand Down
4 changes: 2 additions & 2 deletions spec/listformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ <h1>
1. Else,
1. Assert: _placeables_ has a field [[&lt;_part_&gt;]].
1. Let _subst_ be _placeables_.[[&lt;_part_&gt;]].
1. If Type(_subst_) is List, then
1. If _subst_ is a List, then
1. For each element _s_ of _subst_, do
1. Append _s_ to _result_.
1. Else,
Expand Down Expand Up @@ -388,7 +388,7 @@ <h1>
1. Set _next_ to ? IteratorStep(_iteratorRecord_).
1. If _next_ is not *false*, then
1. Let _nextValue_ be ? IteratorValue(_next_).
1. If Type(_nextValue_) is not String, then
1. If _nextValue_ is not a 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_.
Expand Down
6 changes: 3 additions & 3 deletions spec/locale.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ <h1>Intl.Locale ( _tag_ [ , _options_ ] )</h1>
1. If _relevantExtensionKeys_ contains *"kn"*, then
1. Append [[Numeric]] as the last element of _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
1. If _tag_ is not a String and _tag_ is not an Object, throw a *TypeError* exception.
1. If _tag_ is an Object and _tag_ has an [[InitializedLocale]] internal slot, then
1. Let _tag_ be _tag_.[[Locale]].
1. Else,
1. Let _tag_ be ? ToString(_tag_).
Expand Down Expand Up @@ -144,7 +144,7 @@ <h1>
1. Assert: _options_ has a field [[&lt;_key_&gt;]].
1. Let _optionsValue_ be _options_.[[&lt;_key_&gt;]].
1. If _optionsValue_ is not *undefined*, then
1. Assert: Type(_optionsValue_) is String.
1. Assert: _optionsValue_ is a String.
1. Set _value_ to _optionsValue_.
1. If _entry_ is not ~empty~, then
1. Set _entry_.[[Value]] to _value_.
Expand Down
18 changes: 9 additions & 9 deletions spec/negotiation.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h1>
1. If _locales_ is *undefined*, then
1. Return a new empty List.
1. Let _seen_ be a new empty List.
1. If Type(_locales_) is String or Type(_locales_) is Object and _locales_ has an [[InitializedLocale]] internal slot, then
1. If _locales_ is a String or _locales_ is an Object and _locales_ has an [[InitializedLocale]] internal slot, then
1. Let _O_ be CreateArrayFromList(&laquo; _locales_ &raquo;).
1. Else,
1. Let _O_ be ? ToObject(_locales_).
Expand All @@ -55,8 +55,8 @@ <h1>
1. Let _kPresent_ be ? HasProperty(_O_, _Pk_).
1. If _kPresent_ is *true*, then
1. Let _kValue_ be ? Get(_O_, _Pk_).
1. If Type(_kValue_) is not String or Object, throw a *TypeError* exception.
1. If Type(_kValue_) is Object and _kValue_ has an [[InitializedLocale]] internal slot, then
1. If _kValue_ is not a String and _kValue_ is not an Object, throw a *TypeError* exception.
1. If _kValue_ is an Object and _kValue_ has an [[InitializedLocale]] internal slot, then
1. Let _tag_ be _kValue_.[[Locale]].
1. Else,
1. Let _tag_ be ? ToString(_kValue_).
Expand Down Expand Up @@ -232,11 +232,11 @@ <h1>
1. Let _supportedExtension_ be *"-u"*.
1. For each element _key_ of _relevantExtensionKeys_, do
1. Let _foundLocaleData_ be _localeData_.[[&lt;_foundLocale_&gt;]].
1. Assert: Type(_foundLocaleData_) is Record.
1. Assert: _foundLocaleData_ is a Record.
1. Let _keyLocaleData_ be _foundLocaleData_.[[&lt;_key_&gt;]].
1. Assert: Type(_keyLocaleData_) is List.
1. Assert: _keyLocaleData_ is a List.
1. Let _value_ be _keyLocaleData_[0].
1. Assert: Type(_value_) is either String or Null.
1. Assert: _value_ is a String or _value_ is *null*.
1. Let _supportedExtensionAddition_ be *""*.
1. If _r_.[[extension]] is not ~empty~, then
1. If _keywords_ contains an element whose [[Key]] is the same as _key_, then
Expand All @@ -251,8 +251,8 @@ <h1>
1. Set _supportedExtensionAddition_ to the string-concatenation of *"-"* and _key_.
1. Assert: _options_ has a field [[&lt;_key_&gt;]].
1. Let _optionsValue_ be _options_.[[&lt;_key_&gt;]].
1. Assert: Type(_optionsValue_) is either String, Undefined, or Null.
1. If Type(_optionsValue_) is String, then
1. Assert: _optionsValue_ is a String, or _optionsValue_ is either *undefined* or *null*.
1. If _optionsValue_ is a String, then
1. Let _ukey_ be the ASCII-lowercase of _key_.
1. Let _optionsUValue_ be the ASCII-lowercase of _optionsValue_.
1. Set _optionsValue_ to the String value resulting from canonicalizing _optionsUValue_ as a value of key _ukey_ per <a href="https://unicode.org/reports/tr35/#processing-localeids">Unicode Technical Standard #35 Part 1 Core, Annex C LocaleId Canonicalization Section 5 Canonicalizing Syntax, Processing LocaleIds</a>.
Expand Down Expand Up @@ -348,7 +348,7 @@ <h1>
<emu-alg>
1. If _options_ is *undefined*, then
1. Return OrdinaryObjectCreate(*null*).
1. If Type(_options_) is Object, then
1. If _options_ is an Object, then
1. Return _options_.
1. Throw a *TypeError* exception.
</emu-alg>
Expand Down
8 changes: 4 additions & 4 deletions spec/numberformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ <h1>Number Format Functions</h1>

<emu-alg>
1. Let _nf_ be _F_.[[NumberFormat]].
1. Assert: Type(_nf_) is Object and _nf_ has an [[InitializedNumberFormat]] internal slot.
1. Assert: _nf_ is an Object and _nf_ has an [[InitializedNumberFormat]] internal slot.
1. If _value_ is not provided, let _value_ be *undefined*.
1. Let _x_ be ? ToIntlMathematicalValue(_value_).
1. Return FormatNumeric(_nf_, _x_).
Expand Down Expand Up @@ -1413,7 +1413,7 @@ <h1>
</dd>
</dl>
<emu-alg>
1. If Type(_nf_) is not Object, throw a *TypeError* exception.
1. If _nf_ is not an Object, throw a *TypeError* exception.
1. If _nf_ does not have an [[InitializedNumberFormat]] internal slot and ? OrdinaryHasInstance(%NumberFormat%, _nf_) is *true*, then
1. Return ? Get(_nf_, %Intl%.[[FallbackSymbol]]).
1. Return _nf_.
Expand Down Expand Up @@ -1675,8 +1675,8 @@ <h1>
</dl>
<emu-alg>
1. Let _primValue_ be ? ToPrimitive(_value_, ~number~).
1. If Type(_primValue_) is BigInt, return ℝ(_primValue_).
1. If Type(_primValue_) is String, then
1. If _primValue_ is a BigInt, return ℝ(_primValue_).
1. If _primValue_ is a String, then
1. Let _str_ be _primValue_.
1. Else,
1. Let _x_ be ? ToNumber(_primValue_).
Expand Down

0 comments on commit ef3a5dc

Please sign in to comment.