Skip to content

Commit 58e476d

Browse files
gibson042ptomato
authored andcommitted
Editorial: Fold ToPartialTime into ToTemporalTimeRecord
1 parent 6ed1835 commit 58e476d

File tree

1 file changed

+58
-78
lines changed

1 file changed

+58
-78
lines changed

spec/plaintime.html

Lines changed: 58 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ <h1>Temporal.PlainTime.prototype.with ( _temporalTimeLike_ [ , _options_ ] )</h1
239239
1. If Type(_temporalTimeLike_) is not Object, then
240240
1. Throw a *TypeError* exception.
241241
1. Perform ? RejectObjectWithCalendarOrTimeZone(_temporalTimeLike_).
242-
1. Let _partialTime_ be ? ToPartialTime(_temporalTimeLike_).
242+
1. Let _partialTime_ be ? ToTemporalTimeRecord(_temporalTimeLike_, ~partial~).
243243
1. Set _options_ to ? GetOptionsObject(_options_).
244244
1. Let _overflow_ be ? ToTemporalOverflow(_options_).
245245
1. If _partialTime_.[[Hour]] is not *undefined*, then
@@ -621,75 +621,6 @@ <h1>ToTemporalTime ( _item_ [ , _overflow_ ] )</h1>
621621
</emu-alg>
622622
</emu-clause>
623623

624-
<emu-clause id="sec-temporal-topartialtime" aoid="ToPartialTime">
625-
<h1>ToPartialTime ( _temporalTimeLike_ )</h1>
626-
<emu-alg>
627-
1. Assert: Type(_temporalTimeLike_) is Object.
628-
1. Let _result_ be the Record {
629-
[[Hour]]: *undefined*,
630-
[[Minute]]: *undefined*,
631-
[[Second]]: *undefined*,
632-
[[Millisecond]]: *undefined*,
633-
[[Microsecond]]: *undefined*,
634-
[[Nanosecond]]: *undefined*
635-
}.
636-
1. Let _any_ be *false*.
637-
1. For each row of <emu-xref href="#table-temporal-temporaltimelike-properties"></emu-xref>, except the header row, in table order, do
638-
1. Let _property_ be the Property value of the current row.
639-
1. Let _value_ be ? Get(_temporalTimeLike_, _property_).
640-
1. If _value_ is not *undefined*, then
641-
1. Set _any_ to *true*.
642-
1. Set _value_ to ? ToIntegerThrowOnInfinity(_value_).
643-
1. Set _result_'s internal slot whose name is the Internal Slot value of the current row to _value_.
644-
1. If _any_ is *false*, then
645-
1. Throw a *TypeError* exception.
646-
1. Return _result_.
647-
</emu-alg>
648-
649-
<emu-table id="table-temporal-temporaltimelike-properties">
650-
<emu-caption>Properties of a TemporalTimeLike</emu-caption>
651-
<table class="real-table">
652-
<thead>
653-
<tr>
654-
<th>Internal Slot</th>
655-
<th>Property</th>
656-
</tr>
657-
</thead>
658-
<tbody>
659-
<tr>
660-
<td>[[Hour]]</td>
661-
<td>*"hour"*</td>
662-
</tr>
663-
664-
<tr>
665-
<td>[[Microsecond]]</td>
666-
<td>*"microsecond"*</td>
667-
</tr>
668-
669-
<tr>
670-
<td>[[Millisecond]]</td>
671-
<td>*"millisecond"*</td>
672-
</tr>
673-
674-
<tr>
675-
<td>[[Minute]]</td>
676-
<td>*"minute"*</td>
677-
</tr>
678-
679-
<tr>
680-
<td>[[Nanosecond]]</td>
681-
<td>*"nanosecond"*</td>
682-
</tr>
683-
684-
<tr>
685-
<td>[[Second]]</td>
686-
<td>*"second"*</td>
687-
</tr>
688-
</tbody>
689-
</table>
690-
</emu-table>
691-
</emu-clause>
692-
693624
<emu-clause id="sec-temporal-regulatetime" aoid="RegulateTime">
694625
<h1>RegulateTime ( _hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_, _overflow_ )</h1>
695626
<emu-alg>
@@ -812,11 +743,17 @@ <h1>CreateTemporalTime ( _hour_, _minute_, _second_, _millisecond_, _microsecond
812743
</emu-alg>
813744
</emu-clause>
814745

815-
<emu-clause id="sec-temporal-totemporaltimerecord" aoid="ToTemporalTimeRecord">
816-
<h1>ToTemporalTimeRecord ( _temporalTimeLike_ )</h1>
817-
<emu-note>The value of ! ToIntegerThrowOnInfinity(*undefined*) is 0.</emu-note>
746+
<emu-clause id="sec-temporal-totemporaltimerecord" type="abstract operation">
747+
<h1>
748+
ToTemporalTimeRecord (
749+
_temporalTimeLike_: an Object,
750+
optional _completeness_: ~partial~ or ~complete~,
751+
): either a normal completion containing an Object, or an abrupt completion
752+
</h1>
753+
<dl class="header">
754+
</dl>
818755
<emu-alg>
819-
1. Assert: Type(_temporalTimeLike_) is Object.
756+
1. If _completeness_ is not present, set _completeness_ to ~complete~.
820757
1. Let _result_ be the Record {
821758
[[Hour]]: *undefined*,
822759
[[Minute]]: *undefined*,
@@ -829,14 +766,57 @@ <h1>ToTemporalTimeRecord ( _temporalTimeLike_ )</h1>
829766
1. For each row of <emu-xref href="#table-temporal-temporaltimelike-properties"></emu-xref>, except the header row, in table order, do
830767
1. Let _property_ be the Property value of the current row.
831768
1. Let _value_ be ? Get(_temporalTimeLike_, _property_).
832-
1. If _value_ is not *undefined*, then
833-
1. Set _any_ to *true*.
834-
1. Set _value_ to ? ToIntegerThrowOnInfinity(_value_).
835-
1. Set _result_'s internal slot whose name is the Internal Slot value of the current row to _value_.
769+
1. If _value_ is not *undefined*, set _any_ to *true*.
770+
1. If _value_ is not *undefined* or _completeness_ is ~complete~, then
771+
1. Set _value_ to ? ToIntegerThrowOnInfinity(_value_).
772+
1. Set _result_'s internal slot whose name is the Internal Slot value of the current row to _value_.
836773
1. If _any_ is *false*, then
837774
1. Throw a *TypeError* exception.
838775
1. Return _result_.
839776
</emu-alg>
777+
778+
<emu-table id="table-temporal-temporaltimelike-properties">
779+
<emu-caption>Properties of a TemporalTimeLike</emu-caption>
780+
<table class="real-table">
781+
<thead>
782+
<tr>
783+
<th>Internal Slot</th>
784+
<th>Property</th>
785+
</tr>
786+
</thead>
787+
<tbody>
788+
<tr>
789+
<td>[[Hour]]</td>
790+
<td>*"hour"*</td>
791+
</tr>
792+
793+
<tr>
794+
<td>[[Microsecond]]</td>
795+
<td>*"microsecond"*</td>
796+
</tr>
797+
798+
<tr>
799+
<td>[[Millisecond]]</td>
800+
<td>*"millisecond"*</td>
801+
</tr>
802+
803+
<tr>
804+
<td>[[Minute]]</td>
805+
<td>*"minute"*</td>
806+
</tr>
807+
808+
<tr>
809+
<td>[[Nanosecond]]</td>
810+
<td>*"nanosecond"*</td>
811+
</tr>
812+
813+
<tr>
814+
<td>[[Second]]</td>
815+
<td>*"second"*</td>
816+
</tr>
817+
</tbody>
818+
</table>
819+
</emu-table>
840820
</emu-clause>
841821

842822
<emu-clause id="sec-temporal-temporaltimetostring" aoid="TemporalTimeToString">

0 commit comments

Comments
 (0)