Skip to content

fix: use lodash _baseIsNative directly instead of _.isNative (#12358)#12480

Merged
sushantdhiman merged 1 commit into
sequelize:v6from
tpodom:use_baseIsNative_v6
Jul 10, 2020
Merged

fix: use lodash _baseIsNative directly instead of _.isNative (#12358)#12480
sushantdhiman merged 1 commit into
sequelize:v6from
tpodom:use_baseIsNative_v6

Conversation

@tpodom
Copy link
Copy Markdown
Contributor

@tpodom tpodom commented Jul 9, 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

Cherry-pick of #12475 for v6 release.
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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 9, 2020

Codecov Report

Merging #12480 into v6 will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##               v6   #12480   +/-   ##
=======================================
  Coverage   96.44%   96.45%           
=======================================
  Files          95       95           
  Lines        9154     9155    +1     
=======================================
+ Hits         8829     8830    +1     
  Misses        325      325           
Impacted Files Coverage Δ
lib/utils.js 98.32% <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 5cabcbc...9febf49. Read the comment docs.

@sushantdhiman sushantdhiman merged commit 631f555 into sequelize:v6 Jul 10, 2020
@sushantdhiman
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 6.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

2 participants