-
Notifications
You must be signed in to change notification settings - Fork 157
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
Update test262 #3072
Open
ptomato
wants to merge
8
commits into
main
Choose a base branch
from
update-test262
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Update test262 #3072
+185
−16
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previously, getting any of the calendar properties in a non-ISO PlainDate representing the ISO date -271821-04-19 would trigger an exception because constructing a legacy Date for that date would fail. This adds a special case for this particular date, where we format 04-20 in a time zone that pushes the local time back to 04-19.
…endar Some leap months with 30 days don't occur until quite far in the past in the Chinese calendar. Instead of searching 100 years into the past each time, hardcode these cases, and only search 20 years into the past. (20 is chosen sort of arbitrarily, but several lunar calendars have cycles that are up to 19 years.)
The reference year algorithm in CalendarMonthDayToISOReferenceDate regarding the constraining of days exceeding the end of variable-length month, was implemented incorrectly in the reference code. For example, the intercalary month in the Ethiopian calendar may have 5 or 6 days. If we try to create a PlainMonthDay of M13-07, that should constrain to M13-06. But the first intercalary month counting back from the end of 1972 has 5 days, so M13-07 was erroneously constrained to M13-05. To solve this, maxLengthOfMonthCodeInAnyYear() to each helper. This is different from maximumMonthLength() which gives the month length for the given year, which may be an upper bound if the month length isn't easily determinable. Whereas, maxLengthOfMonthCodeInAnyYear() always gives the upper bound for that month over all years.
…Parts) The reference code was implemented incorrectly with regards to the order of operations prescribed by the spec text. ToNumber needs to be called on both non-Temporal-object arguments before checking whether they are the same type, and that check needs to occur before checking whether the date value is valid.
UTC is a common case. It never has offset transitions and its identifier does not need to be parsed. Adding these fast paths shaves considerable time off some test262 tests.
The one from es-abstract was showing up in profiles of some slow test262 tests, because it incorporates the assertions from ECMA-262, e.g. testing multiple times whether the arguments are integers. That is not necessary here, because we call it in a limited number of places and are guaranteed to call it with the correct arguments. Just delegate to String.prototype.padStart instead.
Some of the SpiderMonkey staging tests are incorrect. Others expose bugs in ICU4C.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3072 +/- ##
==========================================
+ Coverage 95.74% 96.21% +0.47%
==========================================
Files 21 21
Lines 9712 9867 +155
Branches 1741 1796 +55
==========================================
+ Hits 9299 9494 +195
+ Misses 362 323 -39
+ Partials 51 50 -1 ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Test262 recently imported a large body of tests from SpiderMonkey, including some Temporal tests. This PR pulls in the newest commit from test262.
Some of these new tests exposed bugs in the reference code in this repo, which I've fixed. Some of them ran slowly, which I've tried to speed up. A few exposed bugs in ICU or were incorrect by my reading of the spec, which I've added to the expected failures list and will follow up on later.