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 authored and ben-allen committed May 24, 2024
1 parent f9f7171 commit 0f1565c
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 @@ -205,7 +205,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 @@ -1359,7 +1359,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 @@ -1779,7 +1779,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(%Intl.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 @@ -273,7 +273,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 @@ -385,7 +385,7 @@ <h1>
1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
1. If _next_ is ~done~, then
1. Return _list_.
1. If Type(_next_) is not String, then
1. If _next_ is not a String, then
1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _error_).
1. Append _next_ to _list_.
Expand Down
8 changes: 4 additions & 4 deletions spec/locale.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ <h1>Intl.Locale ( _tag_ [ , _options_ ] )</h1>
1. If _relevantExtensionKeys_ contains *"kf"*, then
1. Append [[CaseFirst]] to _internalSlotsList_.
1. If _relevantExtensionKeys_ contains *"kn"*, then
1. Append [[Numeric]] to _internalSlotsList_.
1. Append [[Numeric]] as the last element of _internalSlotsList_.
1. Let _locale_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%Intl.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 @@ -135,7 +135,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
16 changes: 8 additions & 8 deletions spec/negotiation.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,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 @@ -64,8 +64,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 @@ -225,9 +225,9 @@ <h1>
1. Let _supportedExtension_ be *"-u"*.
1. For each element _key_ of _relevantExtensionKeys_, do
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 @@ -242,8 +242,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 @@ -306,7 +306,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 @@ -725,7 +725,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 @@ -1430,7 +1430,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(%Intl.NumberFormat%, _nf_) is *true*, then
1. Return ? Get(_nf_, %Intl%.[[FallbackSymbol]]).
1. Return _nf_.
Expand Down Expand Up @@ -1688,8 +1688,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 0f1565c

Please sign in to comment.