Skip to content

Commit

Permalink
Fix dev-only redbox in polyfillfunctions
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Emily Janzer authored and facebook-github-bot committed Sep 12, 2018
1 parent 737f937 commit ab97b9f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Libraries/Utilities/PolyfillFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {};
Expand Down

0 comments on commit ab97b9f

Please sign in to comment.