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: isFunctionshouldn't be used #3233

Merged
merged 3 commits into from
Dec 22, 2021
Merged

fix: isFunctionshouldn't be used #3233

merged 3 commits into from
Dec 22, 2021

Conversation

anderlaw
Copy link
Contributor

Code change checklist

  • Verified that there is no significant performance drop (yarn mobx test:performance)

@changeset-bot
Copy link

changeset-bot bot commented Dec 21, 2021

🦋 Changeset detected

Latest commit: 8b0393e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
mobx Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@anderlaw
Copy link
Contributor Author

I happened to see this logic:

// Exhaust primitive checks
const type = typeof a
if (!isFunction(type) && type !== "object" && typeof b != "object") return false

But isFunctionfunction uses type of inside, there is no way to pass the string of type of result into that function.

The author said it was copied from underscore, but copy wrong, here is underscore sourcecode:

// Exhaust primitive checks
var type = typeof a;
if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
return deepEq(a, b, aStack, bStack);

@urugator
Copy link
Collaborator

Good catch, can you please yarn changeset?

@anderlaw
Copy link
Contributor Author

Good catch, can you please yarn changeset?

of course

@urugator
Copy link
Collaborator

CI got stuck again, I will close and reopen the PR to force re-run

@urugator urugator closed this Dec 22, 2021
@urugator urugator reopened this Dec 22, 2021
@urugator urugator merged commit 2d70798 into mobxjs:main Dec 22, 2021
@github-actions github-actions bot mentioned this pull request Dec 22, 2021
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.

None yet

2 participants