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

fix(assert): handle assertStrictEquals(-0, +0) correctly #4715

Merged
merged 1 commit into from
May 12, 2024

Conversation

rherrmann
Copy link
Contributor

@rherrmann rherrmann commented May 11, 2024

Closes #4714

@CLAassistant
Copy link

CLAassistant commented May 11, 2024

CLA assistant check
All committers have signed the CLA.

@rherrmann rherrmann marked this pull request as ready for review May 11, 2024 15:14
@rherrmann rherrmann requested a review from kt3k as a code owner May 11, 2024 15:14
Fix `assertStrictEquals` to consider -0 and +0 to be equal. Follow the
[MDN recommendation] by replacing `Object.is` with `===` and handling
NaNs specifically.

[MDN recommendation]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#when_to_use_object.is_versus_triple_equals
@rherrmann rherrmann force-pushed the fix-4714-assert-strict-eq branch from b992aa9 to 78d1eb4 Compare May 11, 2024 16:18
Copy link

codecov bot commented May 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.00%. Comparing base (6deab72) to head (78d1eb4).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4715      +/-   ##
==========================================
- Coverage   91.48%   91.00%   -0.48%     
==========================================
  Files         477      477              
  Lines       37268    37274       +6     
  Branches     5316     5283      -33     
==========================================
- Hits        34093    33923     -170     
- Misses       3119     3293     +174     
- Partials       56       58       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@iuioiua iuioiua changed the title fix(assert): let assertStrictEquals(-0, +0) pass (#4714) fix(assert): handle assertStrictEquals(-0, +0) correctly May 12, 2024
Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

Thanks!

@iuioiua iuioiua merged commit ba0522a into denoland:main May 12, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assertStrictEquals(-0, +0) should not throw
3 participants