Remove __fbRequireBatchedBridge call when not get batchedBridge (#23547)

Summary:
From the git log, we added `__fbRequireBatchedBridge` in this commit  6dc3a83e88, I don't ensure wether I missed something, we actually don't define `__fbRequireBatchedBridge` on `JS` or `Native` side, so `__fbRequireBatchedBridge` getter operation itself would throw exception.

[General] [Fixed] - Remove __fbRequireBatchedBridge call when not get batchedBridge
Pull Request resolved: https://github.com/facebook/react-native/pull/23547

Differential Revision: D14160706

Pulled By: cpojer

fbshipit-source-id: df9180a9a16716a91369249333752316fb6648c5
This commit is contained in:
zhongwuzw
2019-02-20 18:36:31 -08:00
committed by Facebook Github Bot
parent 104b1f9367
commit 96de12ab48

View File

@@ -285,13 +285,8 @@ void JSIExecutor::bindBridge() {
Value batchedBridgeValue =
runtime_->global().getProperty(*runtime_, "__fbBatchedBridge");
if (batchedBridgeValue.isUndefined()) {
Function requireBatchedBridge = runtime_->global().getPropertyAsFunction(
*runtime_, "__fbRequireBatchedBridge");
batchedBridgeValue = requireBatchedBridge.call(*runtime_);
if (batchedBridgeValue.isUndefined()) {
throw JSINativeException(
"Could not get BatchedBridge, make sure your bundle is packaged correctly");
}
throw JSINativeException(
"Could not get BatchedBridge, make sure your bundle is packaged correctly");
}
Object batchedBridge = batchedBridgeValue.asObject(*runtime_);