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

Misc editorial improvements #1505

Merged
merged 9 commits into from
Jun 1, 2021
Merged

Misc editorial improvements #1505

merged 9 commits into from
Jun 1, 2021

Conversation

ptomato
Copy link
Collaborator

@ptomato ptomato commented Apr 29, 2021

Marked as draft, because I would like to write tests where appropriate before merging.

See: #1411

@ptomato ptomato requested a review from Ms2ger April 29, 2021 20:03
@ptomato ptomato mentioned this pull request Apr 29, 2021
@codecov
Copy link

codecov bot commented Apr 29, 2021

Codecov Report

Merging #1505 (683ff03) into main (304246e) will decrease coverage by 2.66%.
The diff coverage is 100.00%.

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

@@            Coverage Diff             @@
##             main    #1505      +/-   ##
==========================================
- Coverage   95.58%   92.91%   -2.67%     
==========================================
  Files          19       17       -2     
  Lines       11139    11111      -28     
  Branches     1736     1639      -97     
==========================================
- Hits        10647    10324     -323     
- Misses        485      774     +289     
- Partials        7       13       +6     
Flag Coverage Δ
test262 ?
tests 91.75% <100.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
polyfill/lib/plaindate.mjs 89.83% <ø> (-7.35%) ⬇️
polyfill/lib/plaindatetime.mjs 90.94% <ø> (-5.87%) ⬇️
polyfill/lib/plainyearmonth.mjs 90.26% <ø> (-6.34%) ⬇️
polyfill/lib/zoneddatetime.mjs 91.74% <ø> (-6.90%) ⬇️
polyfill/lib/ecmascript.mjs 94.88% <100.00%> (-0.28%) ⬇️
polyfill/lib/instant.mjs 87.78% <100.00%> (-6.97%) ⬇️
polyfill/lib/plaintime.mjs 91.93% <100.00%> (-4.24%) ⬇️
polyfill/lib/plainmonthday.mjs 83.56% <0.00%> (-9.59%) ⬇️
... and 12 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 304246e...23f287f. Read the comment docs.

@ptomato ptomato force-pushed the 1411-editorial-improvements branch from 6c1f7ac to d06b4c2 Compare April 29, 2021 20:15
spec/abstractops.html Outdated Show resolved Hide resolved
spec/instant.html Outdated Show resolved Hide resolved
spec/instant.html Outdated Show resolved Hide resolved
spec/instant.html Outdated Show resolved Hide resolved
spec/instant.html Outdated Show resolved Hide resolved
spec/instant.html Outdated Show resolved Hide resolved
@ptomato ptomato marked this pull request as draft April 29, 2021 22:11
@ptomato ptomato force-pushed the 1411-editorial-improvements branch from d06b4c2 to ff399a3 Compare April 29, 2021 23:24
spec/instant.html Outdated Show resolved Hide resolved
@ptomato ptomato force-pushed the 1411-editorial-improvements branch from ff399a3 to c6fb16d Compare April 30, 2021 00:46
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

Spec seems good to me!

spec/instant.html Outdated Show resolved Hide resolved
spec/instant.html Outdated Show resolved Hide resolved
spec/instant.html Outdated Show resolved Hide resolved
spec/abstractops.html Outdated Show resolved Hide resolved
@ptomato ptomato force-pushed the 1411-editorial-improvements branch 2 times, most recently from 3abf67c to 09c157e Compare May 21, 2021 23:45
ptomato added 2 commits May 31, 2021 12:45
GetOptionalTemporalCalendar → GetTemporalCalendarWithISODefault
ToOptionalTemporalCalendar → ToTemporalCalendarWithISODefault

See: #1411
We are going to rename all the ValidateFoo operations in the spec text to
IsValidFoo, and remove the RejectFoo operations. This doesn't apply to the
polyfill because the form where throwing the exception is part of the
operation is more convenient in code.

But, still rename RejectInstantRange to ValidateEpochNanoseconds because
we are making the same Instant → EpochNanoseconds change to
IsValidEpochNanoseconds, because that is what is actually passed to the
function.
@ptomato ptomato force-pushed the 1411-editorial-improvements branch 2 times, most recently from 4864d70 to f94e662 Compare May 31, 2021 19:53
@ptomato ptomato marked this pull request as ready for review May 31, 2021 19:53
@ptomato
Copy link
Collaborator Author

ptomato commented May 31, 2021

What's changed since the last time: I removed the GetOption commit since I'm still working on ensuring that all the entry points that use GetOption are covered by test262 tests. I added test262 tests that cover "Remove NonNegativeModulo abstract operation". This is ready for merging if the test262 tests pass review. I'll open a separate PR for the GetOption changes so that this one isn't delayed on that any longer.

@ptomato ptomato requested a review from Ms2ger May 31, 2021 19:55
1. Assert: _month_ ≥ 1 and _month_ ≤ 12.
1. Assert: _day_ ≥ 1 and _day_ ≤ ! ISODaysInMonth(_year_, _month_).
1. Assert: ! ValidateTime(_hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_) is *true*.
1. Assert: ! IsValidISODate(_year_, _month_, _day_).
Copy link
Collaborator

Choose a reason for hiding this comment

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

is true

ptomato and others added 7 commits June 1, 2021 10:59
In the spec text, rename ValidateFoo operations to IsValidFoo, and remove
the RejectFoo operations (since they can all be replaced by something like
"If ! IsValidFoo(_args_) is *false*, throw a *RangeError* exception."

ValidateInstant, RejectInstant → IsValidEpochNanoseconds
  (Instant → EpochNanoseconds because that's what's actually passed to the
  operation)
ValidateISODate, RejectISODate → IsValidISODate
ValidateTime → IsValidTime
ValidateISODateTime → remove in favour of IsValidISODate and IsValidTime
ValidateISOYearMonth → IsValidISOMonth (year unused)
ValidateTemporalDuration → ValidateDuration
  (drop Temporal because the argument is not a Temporal.Duration object)

Make some formatting consistent around this.

See: #1411

Co-authored-by: Ms2ger <Ms2ger@gmail.com>
Based on the removal of the other ValidateFoo operations, rename this one
to correspond to ISODateTimeWithinLimits.
This operation is only called on Duration fields that have just been
returned by ToLimitedTemporalDuration, which calls
ValidateTemporalDuration, so it never has any effect and is redundant
everywhere it's used.

See: #1411
This is not only the mergeFields operation for the ISO calendar, it's the
fallback one in case the method is not present on a calendar.

See: #1411
This is not needed. x modulo y already has this meaning. (Unlike the %
operator in JS, which does not.)

See: #1411
This is to be done comprehensively in #1413, but may as well fix these
cases that were identified in review.
(Comma separators are currently not used in the spec text, so prefer
scientific notation if the numbers are large.)
@Ms2ger Ms2ger force-pushed the 1411-editorial-improvements branch from f94e662 to 23f287f Compare June 1, 2021 09:00
@Ms2ger Ms2ger merged commit 3a89d0b into main Jun 1, 2021
@Ms2ger Ms2ger deleted the 1411-editorial-improvements branch June 1, 2021 09:09
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.

3 participants