test262 icon indicating copy to clipboard operation
test262 copied to clipboard

should when no complete records in built-ins/Temporal/PlainDate/prototype/toPlainDateTime/basic.js

Open FrankYFTang opened this issue 4 years ago • 4 comments

I saw a problem with built-ins/Temporal/PlainDate/prototype/toPlainDateTime/basic.js

The folllowing should thorw:

const date = new Temporal.PlainDate(2000, 5, 2);
const optionBag = date.toPlainDateTime({ hour: 11, minute: 30, second: 23 });

because

https://tc39.es/proposal-temporal/#sec-temporal.plaindate.prototype.toplaindatetime 3.3.26 Temporal.PlainDate.prototype.toPlainDateTime ( [ temporalTime ] ) 4. Set temporalTime to ? ToTemporalTime(temporalTime).

https://tc39.es/proposal-temporal/#sec-temporal-totemporaltime 4.5.2 ToTemporalTime ( item [ , overflow ] ) 3-f. Let result be ? ToTemporalTimeRecord(item).

https://tc39.es/proposal-temporal/#sec-temporal-totemporaltimerecord 4.5.9 ToTemporalTimeRecord ( temporalTimeLike ) 3. For each row of Table 3, except the header row, in table order, do a. Let property be the Property value of the current row. b. Let value be ? Get(temporalTimeLike, property). c. If value is undefined, then i. Throw a TypeError exception.

Internal Slot Property
[[Hour]] "hour"
[[Microsecond]] "microsecond"
[[Millisecond]] "millisecond"
[[Minute]] "minute"
[[Nanosecond]] "nanosecond"
[[Second]] "second"

So when 3-a get the second item as "microsecond" b. Let value be ? Get(temporalTimeLike, "microsecond"). will be undefined and throw.

FrankYFTang avatar Oct 08 '21 07:10 FrankYFTang

@Ms2ger @ptomato @jugglinmike @ryzokuken

FrankYFTang avatar Oct 08 '21 07:10 FrankYFTang

This is a mistake in the spec text, I am planning to present this normative change at the next TC39 plenary: https://github.com/tc39/proposal-temporal/pull/1862 Assuming it is accepted, the test will subsequently be correct.

ptomato avatar Oct 08 '21 16:10 ptomato

This is a mistake in the spec text, I am planning to present this normative change at the next TC39 plenary: tc39/proposal-temporal#1862 Assuming it is accepted, the test will subsequently be correct.

oh I see. I just cannot tell what is the intend. If that is the intend, then let me just close the test262 PR.

FrankYFTang avatar Oct 08 '21 16:10 FrankYFTang

I think this can be closed, since the change was incorporated and the test is correct now.

ptomato avatar Jan 20 '22 21:01 ptomato