Skip to content

Commit 2e346ae

Browse files
committed
normative: align ToIntegerIfInteger with Temporal
Fixes: #156
1 parent 4c7efed commit 2e346ae

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,7 +2522,7 @@
25222522
</ul></div><div id="menu-toggle"><svg xmlns="http://www.w3.org/2000/svg" style="width:100%; height:100%; stroke:currentColor" viewBox="0 0 120 120">
25232523
<title>Menu</title>
25242524
<path stroke-width="10" stroke-linecap="round" d="M30,60 h60 M30,30 m0,5 h60 M30,90 m0,-5 h60"></path>
2525-
</svg></div><div id="menu-spacer" class="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins</div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle">◢</span><a href="#durationformat-objects" title="DurationFormat Objects"><span class="secnum">1</span> DurationFormat Objects</a><ol class="toc"><li><span class="item-toggle">◢</span><a href="#sec-intl-durationformat-abstracts" title="Abstract Operations for DurationFormat Objects"><span class="secnum">1.1</span> Abstract Operations for DurationFormat Objects</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-duration-records" title="Duration Records"><span class="secnum">1.1.1</span> Duration Records</a></li><li><span class="item-toggle-none"></span><a href="#sec-tointegerwithoutrounding" title="ToIntegerIfIntegral ( argument )"><span class="secnum">1.1.2</span> ToIntegerIfIntegral ( <var>argument</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-todurationrecord" title="ToDurationRecord ( input )"><span class="secnum">1.1.3</span> ToDurationRecord ( <var>input</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-durationrecordsign" title="DurationRecordSign ( record )"><span class="secnum">1.1.4</span> DurationRecordSign ( <var>record</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-isvaliddurationrecord" title="IsValidDurationRecord ( record )"><span class="secnum">1.1.5</span> IsValidDurationRecord ( <var>record</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-getdurationunitoptions" title="GetDurationUnitOptions ( unit, options, baseStyle, stylesList, digitalBase, prevStyle )"><span class="secnum">1.1.6</span> GetDurationUnitOptions ( <var>unit</var>, <var>options</var>, <var>baseStyle</var>, <var>stylesList</var>, <var>digitalBase</var>, <var>prevStyle</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-partitiondurationformatpattern" title="PartitionDurationFormatPattern ( durationFormat, duration )"><span class="secnum">1.1.7</span> PartitionDurationFormatPattern ( <var>durationFormat</var>, <var>duration</var> )</a></li></ol></li><li><span class="item-toggle">◢</span><a href="#sec-intl-durationformat-constructor" title="The Intl.DurationFormat Constructor"><span class="secnum">1.2</span> The Intl.DurationFormat Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat" title="Intl.DurationFormat ( [ locales [ , options ] ] )"><span class="secnum">1.2.1</span> Intl.DurationFormat ( [ <var>locales</var> [ , <var>options</var> ] ] )</a></li></ol></li><li><span class="item-toggle">◢</span><a href="#sec-properties-of-intl-durationformat-constructor" title="Properties of the Intl.DurationFormat Constructor"><span class="secnum">1.3</span> Properties of the Intl.DurationFormat Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat.prototype" title="Intl.DurationFormat.prototype"><span class="secnum">1.3.1</span> Intl.DurationFormat.prototype</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat.supportedLocalesOf" title="Intl.DurationFormat.supportedLocalesOf ( locales [ , options ] )"><span class="secnum">1.3.2</span> Intl.DurationFormat.supportedLocalesOf ( <var>locales</var> [ , <var>options</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat-internal-slots" title="Internal slots"><span class="secnum">1.3.3</span> Internal slots</a></li></ol></li><li><span class="item-toggle">◢</span><a href="#sec-properties-of-intl-durationformat-prototype-object" title="Properties of the Intl.DurationFormat Prototype Object"><span class="secnum">1.4</span> Properties of the Intl.DurationFormat Prototype Object</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat.prototype.constructor" title="Intl.DurationFormat.prototype.constructor"><span class="secnum">1.4.1</span> Intl.DurationFormat.prototype.constructor</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat.prototype-@@tostringtag" title="Intl.DurationFormat.prototype [ @@toStringTag ]"><span class="secnum">1.4.2</span> Intl.DurationFormat.prototype [ @@toStringTag ]</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat.prototype.format" title="Intl.DurationFormat.prototype.format ( duration )"><span class="secnum">1.4.3</span> Intl.DurationFormat.prototype.format ( <var>duration</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat.prototype.formatToParts" title="Intl.DurationFormat.prototype.formatToParts ( duration )"><span class="secnum">1.4.4</span> Intl.DurationFormat.prototype.formatToParts ( <var>duration</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat.prototype.resolvedOptions" title="Intl.DurationFormat.prototype.resolvedOptions ( )"><span class="secnum">1.4.5</span> Intl.DurationFormat.prototype.resolvedOptions ( )</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-properties-of-intl-durationformat-instances" title="Properties of Intl.DurationFormat Instances"><span class="secnum">1.5</span> Properties of Intl.DurationFormat Instances</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-copyright-and-software-license" title="Copyright &amp; Software License"><span class="secnum">A</span> Copyright &amp; Software License</a></li></ol></div></div><div id="spec-container"><h1 class="version">Stage 3 Draft / June 1, 2023</h1><h1 class="title">Intl.DurationFormat</h1>
2525+
</svg></div><div id="menu-spacer" class="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins</div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle">◢</span><a href="#durationformat-objects" title="DurationFormat Objects"><span class="secnum">1</span> DurationFormat Objects</a><ol class="toc"><li><span class="item-toggle">◢</span><a href="#sec-intl-durationformat-abstracts" title="Abstract Operations for DurationFormat Objects"><span class="secnum">1.1</span> Abstract Operations for DurationFormat Objects</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-duration-records" title="Duration Records"><span class="secnum">1.1.1</span> Duration Records</a></li><li><span class="item-toggle-none"></span><a href="#sec-tointegerwithoutrounding" title="ToIntegerIfIntegral ( argument )"><span class="secnum">1.1.2</span> ToIntegerIfIntegral ( <var>argument</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-todurationrecord" title="ToDurationRecord ( input )"><span class="secnum">1.1.3</span> ToDurationRecord ( <var>input</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-durationrecordsign" title="DurationRecordSign ( record )"><span class="secnum">1.1.4</span> DurationRecordSign ( <var>record</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-isvaliddurationrecord" title="IsValidDurationRecord ( record )"><span class="secnum">1.1.5</span> IsValidDurationRecord ( <var>record</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-getdurationunitoptions" title="GetDurationUnitOptions ( unit, options, baseStyle, stylesList, digitalBase, prevStyle )"><span class="secnum">1.1.6</span> GetDurationUnitOptions ( <var>unit</var>, <var>options</var>, <var>baseStyle</var>, <var>stylesList</var>, <var>digitalBase</var>, <var>prevStyle</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-partitiondurationformatpattern" title="PartitionDurationFormatPattern ( durationFormat, duration )"><span class="secnum">1.1.7</span> PartitionDurationFormatPattern ( <var>durationFormat</var>, <var>duration</var> )</a></li></ol></li><li><span class="item-toggle">◢</span><a href="#sec-intl-durationformat-constructor" title="The Intl.DurationFormat Constructor"><span class="secnum">1.2</span> The Intl.DurationFormat Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat" title="Intl.DurationFormat ( [ locales [ , options ] ] )"><span class="secnum">1.2.1</span> Intl.DurationFormat ( [ <var>locales</var> [ , <var>options</var> ] ] )</a></li></ol></li><li><span class="item-toggle">◢</span><a href="#sec-properties-of-intl-durationformat-constructor" title="Properties of the Intl.DurationFormat Constructor"><span class="secnum">1.3</span> Properties of the Intl.DurationFormat Constructor</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat.prototype" title="Intl.DurationFormat.prototype"><span class="secnum">1.3.1</span> Intl.DurationFormat.prototype</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat.supportedLocalesOf" title="Intl.DurationFormat.supportedLocalesOf ( locales [ , options ] )"><span class="secnum">1.3.2</span> Intl.DurationFormat.supportedLocalesOf ( <var>locales</var> [ , <var>options</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat-internal-slots" title="Internal slots"><span class="secnum">1.3.3</span> Internal slots</a></li></ol></li><li><span class="item-toggle">◢</span><a href="#sec-properties-of-intl-durationformat-prototype-object" title="Properties of the Intl.DurationFormat Prototype Object"><span class="secnum">1.4</span> Properties of the Intl.DurationFormat Prototype Object</a><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat.prototype.constructor" title="Intl.DurationFormat.prototype.constructor"><span class="secnum">1.4.1</span> Intl.DurationFormat.prototype.constructor</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat.prototype-@@tostringtag" title="Intl.DurationFormat.prototype [ @@toStringTag ]"><span class="secnum">1.4.2</span> Intl.DurationFormat.prototype [ @@toStringTag ]</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat.prototype.format" title="Intl.DurationFormat.prototype.format ( duration )"><span class="secnum">1.4.3</span> Intl.DurationFormat.prototype.format ( <var>duration</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat.prototype.formatToParts" title="Intl.DurationFormat.prototype.formatToParts ( duration )"><span class="secnum">1.4.4</span> Intl.DurationFormat.prototype.formatToParts ( <var>duration</var> )</a></li><li><span class="item-toggle-none"></span><a href="#sec-Intl.DurationFormat.prototype.resolvedOptions" title="Intl.DurationFormat.prototype.resolvedOptions ( )"><span class="secnum">1.4.5</span> Intl.DurationFormat.prototype.resolvedOptions ( )</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-properties-of-intl-durationformat-instances" title="Properties of Intl.DurationFormat Instances"><span class="secnum">1.5</span> Properties of Intl.DurationFormat Instances</a></li></ol></li><li><span class="item-toggle-none"></span><a href="#sec-copyright-and-software-license" title="Copyright &amp; Software License"><span class="secnum">A</span> Copyright &amp; Software License</a></li></ol></div></div><div id="spec-container"><h1 class="version">Stage 3 Draft / June 28, 2023</h1><h1 class="title">Intl.DurationFormat</h1>
25262526
<emu-biblio href="./biblio.json"></emu-biblio>
25272527
<emu-clause id="durationformat-objects">
25282528
<h1><span class="secnum">1</span> DurationFormat Objects</h1>
@@ -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)