-
Notifications
You must be signed in to change notification settings - Fork 149
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
Review MakeDay/MakeDate/TimeFromYear callers for possibly out-of-range values #2315
Milestone
Comments
ptomato
added
spec-text
Specification text involved
normative
Would be a normative change to the proposal
labels
Jun 20, 2022
From the duplicate #2396, this is one code sample that would have MakeDay return NaN: var cal = new Temporal.Calendar("iso8601");
var date = new Temporal.PlainDate(1970, 1, 1);
var maxValue = new Temporal.Duration(Number.MAX_VALUE, Number.MAX_VALUE);
cal.dateAdd(date, maxValue) This ends up calling MakeDay(𝔽(ℝ(Number.MAX_VALUE) + 1970), 0, 1) in AddISODate → BalanceISODate, and that year value is not finite. |
Closed by #2518. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From #1502:
There are multiple
MakeDay
,MakeDate
, andTimeFromYear
callers which simply assert the returned value is finite, but this may not be true in practice. For example consider calling GetEpochFromISOParts withGetEpochFromISOParts(Number.MAX_VALUE, 1, 1, 0, 0, 0, 0, 0, 0)
.Also see: tc39/ecma262#1087 and tc39/ecma262#1564
The text was updated successfully, but these errors were encountered: