-
-
Notifications
You must be signed in to change notification settings - Fork 31
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] SameValue
: Use Object.is(…)
if available
#103
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes SameValue.js
from 23 bytes to 366 bytes, a 16x increase. I'm not sure this change is particularly useful here - this function is trivial for engines to inline, and falling back to the builtin one adds unreliability for what i suspect is no performance gain.
If there's actual benchmarks that indicate that the native Object.is
method performs significantly faster than this version, then it'd be worth the bundle size increase, but otherwise I think this is probably fine as-is.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #103 +/- ##
==========================================
- Coverage 95.39% 92.13% -3.26%
==========================================
Files 2140 2140
Lines 31289 31300 +11
Branches 7047 7058 +11
==========================================
- Hits 29847 28838 -1009
- Misses 1442 2462 +1020 ☔ View full report in Codecov by Sentry. |
69d241d
to
def7e76
Compare
def7e76
to
9470189
Compare
9470189
to
8735417
Compare
8735417
to
b2f87e7
Compare
Object.is(…)
simply invokes theSameValue
abstract operation.