From 96de12ab483cd5ed8993ca4ae84ab9e15474443f Mon Sep 17 00:00:00 2001 From: zhongwuzw Date: Wed, 20 Feb 2019 18:36:31 -0800 Subject: [PATCH] Remove __fbRequireBatchedBridge call when not get batchedBridge (#23547) Summary: From the git log, we added `__fbRequireBatchedBridge` in this commit https://github.com/facebook/react-native/commit/6dc3a83e88ed120decbeaed8e4e62dc2bb7107a3, 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 --- ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp b/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp index 15414107b85..ce65d9f83bb 100644 --- a/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +++ b/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp @@ -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_);