Skip to content

Commit 07ea694

Browse files
authored
Fix usage of ES.CalendarEquals (#75)
Port of tc39/proposal-temporal#1858
1 parent ff93778 commit 07ea694

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

lib/plaindate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ export class PlainDate implements Temporal.PlainDate {
268268
const val2 = GetSlot(other, slot);
269269
if (val1 !== val2) return false;
270270
}
271-
return ES.CalendarEquals(this, other);
271+
return ES.CalendarEquals(GetSlot(this, CALENDAR), GetSlot(other, CALENDAR));
272272
}
273273
toString(options = undefined) {
274274
if (!ES.IsTemporalDate(this)) throw new TypeError('invalid receiver');

lib/plaindatetime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ export class PlainDateTime implements Temporal.PlainDateTime {
594594
const val2 = GetSlot(other, slot);
595595
if (val1 !== val2) return false;
596596
}
597-
return ES.CalendarEquals(this, other);
597+
return ES.CalendarEquals(GetSlot(this, CALENDAR), GetSlot(other, CALENDAR));
598598
}
599599
toString(options = undefined) {
600600
if (!ES.IsTemporalDateTime(this)) throw new TypeError('invalid receiver');

lib/plainmonthday.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class PlainMonthDay implements Temporal.PlainMonthDay {
7373
const val2 = GetSlot(other, slot);
7474
if (val1 !== val2) return false;
7575
}
76-
return ES.CalendarEquals(this, other);
76+
return ES.CalendarEquals(GetSlot(this, CALENDAR), GetSlot(other, CALENDAR));
7777
}
7878
toString(options = undefined) {
7979
if (!ES.IsTemporalMonthDay(this)) throw new TypeError('invalid receiver');

lib/plainyearmonth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ export class PlainYearMonth implements Temporal.PlainYearMonth {
278278
const val2 = GetSlot(other, slot);
279279
if (val1 !== val2) return false;
280280
}
281-
return ES.CalendarEquals(this, other);
281+
return ES.CalendarEquals(GetSlot(this, CALENDAR), GetSlot(other, CALENDAR));
282282
}
283283
toString(options = undefined) {
284284
if (!ES.IsTemporalYearMonth(this)) throw new TypeError('invalid receiver');

0 commit comments

Comments
 (0)