Skip to content

Commit f62e737

Browse files
ptomatoMs2ger
authored andcommitted
Editorial: Remove ISODaysInYear
ECMA-262 already has DaysInYear equation. We should not have days-in-year logic duplicated in the spec.
1 parent 76452d2 commit f62e737

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

spec/calendar.html

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -452,16 +452,6 @@ <h1>IsISOLeapYear ( _year_ )</h1>
452452
</emu-alg>
453453
</emu-clause>
454454

455-
<emu-clause id="sec-temporal-isodaysinyear" aoid="ISODaysInYear">
456-
<h1>ISODaysInYear ( _year_ )</h1>
457-
<emu-alg>
458-
1. Assert: _year_ is an integer.
459-
1. If ! IsISOLeapYear(_year_) is *true*, then
460-
1. Return 366.
461-
1. Return 365.
462-
</emu-alg>
463-
</emu-clause>
464-
465455
<emu-clause id="sec-temporal-isodaysinmonth" aoid="ISODaysInMonth">
466456
<h1>ISODaysInMonth ( _year_, _month_ )</h1>
467457
<emu-alg>
@@ -1089,7 +1079,7 @@ <h1>Temporal.Calendar.prototype.daysInYear ( _temporalDateLike_ )</h1>
10891079
1. Assert: _calendar_.[[Identifier]] is *"iso8601"*.
10901080
1. If Type(_temporalDateLike_) is not Object or _temporalDateLike_ does not have an [[InitializedTemporalDate]], [[InitializedTemporalDateTime]] or [[InitializedTemporalYearMonth]] internal slot, then
10911081
1. Set _temporalDateLike_ to ? ToTemporalDate(_temporalDateLike_).
1092-
1. Return 𝔽(! ISODaysInYear(_temporalDateLike_.[[ISOYear]])).
1082+
1. Return DaysInYear(𝔽(_temporalDateLike_.[[ISOYear]])).
10931083
</emu-alg>
10941084
</emu-clause>
10951085

spec/intl.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,9 +1949,8 @@ <h1>Temporal.Calendar.prototype.daysInYear ( _temporalDateLike_ )</h1>
19491949
1. If Type(_temporalDateLike_) is not Object or _temporalDateLike_ does not have an [[InitializedTemporalDate]], [[InitializedTemporalDateTime]], or [[InitializedTemporalYearMonth]] internal slot, then
19501950
1. Set _temporalDateLike_ to ? ToTemporalDate(_temporalDateLike_).
19511951
1. If _calendar_.[[Identifier]] is *"iso8601"*, then
1952-
1. Let _daysInYear_ be ! ISODaysInYear(_temporalDateLike_.[[ISOYear]]).
1953-
1. Else,
1954-
1. Let _daysInYear_ be ! CalendarDateDaysInYear(_calendar_.[[Identifier]], _temporalDateLike_).
1952+
1. Return DaysInYear(𝔽(_temporalDateLike_.[[ISOYear]])).
1953+
1. Let _daysInYear_ be ! CalendarDateDaysInYear(_calendar_.[[Identifier]], _temporalDateLike_).
19551954
1. Return 𝔽(_daysInYear_).
19561955
</emu-alg>
19571956
</emu-clause>

0 commit comments

Comments
 (0)