Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3289 +/- ##
==========================================
+ Coverage 97.40% 97.64% +0.23%
==========================================
Files 22 22
Lines 10771 10746 -25
Branches 1866 1855 -11
==========================================
+ Hits 10492 10493 +1
+ Misses 258 235 -23
+ Partials 21 18 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bfb52ce to
560ef50
Compare
ptomato
left a comment
There was a problem hiding this comment.
Thanks!
Good in principle, but needs a few adjustments. There are a few places where I think it'd be good to keep an assertion, and a few places where it looks like the /* c8 ignore next */ magic comments aren't working as intended so maybe those can get a closer look.
There are a couple of deletions that don't look obviously deleteable to me, so would appreciate hearing your analysis.
| if (increment > 1) { | ||
| // If the estimate overshot the target, try again with a smaller increment | ||
| // in the reverse direction. | ||
| increment /= 2; |
There was a problem hiding this comment.
Removing this looks wrong at first glance — as if it might be just happenstance that the bisection never overshoots in any of our tests.
(if removing it is correct, then the loop can be simplified a bit more — it looks like sign = 0 can become break, and the comment above the loop needs to be updated since it's no longer a bisection)
Thanks for taking a look! The analysis of these was based on nothing deeper than looking at the coverage and noticing that they appear unused. I'm happy to take a more conservative approach and replace some of the deleted bits with assertions. I agree that some of these unused blocks are large enough to be better viewed as missing tests than as dead code. I'll take care of some of the lower-hanging fruit and try to turn those larger bits into tests. Until then, I'll mark this as a draft PR. |
|
@jessealama I realize now that Tim had looked at 2 of these and opened issues for them: #3235, #3217 |
9929b00 to
c4d0d35
Compare
I've updated things a bit to use assertions in a couple places, and restored the code for the more aggressive deletions. Let's tackle those in separate issues. |
c4d0d35 to
f205f00
Compare
|
I'm marking this as ready for (re-)review. I made a couple of standalone PRs that track the aggressive deletions we originally had in this PR, thereby trimming down this PR. |
f205f00 to
b6d60f2
Compare
After digging into code coverage following tc39/test262#4964, we found several unreachable code paths in the polyfill's non-ISO calendar and duration rounding logic, even after flossing for edge cases.
We verified this on Node only, so it's possible some of these paths are reachable in other engines. Happy to revert any individual removal if that turns out to be the case.