Skip to content

Commit a18670e

Browse files
committed
normative: align ToIntegerIfInteger with Temporal
Fixes: #156
1 parent f66511a commit a18670e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2606,8 +2606,8 @@ <h1><span class="secnum">1.1.1</span> Duration Records</h1>
26062606

26072607
<emu-clause id="sec-tointegerwithoutrounding" type="abstract operation" aoid="ToIntegerIfIntegral">
26082608
<h1><span class="secnum">1.1.2</span> ToIntegerIfIntegral ( <var>argument</var> )</h1>
2609-
<p>The abstract operation ToIntegerIfIntegral takes argument <var>argument</var> (an <emu-xref href="#sec-ecmascript-language-types"><a href="https://tc39.es/ecma262/#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> an <emu-xref href="#integer"><a href="https://tc39.es/ecma262/#integer">integer</a></emu-xref>, or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It converts <var>argument</var> to an <emu-xref href="#integer"><a href="https://tc39.es/ecma262/#integer">integer</a></emu-xref> representing its Number value (replacing <emu-val>NaN</emu-val> with 0), or throws a <emu-val>RangeError</emu-val> when that Number value is not a <emu-xref href="#finite"><a href="https://tc39.es/ecma262/#finite">finite</a></emu-xref> <emu-xref href="#integral-number"><a href="https://tc39.es/ecma262/#integral-number">integral Number</a></emu-xref>. It performs the following steps when called:</p>
2610-
<emu-alg><ol><li>Let <var>number</var> be ?&nbsp;<emu-xref aoid="ToNumber"><a href="https://tc39.es/ecma262/#sec-tonumber">ToNumber</a></emu-xref>(<var>argument</var>).</li><li>If <var>number</var> is <emu-val>NaN</emu-val>, <emu-val>+0</emu-val><sub>𝔽</sub>, or <emu-val>-0</emu-val><sub>𝔽</sub>, return 0.</li><li>If <emu-xref aoid="IsIntegralNumber"><a href="https://tc39.es/ecma262/#sec-isintegralnumber">IsIntegralNumber</a></emu-xref>(<var>number</var>) is <emu-val>false</emu-val>, throw a <emu-val>RangeError</emu-val> exception.</li><li>Return <emu-xref aoid=""><a href="https://tc39.es/ecma262/#ℝ">ℝ</a></emu-xref>(<var>number</var>).</li></ol></emu-alg>
2609+
<p>The abstract operation ToIntegerIfIntegral takes argument <var>argument</var> (an <emu-xref href="#sec-ecmascript-language-types"><a href="https://tc39.es/ecma262/#sec-ecmascript-language-types">ECMAScript language value</a></emu-xref>) and returns either a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion containing</a></emu-xref> an <emu-xref href="#integer"><a href="https://tc39.es/ecma262/#integer">integer</a></emu-xref>, or an <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">abrupt completion</a></emu-xref>. It converts <var>argument</var> to an <emu-xref href="#integer"><a href="https://tc39.es/ecma262/#integer">integer</a></emu-xref> representing its Number value, or throws a <emu-val>RangeError</emu-val> when that value is not <emu-xref href="#integral-number"><a href="https://tc39.es/ecma262/#integral-number">integral</a></emu-xref>. It performs the following steps when called:</p>
2610+
<emu-alg><ol><li>Let <var>number</var> be ?&nbsp;<emu-xref aoid="ToNumber"><a href="https://tc39.es/ecma262/#sec-tonumber">ToNumber</a></emu-xref>(<var>argument</var>).</li><li>If <emu-xref aoid="IsIntegralNumber"><a href="https://tc39.es/ecma262/#sec-isintegralnumber">IsIntegralNumber</a></emu-xref>(<var>number</var>) is <emu-val>false</emu-val>, throw a <emu-val>RangeError</emu-val> exception.</li><li>Return <emu-xref aoid=""><a href="https://tc39.es/ecma262/#ℝ">ℝ</a></emu-xref>(<var>number</var>).</li></ol></emu-alg>
26112611
</emu-clause>
26122612

26132613
<emu-clause id="sec-todurationrecord" type="abstract operation" aoid="ToDurationRecord">

spec.emu

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,10 @@ contributors: Ujjwal Sharma, Younies Mahmoud
9595
</h1>
9696
<dl class="header">
9797
<dt>description</dt>
98-
<dd>It converts _argument_ to an integer representing its Number value (replacing *NaN* with 0), or throws a *RangeError* when that Number value is not a finite integral Number.</dd>
98+
<dd>It converts _argument_ to an integer representing its Number value, or throws a *RangeError* when that value is not <emu-xref href="#integral-number">integral</emu-xref>.</dd>
9999
</dl>
100100
<emu-alg>
101101
1. Let _number_ be ? ToNumber(_argument_).
102-
1. If _number_ is *NaN*, *+0*<sub>𝔽</sub>, or *-0*<sub>𝔽</sub>, return 0.
103102
1. If IsIntegralNumber(_number_) is *false*, throw a *RangeError* exception.
104103
1. Return ℝ(_number_).
105104
</emu-alg>

0 commit comments

Comments
 (0)