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

Normative: Consistently check overflow options #2225

Merged
merged 1 commit into from Jul 1, 2022

Conversation

ptomato
Copy link
Collaborator

@ptomato ptomato commented May 24, 2022

In the fast paths for Temporal objects in ToTemporalDate and
ToTemporalDateTime, the overflow option should be validated (even though
it isn't used.) We do this for property bags and also for the case where
we call Temporal.PlainDate.from(plainDate) and
Temporal.PlainDateTime.from(plainDateTime), so it should be consistent.

The status quo wasn't the result of any decision, it was an oversight.

Closes: #2220

In the fast paths for Temporal objects in ToTemporalDate and
ToTemporalDateTime, the overflow option should be validated (even though
it isn't used.) We do this for property bags and also for the case where
we call Temporal.PlainDate.from(plainDate) and
Temporal.PlainDateTime.from(plainDateTime), so it should be consistent.

The status quo wasn't the result of any decision, it was an oversight.

Closes: #2220
@ptomato ptomato requested a review from Ms2ger May 24, 2022 21:15
@ptomato ptomato marked this pull request as draft May 24, 2022 21:16
@ptomato
Copy link
Collaborator Author

ptomato commented May 24, 2022

Draft until presented at TC39.

@codecov
Copy link

codecov bot commented May 24, 2022

Codecov Report

Merging #2225 (30c3f3f) into main (48cfede) will increase coverage by 9.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2225      +/-   ##
==========================================
+ Coverage   82.10%   91.16%   +9.06%     
==========================================
  Files          17       19       +2     
  Lines       10505    10528      +23     
  Branches     1468     1688     +220     
==========================================
+ Hits         8625     9598     +973     
+ Misses       1838      918     -920     
+ Partials       42       12      -30     
Flag Coverage Δ
test262 83.20% <100.00%> (?)
tests 82.10% <75.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
polyfill/lib/ecmascript.mjs 93.51% <100.00%> (+5.50%) ⬆️
polyfill/lib/legacydate.mjs 0.00% <0.00%> (ø)
polyfill/lib/shim.mjs 68.75% <0.00%> (ø)
polyfill/lib/intl.mjs 100.00% <0.00%> (+1.58%) ⬆️
polyfill/lib/intrinsicclass.mjs 51.35% <0.00%> (+2.70%) ⬆️
polyfill/lib/calendar.mjs 94.39% <0.00%> (+4.88%) ⬆️
polyfill/lib/timezone.mjs 93.63% <0.00%> (+8.28%) ⬆️
polyfill/lib/now.mjs 100.00% <0.00%> (+8.77%) ⬆️
polyfill/lib/duration.mjs 81.93% <0.00%> (+10.79%) ⬆️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 48cfede...30c3f3f. Read the comment docs.

@ptomato ptomato marked this pull request as ready for review July 1, 2022 02:19
ptomato added a commit to ptomato/test262 that referenced this pull request Jul 1, 2022
A normative change that reached consensus at the June 2022 TC39 meeting
was this small change to throw on an invalid value for the overflow option
in PlainDate.from() and PlainDateTime.from(), in the case of a fast-path
conversion.

See tc39/proposal-temporal#2225
@ptomato
Copy link
Collaborator Author

ptomato commented Jul 1, 2022

This gained consensus at the June 2022 TC39 plenary meeting.

Tests are in tc39/test262#3595

@ptomato ptomato merged commit c8ee2bd into main Jul 1, 2022
@ptomato ptomato deleted the 2220-consistently-check-overflow branch July 1, 2022 02:20
Ms2ger pushed a commit to tc39/test262 that referenced this pull request Jul 1, 2022
A normative change that reached consensus at the June 2022 TC39 meeting
was this small change to throw on an invalid value for the overflow option
in PlainDate.from() and PlainDateTime.from(), in the case of a fast-path
conversion.

See tc39/proposal-temporal#2225
pull bot pushed a commit to jamlee-t/v8 that referenced this pull request Aug 30, 2022
tc39/proposal-temporal#2225

Call ToTemporalOverflow in ToTemporalDate and ToTemporalDateTime

Spec Text:
https://tc39.es/proposal-temporal/#sec-temporal-totemporaldate
https://tc39.es/proposal-temporal/#sec-temporal-totemporaldatetime

Bug: v8:11544
Change-Id: I3d2846e2efc214ea5385be58cb49e319369b5900
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3855705
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82797}
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 this pull request may close these issues.

Consistent verification of overflow options?
2 participants