-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Re-enable tests in DateParse2.js #4300
Comments
Really appreciate the effort but appreciate even more if you do not enable / add negative year tests to xplat. (my 2 cents, if it has a runtime cost, please do not even change for Windows too) Why => xplat negative years time zone info != what we get from Windows. Correcting that, costs lots of if/else/copy. At the moment, Curious.. why anyone needs negative years? |
See #4325 |
Because it's in the spec. (Or, more specifically, by my reading of the relevant spec sections, negative years are not out of range and therefore do not cause Date ctor to return |
Not sure question/answer matches :) Correct me if I'm wrong but, no real app needs negative years, no? Probably some wouldn't agree but can we consider twice on any extra ops we will add because of making negative years more spec compliant? |
If it slows down the common case, absolutely we should consider this being an issue that is so unimportant that it's not worth fixing. If it only slows down the negative years case, there's no cost to the common case, so I don't see why we couldn't fix it there. |
I will run a benchmark to see if it slows down common cases. |
^ @xiaoyinl: We should be able to tell by analyzing the code: if there's already a branch surrounding the logic for the negative year, adding more logic to that block means that only the negative cases will be affected. If this change would require adding a branch to separate positive and negative cases, then we will need to look at the benchmarks to decide if there's a noticable impact. |
@dilijev There're a few branches added to separate both cases, like L1240-1245, and L1405-1408. But I'm not sure if this cost is negligible or not for common cases. |
Ah yes, those new checks will add non-zero overhead, though without a benchmark it's hard to tell how small the overhead will be (although the branch predictor will probably render it even more negligible for the common case). |
… years (Fixes #4178) Merge pull request #4318 from xiaoyinl:DateParse_zero_padded_years This PR will finally make `Date.parse` able to parse any output of `Date.toString()`, `Date.toUTCString`, and `Date.toISOString()`. Fixes #4178 Fixes #4300 Todo: - [x] Add, update and re-enable tests (#4300) - [x] `new Date("2017-jan-01")` causes an assertion failure
…d negative years (Fixes #4178) Merge pull request #4318 from xiaoyinl:DateParse_zero_padded_years This PR will finally make `Date.parse` able to parse any output of `Date.toString()`, `Date.toUTCString`, and `Date.toISOString()`. Fixes #4178 Fixes #4300 Todo: - [x] Add, update and re-enable tests (#4300) - [x] `new Date("2017-jan-01")` causes an assertion failure
…ize padded and negative years (Fixes #4178) Merge pull request #4318 from xiaoyinl:DateParse_zero_padded_years This PR will finally make `Date.parse` able to parse any output of `Date.toString()`, `Date.toUTCString`, and `Date.toISOString()`. Fixes #4178 Fixes #4300 Todo: - [x] Add, update and re-enable tests (#4300) - [x] `new Date("2017-jan-01")` causes an assertion failure
In #4067, we've changed the format of Date.toUTCDate for negative years. After this change, some tests in DateParse2.js fail because
Date.parse()
isn't able to parse negative years in some cases, so these failing tests are disabled in #4067. They should be re-enabled (uncommented) after #4178 is fixed.Ref: #4067 (comment)
The text was updated successfully, but these errors were encountered: