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

Consume iterables where possible #1489

Merged
merged 6 commits into from
Apr 17, 2021
Merged

Consume iterables where possible #1489

merged 6 commits into from
Apr 17, 2021

Conversation

ptomato
Copy link
Collaborator

@ptomato ptomato commented Apr 16, 2021

Closes: #1427

@ptomato ptomato requested review from Ms2ger and cjtenny April 16, 2021 01:26
@codecov
Copy link

codecov bot commented Apr 16, 2021

Codecov Report

Merging #1489 (cb89f42) into main (cde67eb) will decrease coverage by 34.64%.
The diff coverage is 91.66%.

❗ Current head cb89f42 differs from pull request most recent head df98a24. Consider uploading reports for the commit df98a24 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1489       +/-   ##
===========================================
- Coverage   95.30%   60.65%   -34.65%     
===========================================
  Files          19       18        -1     
  Lines       11089     4796     -6293     
  Branches     1733     1045      -688     
===========================================
- Hits        10568     2909     -7659     
- Misses        517     1411      +894     
- Partials        4      476      +472     
Flag Coverage Δ
test262 60.65% <91.66%> (+2.44%) ⬆️
tests ?

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

Impacted Files Coverage Δ
polyfill/lib/ecmascript.mjs 68.16% <88.88%> (-26.46%) ⬇️
polyfill/lib/calendar.mjs 19.80% <100.00%> (-74.64%) ⬇️
polyfill/lib/intl.mjs 61.95% <0.00%> (-38.05%) ⬇️
polyfill/lib/zoneddatetime.mjs 65.78% <0.00%> (-32.87%) ⬇️
polyfill/lib/plainyearmonth.mjs 68.44% <0.00%> (-28.12%) ⬇️
polyfill/lib/plainmonthday.mjs 65.82% <0.00%> (-27.19%) ⬇️
polyfill/lib/plaindate.mjs 70.47% <0.00%> (-26.71%) ⬇️
polyfill/lib/plaindatetime.mjs 72.69% <0.00%> (-22.93%) ⬇️
... and 9 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 cde67eb...df98a24. Read the comment docs.

@ptomato ptomato force-pushed the 1427-consume-iterables branch from dc01560 to bbffad0 Compare April 16, 2021 01:36
spec/calendar.html Outdated Show resolved Hide resolved
spec/timezone.html Outdated Show resolved Hide resolved
@ptomato ptomato force-pushed the 1427-consume-iterables branch from bbffad0 to e98860c Compare April 16, 2021 18:30
In ToTemporalDateTime and ToTemporalZonedDateTime, the polyfill did not
match the spec text. The list of fields in the spec text includes the time
field names.

(This will be tested in a following commit.)
@ptomato ptomato force-pushed the 1427-consume-iterables branch from e98860c to db66dea Compare April 16, 2021 18:40
spec/abstractops.html Outdated Show resolved Hide resolved
spec/abstractops.html Outdated Show resolved Hide resolved
spec/timezone.html Outdated Show resolved Hide resolved
Copy link
Collaborator

@cjtenny cjtenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me. Pending addressing Jordan's & Kevin's suggestions, ship it. Only comments are for some #1398 additions.

polyfill/lib/ecmascript.mjs Show resolved Hide resolved
polyfill/test/helpers/temporalHelpers.js Show resolved Hide resolved
spec/timezone.html Outdated Show resolved Hide resolved
@ptomato ptomato force-pushed the 1427-consume-iterables branch from db66dea to 0f61f20 Compare April 16, 2021 19:40
ptomato added 5 commits April 16, 2021 14:44
The fields() methods of the built-in Temporal calendars will only ever
return arrays, but this allows custom calendars to return an iterable
(such as a Set.)

See: #1427
Temporal will only ever call the fields() method with an array, but other
callers may want to supply a different iterable (such as a Set).

See: #1427
This is a bug in both the polyfill and the spec text, that is exposed by
the tests added in the following commit.
The getPossibleInstantsFor() methods of the built-in Temporal time zones
will only ever return arrays, but this allows custom time zones to return
an iterable (such as a Set.)

See: #1427
@ptomato ptomato force-pushed the 1427-consume-iterables branch from 0f61f20 to df98a24 Compare April 16, 2021 21:44
@ptomato ptomato merged commit 8509b9e into main Apr 17, 2021
@ptomato ptomato deleted the 1427-consume-iterables branch April 17, 2021 00:44
@cjtenny cjtenny mentioned this pull request Apr 17, 2021
44 tasks
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.

Consuming array-likes is kind of strange; why not iterables?
4 participants