Skip to content

Commit ab97b9f

Browse files
Emily Janzerfacebook-github-bot
authored andcommitted
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
1 parent 737f937 commit ab97b9f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Libraries/Utilities/PolyfillFunctions.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ function polyfillObjectProperty<T>(
3333
const descriptor = Object.getOwnPropertyDescriptor(object, name);
3434
if (__DEV__ && descriptor) {
3535
const backupName = `original${name[0].toUpperCase()}${name.substr(1)}`;
36-
Object.defineProperty(object, backupName, {
37-
...descriptor,
38-
value: object[name],
39-
});
36+
Object.defineProperty(object, backupName, descriptor);
4037
}
4138

4239
const {enumerable, writable, configurable} = descriptor || {};

0 commit comments

Comments
 (0)