@@ -2014,13 +2014,13 @@ export function CalendarEquals(one, two) {
2014
2014
const cal2 = ToTemporalCalendarIdentifier ( two ) ;
2015
2015
return cal1 === cal2 ;
2016
2016
}
2017
+
2017
2018
// This operation is not in the spec, it implements the following:
2018
2019
// "If ? CalendarEquals(one, two) is false, throw a RangeError exception."
2019
2020
// This is so that we can build an informative error message without
2020
2021
// re-getting the .id properties.
2021
-
2022
- export function CalendarEqualsOrThrow ( one , two , errorMessageAction ) {
2023
- if ( one === two ) return true ;
2022
+ export function ThrowIfCalendarsNotEqual ( one , two , errorMessageAction ) {
2023
+ if ( one === two ) return ;
2024
2024
const cal1 = ToTemporalCalendarIdentifier ( one ) ;
2025
2025
const cal2 = ToTemporalCalendarIdentifier ( two ) ;
2026
2026
if ( cal1 !== cal2 ) {
@@ -3985,7 +3985,7 @@ export function DifferenceTemporalPlainDate(operation, plainDate, other, options
3985
3985
other = ToTemporalDate ( other ) ;
3986
3986
const calendar = GetSlot ( plainDate , CALENDAR ) ;
3987
3987
const otherCalendar = GetSlot ( other , CALENDAR ) ;
3988
- CalendarEqualsOrThrow ( calendar , otherCalendar , 'compute difference between dates' ) ;
3988
+ ThrowIfCalendarsNotEqual ( calendar , otherCalendar , 'compute difference between dates' ) ;
3989
3989
3990
3990
const resolvedOptions = ObjectCreate ( null ) ;
3991
3991
CopyDataProperties ( resolvedOptions , GetOptionsObject ( options ) , [ ] ) ;
@@ -4022,7 +4022,7 @@ export function DifferenceTemporalPlainDateTime(operation, plainDateTime, other,
4022
4022
other = ToTemporalDateTime ( other ) ;
4023
4023
const calendar = GetSlot ( plainDateTime , CALENDAR ) ;
4024
4024
const otherCalendar = GetSlot ( other , CALENDAR ) ;
4025
- CalendarEqualsOrThrow ( calendar , otherCalendar , 'compute difference between dates' ) ;
4025
+ ThrowIfCalendarsNotEqual ( calendar , otherCalendar , 'compute difference between dates' ) ;
4026
4026
4027
4027
const resolvedOptions = ObjectCreate ( null ) ;
4028
4028
CopyDataProperties ( resolvedOptions , GetOptionsObject ( options ) , [ ] ) ;
@@ -4163,7 +4163,7 @@ export function DifferenceTemporalPlainYearMonth(operation, yearMonth, other, op
4163
4163
other = ToTemporalYearMonth ( other ) ;
4164
4164
const calendar = GetSlot ( yearMonth , CALENDAR ) ;
4165
4165
const otherCalendar = GetSlot ( other , CALENDAR ) ;
4166
- CalendarEqualsOrThrow ( calendar , otherCalendar , 'compute difference between months' ) ;
4166
+ ThrowIfCalendarsNotEqual ( calendar , otherCalendar , 'compute difference between months' ) ;
4167
4167
4168
4168
const resolvedOptions = ObjectCreate ( null ) ;
4169
4169
CopyDataProperties ( resolvedOptions , GetOptionsObject ( options ) , [ ] ) ;
@@ -4208,7 +4208,7 @@ export function DifferenceTemporalZonedDateTime(operation, zonedDateTime, other,
4208
4208
other = ToTemporalZonedDateTime ( other ) ;
4209
4209
const calendar = GetSlot ( zonedDateTime , CALENDAR ) ;
4210
4210
const otherCalendar = GetSlot ( other , CALENDAR ) ;
4211
- CalendarEqualsOrThrow ( calendar , otherCalendar , 'compute difference between dates' ) ;
4211
+ ThrowIfCalendarsNotEqual ( calendar , otherCalendar , 'compute difference between dates' ) ;
4212
4212
4213
4213
const resolvedOptions = ObjectCreate ( null ) ;
4214
4214
CopyDataProperties ( resolvedOptions , GetOptionsObject ( options ) , [ ] ) ;
0 commit comments