Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ export class Calendar implements Temporal.Calendar {
static from(item: Params['from'][0]): Return['from'] {
return ES.ToTemporalCalendar(item);
}
[Symbol.toStringTag]!: 'Temporal.Calendar';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the reason we originally added this assertion (see #53 (comment)) not apply anymore? Does TS now emit [Symbol.toStringTag] even without the ! assertion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this is not actually a non-null assertion, it's a "definite assignment assertion" that means that this field will be initialized by non-constructor code.

[Symbol.toStringTag]: 'Temporal.Calendar';
}

MakeIntrinsicClass(Calendar, 'Temporal.Calendar');
Expand Down
2 changes: 1 addition & 1 deletion lib/duration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ export class Duration implements Temporal.Duration {
const totalNs2 = ES.TotalDurationNanoseconds(d2, h2, min2, s2, ms2, µs2, ns2, shift2);
return ES.ComparisonResult(JSBI.toNumber(JSBI.subtract(totalNs1, totalNs2)));
}
[Symbol.toStringTag]!: 'Temporal.Duration';
[Symbol.toStringTag]: 'Temporal.Duration';
}

MakeIntrinsicClass(Duration, 'Temporal.Duration');
2 changes: 1 addition & 1 deletion lib/instant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class Instant implements Temporal.Instant {
if (JSBI.greaterThan(oneNs, twoNs)) return 1;
return 0;
}
[Symbol.toStringTag]!: 'Temporal.Instant';
[Symbol.toStringTag]: 'Temporal.Instant';
}

MakeIntrinsicClass(Instant, 'Temporal.Instant');
2 changes: 1 addition & 1 deletion lib/plaindate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export class PlainDate implements Temporal.PlainDate {
GetSlot(two, ISO_DAY)
);
}
[Symbol.toStringTag]!: 'Temporal.PlainDate';
[Symbol.toStringTag]: 'Temporal.PlainDate';
}

MakeIntrinsicClass(PlainDate, 'Temporal.PlainDate');
2 changes: 1 addition & 1 deletion lib/plaindatetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ export class PlainDateTime implements Temporal.PlainDateTime {
}
return 0;
}
[Symbol.toStringTag]!: 'Temporal.PlainDateTime';
[Symbol.toStringTag]: 'Temporal.PlainDateTime';
}

MakeIntrinsicClass(PlainDateTime, 'Temporal.PlainDateTime');
2 changes: 1 addition & 1 deletion lib/plainmonthday.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class PlainMonthDay implements Temporal.PlainMonthDay {
}
return ES.ToTemporalMonthDay(item, options);
}
[Symbol.toStringTag]!: 'Temporal.PlainMonthDay';
[Symbol.toStringTag]: 'Temporal.PlainMonthDay';
}

MakeIntrinsicClass(PlainMonthDay, 'Temporal.PlainMonthDay');
2 changes: 1 addition & 1 deletion lib/plaintime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ export class PlainTime implements Temporal.PlainTime {
}
return 0;
}
[Symbol.toStringTag]!: 'Temporal.PlainTime';
[Symbol.toStringTag]: 'Temporal.PlainTime';
}

MakeIntrinsicClass(PlainTime, 'Temporal.PlainTime');
2 changes: 1 addition & 1 deletion lib/plainyearmonth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export class PlainYearMonth implements Temporal.PlainYearMonth {
GetSlot(two, ISO_DAY)
);
}
[Symbol.toStringTag]!: 'Temporal.PlainYearMonth';
[Symbol.toStringTag]: 'Temporal.PlainYearMonth';
}

MakeIntrinsicClass(PlainYearMonth, 'Temporal.PlainYearMonth');
2 changes: 1 addition & 1 deletion lib/timezone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export class TimeZone implements Temporal.TimeZone {
static from(item: Params['from'][0]): Return['from'] {
return ES.ToTemporalTimeZone(item);
}
[Symbol.toStringTag]!: 'Temporal.TimeZone';
[Symbol.toStringTag]: 'Temporal.TimeZone';
}

MakeIntrinsicClass(TimeZone, 'Temporal.TimeZone');
2 changes: 1 addition & 1 deletion lib/zoneddatetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ export class ZonedDateTime implements Temporal.ZonedDateTime {
if (JSBI.greaterThan(JSBI.BigInt(ns1), JSBI.BigInt(ns2))) return 1;
return 0;
}
[Symbol.toStringTag]!: 'Temporal.ZonedDateTime';
[Symbol.toStringTag]: 'Temporal.ZonedDateTime';
}

MakeIntrinsicClass(ZonedDateTime, 'Temporal.ZonedDateTime');
Expand Down