Skip to content

Commit

Permalink
Normative: Change Calendar.prototype.toJSON not to call toString
Browse files Browse the repository at this point in the history
The toJSON method should return the value in the internal slot, instead of
making an observable call to toString.

See: #1808

UPSTREAM_COMMIT=9199c05fdd58ddf45a03211396762e57da4fe6bc
  • Loading branch information
ptomato authored and justingrant committed Apr 20, 2023
1 parent 3d6ff58 commit 5c38264
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion polyfill/lib/calendar.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export class Calendar {
}
toJSON() {
if (!ES.IsTemporalCalendar(this)) throw new TypeError('invalid receiver');
return ES.ToString(this);
return GetSlot(this, CALENDAR_ID);
}
static from(item) {
const calendarSlotValue = ES.ToTemporalCalendarSlotValue(item);
Expand Down

0 comments on commit 5c38264

Please sign in to comment.