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

mergeInto show console warning about pure object #22308

Closed
3 tasks done
vreality64 opened this issue Nov 16, 2018 · 2 comments
Closed
3 tasks done

mergeInto show console warning about pure object #22308

vreality64 opened this issue Nov 16, 2018 · 2 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@vreality64
Copy link
Contributor

vreality64 commented Nov 16, 2018

Environment

Run react-native info in your terminal and paste its contents here.

Description

code in mergeInto has potential error about Object created by Object.create(null). they does not have Object.prototype chain, so two.hasOwnProperty shows following error.

object created by null parameter

I'm facing this issue with react-native-extended-stylesheet and FlatList. FlatList has two style property (style, contentContainerStyle). I think these two styles are merged into one by mergeInto.

Environment

[skip envinfo]. The code was written 4 years ago, so I think it's affected on all RN environments.

Reproducible Demo

Sorry, doesn't have demo.

Suggestions

two.hasOwnProperty(key) should be Object.prototype.hasOwnProperty.call(two, key). this makes all thing works well. 😃

@react-native-bot
Copy link
Collaborator

Can you run react-native info and edit your issue to include these results under the Environment section?

If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] under Environment to let us know.

@react-native-bot
Copy link
Collaborator

I am closing this issue because it does not contain the necessary environment info, and there has been no followup in a while.

If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.

@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Nov 24, 2018
facebook-github-bot pushed a commit that referenced this issue Dec 5, 2018
Summary:
`instance.hasOwnProperty` has potential danger because of some object could be eliminate own prototype chain. Update code be more reliable.

This PR is solution of #22308 issue. (Fixes #22308)
Pull Request resolved: #22348

Differential Revision: D13334882

Pulled By: cpojer

fbshipit-source-id: 9b9310a972e933af1962666d7b0c683ff43cc5b2
kelset pushed a commit that referenced this issue Dec 12, 2018
Summary:
`instance.hasOwnProperty` has potential danger because of some object could be eliminate own prototype chain. Update code be more reliable.

This PR is solution of #22308 issue. (Fixes #22308)
Pull Request resolved: #22348

Differential Revision: D13334882

Pulled By: cpojer

fbshipit-source-id: 9b9310a972e933af1962666d7b0c683ff43cc5b2
grabbou pushed a commit that referenced this issue Dec 17, 2018
Summary:
`instance.hasOwnProperty` has potential danger because of some object could be eliminate own prototype chain. Update code be more reliable.

This PR is solution of #22308 issue. (Fixes #22308)
Pull Request resolved: #22348

Differential Revision: D13334882

Pulled By: cpojer

fbshipit-source-id: 9b9310a972e933af1962666d7b0c683ff43cc5b2
t-nanava pushed a commit to microsoft/react-native-macos that referenced this issue Jun 17, 2019
Summary:
`instance.hasOwnProperty` has potential danger because of some object could be eliminate own prototype chain. Update code be more reliable.

This PR is solution of facebook#22308 issue. (Fixes facebook#22308)
Pull Request resolved: facebook#22348

Differential Revision: D13334882

Pulled By: cpojer

fbshipit-source-id: 9b9310a972e933af1962666d7b0c683ff43cc5b2
@facebook facebook locked as resolved and limited conversation to collaborators Nov 24, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Nov 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants