Skip to content

Commit

Permalink
Fix debug properties to not call toString()
Browse files Browse the repository at this point in the history
This avoids making an observable call into the type's toString() method in
its constructor. The ZonedDateTime version was additionally missing a
parameter.
  • Loading branch information
ptomato committed Nov 2, 2020
1 parent 2c197e7 commit e5389e2
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion polyfill/lib/calendar.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class Calendar {

if (typeof __debug__ !== 'undefined' && __debug__) {
Object.defineProperty(this, '_repr_', {
value: `${this[Symbol.toStringTag]} <${this}>`,
value: `${this[Symbol.toStringTag]} <${id}>`,
writable: false,
enumerable: false,
configurable: false
Expand Down
2 changes: 1 addition & 1 deletion polyfill/lib/date.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class Date {

if (typeof __debug__ !== 'undefined' && __debug__) {
Object.defineProperty(this, '_repr_', {
value: `${this[Symbol.toStringTag]} <${this}>`,
value: `${this[Symbol.toStringTag]} <${TemporalDateToString(this)}>`,
writable: false,
enumerable: false,
configurable: false
Expand Down
2 changes: 1 addition & 1 deletion polyfill/lib/datetime.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class DateTime {

if (typeof __debug__ !== 'undefined' && __debug__) {
Object.defineProperty(this, '_repr_', {
value: `${this[Symbol.toStringTag]} <${this}>`,
value: `${this[Symbol.toStringTag]} <${DateTimeToString(this, 'auto')}>`,
writable: false,
enumerable: false,
configurable: false
Expand Down
2 changes: 1 addition & 1 deletion polyfill/lib/duration.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class Duration {

if (typeof __debug__ !== 'undefined' && __debug__) {
Object.defineProperty(this, '_repr_', {
value: `${this[Symbol.toStringTag]} <${this}>`,
value: `${this[Symbol.toStringTag]} <${ES.TemporalDurationToString(this)}>`,
writable: false,
enumerable: false,
configurable: false
Expand Down
2 changes: 1 addition & 1 deletion polyfill/lib/monthday.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class MonthDay {

if (typeof __debug__ !== 'undefined' && __debug__) {
Object.defineProperty(this, '_repr_', {
value: `${this[Symbol.toStringTag]} <${this}>`,
value: `${this[Symbol.toStringTag]} <${MonthDayToString(this)}>`,
writable: false,
enumerable: false,
configurable: false
Expand Down
2 changes: 1 addition & 1 deletion polyfill/lib/time.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class Time {

if (typeof __debug__ !== 'undefined' && __debug__) {
Object.defineProperty(this, '_repr_', {
value: `${this[Symbol.toStringTag]} <${this}>`,
value: `${this[Symbol.toStringTag]} <${TemporalTimeToString(this, 'auto')}>`,
writable: false,
enumerable: false,
configurable: false
Expand Down
2 changes: 1 addition & 1 deletion polyfill/lib/timezone.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class TimeZone {

if (typeof __debug__ !== 'undefined' && __debug__) {
Object.defineProperty(this, '_repr_', {
value: `${this[Symbol.toStringTag]} <${this}>`,
value: `${this[Symbol.toStringTag]} <${timeZoneIdentifier}>`,
writable: false,
enumerable: false,
configurable: false
Expand Down
2 changes: 1 addition & 1 deletion polyfill/lib/yearmonth.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class YearMonth {

if (typeof __debug__ !== 'undefined' && __debug__) {
Object.defineProperty(this, '_repr_', {
value: `${this[Symbol.toStringTag]} <${this}>`,
value: `${this[Symbol.toStringTag]} <${YearMonthToString(this)}>`,
writable: false,
enumerable: false,
configurable: false
Expand Down
2 changes: 1 addition & 1 deletion polyfill/lib/zoneddatetime.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class ZonedDateTime {

if (typeof __debug__ !== 'undefined' && __debug__) {
Object.defineProperty(this, '_repr_', {
value: `${this[Symbol.toStringTag]} <${zonedDateTimeToString(this)}>`,
value: `${this[Symbol.toStringTag]} <${zonedDateTimeToString(this, 'auto')}>`,
writable: false,
enumerable: false,
configurable: false
Expand Down

0 comments on commit e5389e2

Please sign in to comment.