-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Animated on JSC: Object.hasOwn -> obj.hasOwnProperty (#48035)
Summary: #46385 introduced use of `Object.hasOwn` as an incidental detail of some `Animated` performance improvements. Unfortunately, `Object.hasOwn` is not present in the version of JSC shipped with Android, nor the built in iOS JSC until iOS 15.4, which is greater than React Native's minimum version (13.4). Instead: - Use `obj.hasOwnProperty(prop)` for known objects that have the `Object` prototype. - Otherwise, use `Object.hasOwn` where it is defined. - Lastly, fall back to `Object.prototype.hasOwnProperty.call(obj, prop)`, which is compatible with passed `null`-prototype objects. Fixes #47963 Intend to pick for RN 0.77. ## Changelog: [GENERAL][FIXED] Replace Object.hasOwn usages to fix Animated on JSC Pull Request resolved: #48035 Test Plan: - Run `rn-tester` on Android with Hermes disabled. - Verify the FlatList->Basic example redboxes before this change, and works after it. Reviewed By: yungsters Differential Revision: D66638379 Pulled By: robhogan fbshipit-source-id: 51ac525851b41adea3bf3cc41349225138e1f2fe
- Loading branch information
1 parent
f791fb9
commit e996b3f
Showing
4 changed files
with
34 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters