@@ -32616,8 +32616,10 @@ <h1>Date.prototype.getUTCSeconds ( )</h1>
32616
32616
<h1>Date.prototype.setDate ( _date_ )</h1>
32617
32617
<p>The following steps are performed:</p>
32618
32618
<emu-alg>
32619
- 1. Let _t_ be LocalTime( ? thisTimeValue(*this* value) ).
32619
+ 1. Let _t_ be ? thisTimeValue(*this* value).
32620
32620
1. Let _dt_ be ? ToNumber(_date_).
32621
+ 1. If _t_ is *NaN*, return *NaN*.
32622
+ 1. Set _t_ to LocalTime(_t_).
32621
32623
1. Let _newDate_ be MakeDate(MakeDay(YearFromTime(_t_), MonthFromTime(_t_), _dt_), TimeWithinDay(_t_)).
32622
32624
1. Let _u_ be TimeClip(UTC(_newDate_)).
32623
32625
1. Set the [[DateValue]] internal slot of this Date object to _u_.
@@ -32630,8 +32632,8 @@ <h1>Date.prototype.setFullYear ( _year_ [ , _month_ [ , _date_ ] ] )</h1>
32630
32632
<p>The following steps are performed:</p>
32631
32633
<emu-alg>
32632
32634
1. Let _t_ be ? thisTimeValue(*this* value).
32633
- 1. If _t_ is *NaN*, set _t_ to *+0*<sub>𝔽</sub>; otherwise, set _t_ to LocalTime(_t_).
32634
32635
1. Let _y_ be ? ToNumber(_year_).
32636
+ 1. If _t_ is *NaN*, set _t_ to *+0*<sub>𝔽</sub>; otherwise, set _t_ to LocalTime(_t_).
32635
32637
1. If _month_ is not present, let _m_ be MonthFromTime(_t_); otherwise, let _m_ be ? ToNumber(_month_).
32636
32638
1. If _date_ is not present, let _dt_ be DateFromTime(_t_); otherwise, let _dt_ be ? ToNumber(_date_).
32637
32639
1. Let _newDate_ be MakeDate(MakeDay(_y_, _m_, _dt_), TimeWithinDay(_t_)).
@@ -32649,11 +32651,16 @@ <h1>Date.prototype.setFullYear ( _year_ [ , _month_ [ , _date_ ] ] )</h1>
32649
32651
<h1>Date.prototype.setHours ( _hour_ [ , _min_ [ , _sec_ [ , _ms_ ] ] ] )</h1>
32650
32652
<p>The following steps are performed:</p>
32651
32653
<emu-alg>
32652
- 1. Let _t_ be LocalTime( ? thisTimeValue(*this* value) ).
32654
+ 1. Let _t_ be ? thisTimeValue(*this* value).
32653
32655
1. Let _h_ be ? ToNumber(_hour_).
32654
- 1. If _min_ is not present, let _m_ be MinFromTime(_t_); otherwise, let _m_ be ? ToNumber(_min_).
32655
- 1. If _sec_ is not present, let _s_ be SecFromTime(_t_); otherwise, let _s_ be ? ToNumber(_sec_).
32656
- 1. If _ms_ is not present, let _milli_ be msFromTime(_t_); otherwise, let _milli_ be ? ToNumber(_ms_).
32656
+ 1. If _min_ is present, let _m_ be ? ToNumber(_min_).
32657
+ 1. If _sec_ is present, let _s_ be ? ToNumber(_sec_).
32658
+ 1. If _ms_ is present, let _milli_ be ? ToNumber(_ms_).
32659
+ 1. If _t_ is *NaN*, return *NaN*.
32660
+ 1. Set _t_ to LocalTime(_t_).
32661
+ 1. If _min_ is not present, let _m_ be MinFromTime(_t_).
32662
+ 1. If _sec_ is not present, let _s_ be SecFromTime(_t_).
32663
+ 1. If _ms_ is not present, let _milli_ be msFromTime(_t_).
32657
32664
1. Let _date_ be MakeDate(Day(_t_), MakeTime(_h_, _m_, _s_, _milli_)).
32658
32665
1. Let _u_ be TimeClip(UTC(_date_)).
32659
32666
1. Set the [[DateValue]] internal slot of this Date object to _u_.
@@ -32669,8 +32676,10 @@ <h1>Date.prototype.setHours ( _hour_ [ , _min_ [ , _sec_ [ , _ms_ ] ] ] )</h1>
32669
32676
<h1>Date.prototype.setMilliseconds ( _ms_ )</h1>
32670
32677
<p>The following steps are performed:</p>
32671
32678
<emu-alg>
32672
- 1. Let _t_ be LocalTime( ? thisTimeValue(*this* value) ).
32679
+ 1. Let _t_ be ? thisTimeValue(*this* value).
32673
32680
1. Set _ms_ to ? ToNumber(_ms_).
32681
+ 1. If _t_ is *NaN*, return *NaN*.
32682
+ 1. Set _t_ to LocalTime(_t_).
32674
32683
1. Let _time_ be MakeTime(HourFromTime(_t_), MinFromTime(_t_), SecFromTime(_t_), _ms_).
32675
32684
1. Let _u_ be TimeClip(UTC(MakeDate(Day(_t_), _time_))).
32676
32685
1. Set the [[DateValue]] internal slot of this Date object to _u_.
@@ -32682,10 +32691,14 @@ <h1>Date.prototype.setMilliseconds ( _ms_ )</h1>
32682
32691
<h1>Date.prototype.setMinutes ( _min_ [ , _sec_ [ , _ms_ ] ] )</h1>
32683
32692
<p>The following steps are performed:</p>
32684
32693
<emu-alg>
32685
- 1. Let _t_ be LocalTime( ? thisTimeValue(*this* value) ).
32694
+ 1. Let _t_ be ? thisTimeValue(*this* value).
32686
32695
1. Let _m_ be ? ToNumber(_min_).
32687
- 1. If _sec_ is not present, let _s_ be SecFromTime(_t_); otherwise, let _s_ be ? ToNumber(_sec_).
32688
- 1. If _ms_ is not present, let _milli_ be msFromTime(_t_); otherwise, let _milli_ be ? ToNumber(_ms_).
32696
+ 1. If _sec_ is present, let _s_ be ? ToNumber(_sec_).
32697
+ 1. If _ms_ is present, let _milli_ be ? ToNumber(_ms_).
32698
+ 1. If _t_ is *NaN*, return *NaN*.
32699
+ 1. Set _t_ to LocalTime(_t_).
32700
+ 1. If _sec_ is not present, let _s_ be SecFromTime(_t_).
32701
+ 1. If _ms_ is not present, let _milli_ be msFromTime(_t_).
32689
32702
1. Let _date_ be MakeDate(Day(_t_), MakeTime(HourFromTime(_t_), _m_, _s_, _milli_)).
32690
32703
1. Let _u_ be TimeClip(UTC(_date_)).
32691
32704
1. Set the [[DateValue]] internal slot of this Date object to _u_.
@@ -32701,9 +32714,12 @@ <h1>Date.prototype.setMinutes ( _min_ [ , _sec_ [ , _ms_ ] ] )</h1>
32701
32714
<h1>Date.prototype.setMonth ( _month_ [ , _date_ ] )</h1>
32702
32715
<p>The following steps are performed:</p>
32703
32716
<emu-alg>
32704
- 1. Let _t_ be LocalTime( ? thisTimeValue(*this* value) ).
32717
+ 1. Let _t_ be ? thisTimeValue(*this* value).
32705
32718
1. Let _m_ be ? ToNumber(_month_).
32706
- 1. If _date_ is not present, let _dt_ be DateFromTime(_t_); otherwise, let _dt_ be ? ToNumber(_date_).
32719
+ 1. If _date_ is present, let _dt_ be ? ToNumber(_date_).
32720
+ 1. If _t_ is *NaN*, return *NaN*.
32721
+ 1. Set _t_ to LocalTime(_t_).
32722
+ 1. If _date_ is not present, let _dt_ be DateFromTime(_t_).
32707
32723
1. Let _newDate_ be MakeDate(MakeDay(YearFromTime(_t_), _m_, _dt_), TimeWithinDay(_t_)).
32708
32724
1. Let _u_ be TimeClip(UTC(_newDate_)).
32709
32725
1. Set the [[DateValue]] internal slot of this Date object to _u_.
@@ -32719,9 +32735,12 @@ <h1>Date.prototype.setMonth ( _month_ [ , _date_ ] )</h1>
32719
32735
<h1>Date.prototype.setSeconds ( _sec_ [ , _ms_ ] )</h1>
32720
32736
<p>The following steps are performed:</p>
32721
32737
<emu-alg>
32722
- 1. Let _t_ be LocalTime( ? thisTimeValue(*this* value) ).
32738
+ 1. Let _t_ be ? thisTimeValue(*this* value).
32723
32739
1. Let _s_ be ? ToNumber(_sec_).
32724
- 1. If _ms_ is not present, let _milli_ be msFromTime(_t_); otherwise, let _milli_ be ? ToNumber(_ms_).
32740
+ 1. If _ms_ is present, let _milli_ be ? ToNumber(_ms_).
32741
+ 1. If _t_ is *NaN*, return *NaN*.
32742
+ 1. Set _t_ to LocalTime(_t_).
32743
+ 1. If _ms_ is not present, let _milli_ be msFromTime(_t_).
32725
32744
1. Let _date_ be MakeDate(Day(_t_), MakeTime(HourFromTime(_t_), MinFromTime(_t_), _s_, _milli_)).
32726
32745
1. Let _u_ be TimeClip(UTC(_date_)).
32727
32746
1. Set the [[DateValue]] internal slot of this Date object to _u_.
@@ -32751,6 +32770,7 @@ <h1>Date.prototype.setUTCDate ( _date_ )</h1>
32751
32770
<emu-alg>
32752
32771
1. Let _t_ be ? thisTimeValue(*this* value).
32753
32772
1. Let _dt_ be ? ToNumber(_date_).
32773
+ 1. If _t_ is *NaN*, return *NaN*.
32754
32774
1. Let _newDate_ be MakeDate(MakeDay(YearFromTime(_t_), MonthFromTime(_t_), _dt_), TimeWithinDay(_t_)).
32755
32775
1. Let _v_ be TimeClip(_newDate_).
32756
32776
1. Set the [[DateValue]] internal slot of this Date object to _v_.
@@ -32784,11 +32804,15 @@ <h1>Date.prototype.setUTCHours ( _hour_ [ , _min_ [ , _sec_ [ , _ms_ ] ] ] )</h1
32784
32804
<emu-alg>
32785
32805
1. Let _t_ be ? thisTimeValue(*this* value).
32786
32806
1. Let _h_ be ? ToNumber(_hour_).
32787
- 1. If _min_ is not present, let _m_ be MinFromTime(_t_); otherwise, let _m_ be ? ToNumber(_min_).
32788
- 1. If _sec_ is not present, let _s_ be SecFromTime(_t_); otherwise, let _s_ be ? ToNumber(_sec_).
32789
- 1. If _ms_ is not present, let _milli_ be msFromTime(_t_); otherwise, let _milli_ be ? ToNumber(_ms_).
32790
- 1. Let _newDate_ be MakeDate(Day(_t_), MakeTime(_h_, _m_, _s_, _milli_)).
32791
- 1. Let _v_ be TimeClip(_newDate_).
32807
+ 1. If _min_ is present, let _m_ be ? ToNumber(_min_).
32808
+ 1. If _sec_ is present, let _s_ be ? ToNumber(_sec_).
32809
+ 1. If _ms_ is present, let _milli_ be ? ToNumber(_ms_).
32810
+ 1. If _t_ is *NaN*, return *NaN*.
32811
+ 1. If _min_ is not present, let _m_ be MinFromTime(_t_).
32812
+ 1. If _sec_ is not present, let _s_ be SecFromTime(_t_).
32813
+ 1. If _ms_ is not present, let _milli_ be msFromTime(_t_).
32814
+ 1. Let _date_ be MakeDate(Day(_t_), MakeTime(_h_, _m_, _s_, _milli_)).
32815
+ 1. Let _v_ be TimeClip(_date_).
32792
32816
1. Set the [[DateValue]] internal slot of this Date object to _v_.
32793
32817
1. Return _v_.
32794
32818
</emu-alg>
@@ -32803,8 +32827,9 @@ <h1>Date.prototype.setUTCMilliseconds ( _ms_ )</h1>
32803
32827
<p>The following steps are performed:</p>
32804
32828
<emu-alg>
32805
32829
1. Let _t_ be ? thisTimeValue(*this* value).
32806
- 1. Let _milli_ be ? ToNumber(_ms_).
32807
- 1. Let _time_ be MakeTime(HourFromTime(_t_), MinFromTime(_t_), SecFromTime(_t_), _milli_).
32830
+ 1. Set _ms_ to ? ToNumber(_ms_).
32831
+ 1. If _t_ is *NaN*, return *NaN*.
32832
+ 1. Let _time_ be MakeTime(HourFromTime(_t_), MinFromTime(_t_), SecFromTime(_t_), _ms_).
32808
32833
1. Let _v_ be TimeClip(MakeDate(Day(_t_), _time_)).
32809
32834
1. Set the [[DateValue]] internal slot of this Date object to _v_.
32810
32835
1. Return _v_.
@@ -32817,12 +32842,11 @@ <h1>Date.prototype.setUTCMinutes ( _min_ [ , _sec_ [ , _ms_ ] ] )</h1>
32817
32842
<emu-alg>
32818
32843
1. Let _t_ be ? thisTimeValue(*this* value).
32819
32844
1. Let _m_ be ? ToNumber(_min_).
32845
+ 1. If _sec_ is present, let _s_ be ? ToNumber(_sec_).
32846
+ 1. If _ms_ is present, let _milli_ be ? ToNumber(_ms_).
32847
+ 1. If _t_ is *NaN*, return *NaN*.
32820
32848
1. If _sec_ is not present, let _s_ be SecFromTime(_t_).
32821
- 1. Else,
32822
- 1. Let _s_ be ? ToNumber(_sec_).
32823
32849
1. If _ms_ is not present, let _milli_ be msFromTime(_t_).
32824
- 1. Else,
32825
- 1. Let _milli_ be ? ToNumber(_ms_).
32826
32850
1. Let _date_ be MakeDate(Day(_t_), MakeTime(HourFromTime(_t_), _m_, _s_, _milli_)).
32827
32851
1. Let _v_ be TimeClip(_date_).
32828
32852
1. Set the [[DateValue]] internal slot of this Date object to _v_.
@@ -32840,9 +32864,9 @@ <h1>Date.prototype.setUTCMonth ( _month_ [ , _date_ ] )</h1>
32840
32864
<emu-alg>
32841
32865
1. Let _t_ be ? thisTimeValue(*this* value).
32842
32866
1. Let _m_ be ? ToNumber(_month_).
32867
+ 1. If _date_ is present, let _dt_ be ? ToNumber(_date_).
32868
+ 1. If _t_ is *NaN*, return *NaN*.
32843
32869
1. If _date_ is not present, let _dt_ be DateFromTime(_t_).
32844
- 1. Else,
32845
- 1. Let _dt_ be ? ToNumber(_date_).
32846
32870
1. Let _newDate_ be MakeDate(MakeDay(YearFromTime(_t_), _m_, _dt_), TimeWithinDay(_t_)).
32847
32871
1. Let _v_ be TimeClip(_newDate_).
32848
32872
1. Set the [[DateValue]] internal slot of this Date object to _v_.
@@ -32860,9 +32884,9 @@ <h1>Date.prototype.setUTCSeconds ( _sec_ [ , _ms_ ] )</h1>
32860
32884
<emu-alg>
32861
32885
1. Let _t_ be ? thisTimeValue(*this* value).
32862
32886
1. Let _s_ be ? ToNumber(_sec_).
32887
+ 1. If _ms_ is present, let _milli_ be ? ToNumber(_ms_).
32888
+ 1. If _t_ is *NaN*, return *NaN*.
32863
32889
1. If _ms_ is not present, let _milli_ be msFromTime(_t_).
32864
- 1. Else,
32865
- 1. Let _milli_ be ? ToNumber(_ms_).
32866
32890
1. Let _date_ be MakeDate(Day(_t_), MakeTime(HourFromTime(_t_), MinFromTime(_t_), _s_, _milli_)).
32867
32891
1. Let _v_ be TimeClip(_date_).
32868
32892
1. Set the [[DateValue]] internal slot of this Date object to _v_.
@@ -47125,8 +47149,8 @@ <h1>Date.prototype.setYear ( _year_ )</h1>
47125
47149
<p>When the `setYear` method is called with one argument _year_, the following steps are taken:</p>
47126
47150
<emu-alg>
47127
47151
1. Let _t_ be ? thisTimeValue(*this* value).
47128
- 1. If _t_ is *NaN*, set _t_ to *+0*<sub>𝔽</sub>; otherwise, set _t_ to LocalTime(_t_).
47129
47152
1. Let _y_ be ? ToNumber(_year_).
47153
+ 1. If _t_ is *NaN*, set _t_ to *+0*<sub>𝔽</sub>; otherwise, set _t_ to LocalTime(_t_).
47130
47154
1. If _y_ is *NaN*, then
47131
47155
1. Set the [[DateValue]] internal slot of this Date object to *NaN*.
47132
47156
1. Return *NaN*.
0 commit comments