Skip to content

Commit ec2b054

Browse files
ptomato12wrigja
authored andcommitted
Fix nonconformance bug with ZonedDateTime.withPlainTime
Previously, zdt.withPlainTime(null) would default to midnight. According to the spec text, it should throw a TypeError. Test262 tests for this are in review. UPSTREAM_COMMIT=07729749f08c4a5c89af283f7a059fb69e37bd41
1 parent 9992f9b commit ec2b054

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/zoneddatetime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export class ZonedDateTime implements Temporal.ZonedDateTime {
290290
if (!ES.IsTemporalZonedDateTime(this)) throw new TypeError('invalid receiver');
291291

292292
const PlainTime = GetIntrinsic('%Temporal.PlainTime%');
293-
const temporalTime = temporalTimeParam == undefined ? new PlainTime() : ES.ToTemporalTime(temporalTimeParam);
293+
const temporalTime = temporalTimeParam === undefined ? new PlainTime() : ES.ToTemporalTime(temporalTimeParam);
294294

295295
const thisDt = dateTime(this);
296296
const year = GetSlot(thisDt, ISO_YEAR);

0 commit comments

Comments
 (0)