mirror of
https://github.com/status-im/react-native.git
synced 2025-02-04 13:44:04 +00:00
Fix dev-only redbox in polyfillfunctions
Summary: Fixes a redbox about setting both the accessor and the value for an object. It looks like it's actually coming from PolyfillFunctions, where we set the value as well as spreading in the object descriptor for modules in DEV. Reviewed By: yungsters Differential Revision: D9792991 fbshipit-source-id: a2fa5d1820c5eddfd8244722771e76de62f89976
This commit is contained in:
parent
737f93705c
commit
ab97b9f602
@ -33,10 +33,7 @@ function polyfillObjectProperty<T>(
|
||||
const descriptor = Object.getOwnPropertyDescriptor(object, name);
|
||||
if (__DEV__ && descriptor) {
|
||||
const backupName = `original${name[0].toUpperCase()}${name.substr(1)}`;
|
||||
Object.defineProperty(object, backupName, {
|
||||
...descriptor,
|
||||
value: object[name],
|
||||
});
|
||||
Object.defineProperty(object, backupName, descriptor);
|
||||
}
|
||||
|
||||
const {enumerable, writable, configurable} = descriptor || {};
|
||||
|
Loading…
x
Reference in New Issue
Block a user