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: use lodash _baseIsNative directly instead of _.isNative (#12358) #12475

Merged
merged 2 commits into from Jul 9, 2020

Conversation

tpodom
Copy link
Contributor

@tpodom tpodom commented Jul 7, 2020

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you update the typescript typings accordingly (if applicable)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

Closes #12358

Lodash throws an error when calling _.isNative if core-js has been loaded because some of its shims can interfere with lodash's ability to accurate determine if a particular function is a native function or not. Using the _baseIsNative module directly bypasses the core-js check in lodash without requiring a custom implementation if the native function detection.

I didn't add any new unit test to validate that an error isn't thrown when core-js shims are loaded because I wasn't sure if you wanted an extra dev dependency for that. I also wasn't sure since Mocha doesn't isolate each test file to a separate process if you wanted the core-js loaded for all tests since that could in theory mask some other problem when core-js is not present.

to avoid core-js thrown error when core-js has been loaded.
@codecov
Copy link

codecov bot commented Jul 7, 2020

Codecov Report

Merging #12475 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #12475   +/-   ##
=======================================
  Coverage   96.37%   96.38%           
=======================================
  Files          95       95           
  Lines        9254     9255    +1     
  Branches       61       61           
=======================================
+ Hits         8919     8920    +1     
  Misses        322      322           
  Partials       13       13           
Impacted Files Coverage Δ
src/utils.js 98.34% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e053514...da31aca. Read the comment docs.

src/utils.js Outdated Show resolved Hide resolved
Copy link
Contributor

@sushantdhiman sushantdhiman left a comment

Choose a reason for hiding this comment

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

No need for tests for this, there is already a test covering this. It will fail whenever native toString overrides custom defined toString

@tpodom
Copy link
Contributor Author

tpodom commented Jul 8, 2020

I moved the comment down. I just noticed in the readme it says to target bug fixes to master first, do you want me to re-point this PR?

@sushantdhiman
Copy link
Contributor

I moved the comment down. I just noticed in the readme it says to target bug fixes to master first, do you want me to re-point this PR?

Thanks, this PR is already pointed to master it seems. Please open a new PR for v6 so it can be released

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.

Unable to use 6.0.0-beta.6 with core-js
2 participants