@@ -26,20 +26,20 @@ impl BuiltinIntrinsicConstructor for TemporalPlainTimeConstructor {
2626}
2727
2828impl TemporalPlainTimeConstructor {
29- /// ### [4.1.1 Temporal.PlainTime](https://tc39.es/proposal-temporal/#sec-temporal.plaintime)
29+ /// ### [4.1.1 Temporal.PlainTime ( [ hour [ , minute [ , second [ , millisecond [ , microsecond [ , nanosecond ] ] ] ] ] ] ) ](https://tc39.es/proposal-temporal/#sec-temporal.plaintime)
3030 fn constructor < ' gc > (
3131 agent : & mut Agent ,
3232 _: Value ,
3333 args : ArgumentsList ,
3434 new_target : Option < Object > ,
3535 mut gc : GcScope < ' gc , ' _ > ,
3636 ) -> JsResult < ' gc , Value < ' gc > > {
37- let hours = args. get ( 1 ) . scope ( agent, gc. nogc ( ) ) ;
38- let minutes = args. get ( 2 ) . scope ( agent, gc. nogc ( ) ) ;
39- let seconds = args. get ( 3 ) . scope ( agent, gc. nogc ( ) ) ;
40- let milliseconds = args. get ( 4 ) . scope ( agent, gc. nogc ( ) ) ;
41- let microseconds = args. get ( 5 ) . scope ( agent, gc. nogc ( ) ) ;
42- let nanoseconds = args. get ( 6 ) . scope ( agent, gc. nogc ( ) ) ;
37+ let hour = args. get ( 0 ) . scope ( agent, gc. nogc ( ) ) ;
38+ let minute = args. get ( 1 ) . scope ( agent, gc. nogc ( ) ) ;
39+ let second = args. get ( 2 ) . scope ( agent, gc. nogc ( ) ) ;
40+ let millisecond = args. get ( 3 ) . scope ( agent, gc. nogc ( ) ) ;
41+ let microsecond = args. get ( 4 ) . scope ( agent, gc. nogc ( ) ) ;
42+ let nanosecond = args. get ( 5 ) . scope ( agent, gc. nogc ( ) ) ;
4343
4444 let new_target = new_target. bind ( gc. nogc ( ) ) ;
4545
@@ -58,64 +58,63 @@ impl TemporalPlainTimeConstructor {
5858 let new_target = new_target. scope ( agent, gc. nogc ( ) ) ;
5959
6060 // 2. If hour is undefined, set hour to 0; else set hour to ? ToIntegerWithTruncation(hour).
61- let hour = if hours . get ( agent) . is_undefined ( ) {
61+ let hour = if hour . get ( agent) . is_undefined ( ) {
6262 0
6363 } else {
6464 u8:: try_from (
65- to_integer_with_truncation ( agent, hours . get ( agent) , gc. reborrow ( ) ) . unbind ( ) ?,
65+ to_integer_with_truncation ( agent, hour . get ( agent) , gc. reborrow ( ) ) . unbind ( ) ?,
6666 )
6767 . unwrap_or ( u8:: MAX )
6868 } ;
6969
7070 // 3. If minute is undefined, set minute to 0; else set minute to ? ToIntegerWithTruncation(minute).
71- let minute = if minutes . get ( agent) . is_undefined ( ) {
71+ let minute = if minute . get ( agent) . is_undefined ( ) {
7272 0
7373 } else {
7474 u8:: try_from (
75- to_integer_with_truncation ( agent, minutes . get ( agent) , gc. reborrow ( ) ) . unbind ( ) ?,
75+ to_integer_with_truncation ( agent, minute . get ( agent) , gc. reborrow ( ) ) . unbind ( ) ?,
7676 )
7777 . unwrap_or ( u8:: MAX )
7878 } ;
7979
8080 // 4. If second is undefined, set second to 0; else set second to ? ToIntegerWithTruncation(second).
81- let second = if seconds . get ( agent) . is_undefined ( ) {
81+ let second = if second . get ( agent) . is_undefined ( ) {
8282 0
8383 } else {
8484 u8:: try_from (
85- to_integer_with_truncation ( agent, seconds . get ( agent) , gc. reborrow ( ) ) . unbind ( ) ?,
85+ to_integer_with_truncation ( agent, second . get ( agent) , gc. reborrow ( ) ) . unbind ( ) ?,
8686 )
8787 . unwrap_or ( u8:: MAX )
8888 } ;
8989
9090 // 5. If millisecond is undefined, set millisecond to 0; else set millisecond to ? ToIntegerWithTruncation(millisecond).
91- let millisecond = if milliseconds . get ( agent) . is_undefined ( ) {
91+ let millisecond = if millisecond . get ( agent) . is_undefined ( ) {
9292 0
9393 } else {
9494 u16:: try_from (
95- to_integer_with_truncation ( agent, milliseconds . get ( agent) , gc. reborrow ( ) )
95+ to_integer_with_truncation ( agent, millisecond . get ( agent) , gc. reborrow ( ) )
9696 . unbind ( ) ?,
9797 )
9898 . unwrap_or ( u16:: MAX )
9999 } ;
100100
101101 // 6. If microsecond is undefined, set microsecond to 0; else set microsecond to ? ToIntegerWithTruncation(microsecond).
102- let microsecond = if microseconds . get ( agent) . is_undefined ( ) {
102+ let microsecond = if microsecond . get ( agent) . is_undefined ( ) {
103103 0
104104 } else {
105105 u16:: try_from (
106- to_integer_with_truncation ( agent, microseconds . get ( agent) , gc. reborrow ( ) )
106+ to_integer_with_truncation ( agent, microsecond . get ( agent) , gc. reborrow ( ) )
107107 . unbind ( ) ?,
108108 )
109109 . unwrap_or ( u16:: MAX )
110110 } ;
111111
112112 // 7. If nanosecond is undefined, set nanosecond to 0; else set nanosecond to ? ToIntegerWithTruncation(nanosecond).
113- let nanosecond = if nanoseconds . get ( agent) . is_undefined ( ) {
113+ let nanosecond = if nanosecond . get ( agent) . is_undefined ( ) {
114114 0
115115 } else {
116116 u16:: try_from (
117- to_integer_with_truncation ( agent, nanoseconds. get ( agent) , gc. reborrow ( ) )
118- . unbind ( ) ?,
117+ to_integer_with_truncation ( agent, nanosecond. get ( agent) , gc. reborrow ( ) ) . unbind ( ) ?,
119118 )
120119 . unwrap_or ( u16:: MAX )
121120 } ;
0 commit comments