Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
FrankYFTang opened this issue Oct 8, 2021 · 4 comments

Comments

@FrankYFTang
Copy link
Contributor

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
Copy link
Contributor Author

FrankYFTang added a commit to FrankYFTang/test262 that referenced this issue Oct 8, 2021
@ptomato
Copy link
Contributor

ptomato commented Oct 8, 2021

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.

@FrankYFTang
Copy link
Contributor Author

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.

@ptomato
Copy link
Contributor

ptomato commented Jan 20, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants