Skip to content

Commit

Permalink
Polyfill: Eliminate nonconforming toString() call
Browse files Browse the repository at this point in the history
This observable call occurred while building an error message. It
shouldn't be there according to the spec.
  • Loading branch information
ptomato committed Aug 8, 2024
1 parent 4867d9b commit 73e8935
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion polyfill/lib/ecmascript.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,8 @@ export function InterpretISODateTimeOffset(
: typeof timeZoneRec.receiver === 'string'
? timeZoneRec.receiver
: 'time zone';
throw new RangeError(`Offset ${offsetStr} is invalid for ${dt} in ${timeZoneString}`);
const dtStr = TemporalDateTimeToString(dt, 'auto');
throw new RangeError(`Offset ${offsetStr} is invalid for ${dtStr} in ${timeZoneString}`);
}
// fall through: offsetOpt === 'prefer', but the offset doesn't match
// so fall back to use the time zone instead.
Expand Down

0 comments on commit 73e8935

Please sign in to comment.