Fixed crash when forwarding already existing property from ReactNativeInternal to ReactNative
Reviewed By: ericvicenti Differential Revision: D4843917 fbshipit-source-id: 6cdbac28d8a220a6ac289e8b98d9d50eca35e176
This commit is contained in:
parent
39eb090906
commit
ea30aa0fa4
|
@ -150,6 +150,14 @@ function applyForwarding(key) {
|
|||
);
|
||||
return;
|
||||
}
|
||||
if (ReactNative.hasOwnProperty(key)) {
|
||||
// WARNING! ReactNative has read-only keys. So, if ReactNativeInternal
|
||||
// has any duplicate key that ReactNative already has, this assignment
|
||||
// would fail with "Attempted to assign to readonly property."
|
||||
// So, if the key already exists on ReactNative, we assume that it's the
|
||||
// correct module and skip re-assigning it.
|
||||
return;
|
||||
}
|
||||
ReactNative[key] = ReactNativeInternal[key];
|
||||
}
|
||||
for (const key in ReactNativeInternal) {
|
||||
|
|
Loading…
Reference in New Issue