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] SameValue: Use Object.is(…) if available #103

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ExE-Boss
Copy link
Contributor

@ExE-Boss ExE-Boss commented Jun 7, 2020

Object.is(…) simply invokes the SameValue abstract operation.

Copy link
Owner

@ljharb ljharb left a 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
Copy link

codecov bot commented Jun 13, 2020

Codecov Report

Base: 95.10% // Head: 95.10% // No change to project coverage 👍

Coverage data is based on head (fc4581c) compared to base (235c1dc).
Patch has no changes to coverable lines.

❗ Current head fc4581c differs from pull request most recent head 8735417. Consider uploading reports for the commit 8735417 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #103   +/-   ##
=======================================
  Coverage   95.10%   95.10%           
=======================================
  Files        1362     1362           
  Lines       18833    18833           
  Branches     4081     4081           
=======================================
  Hits        17911    17911           
  Misses        922      922           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants