From 46dcce0031652b622c50b76f3e20989f30ba220b Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Wed, 5 Feb 2020 12:59:41 -0800 Subject: [PATCH] Remove unused callFunctionReturnResultAndFlushedQueue Summary: Changelog: [Internal] Remove unused BatchedBridge.callFunctionReturnResultAndFlushedQueue Reviewed By: sammy-SC Differential Revision: D19740946 fbshipit-source-id: 9919d52074180d0fcfb7c0929005f0d925578912 --- Libraries/BatchedBridge/MessageQueue.js | 21 ++----------------- .../RNTesterUnitTests/RCTAllocationTests.m | 1 - .../jsiexecutor/jsireact/JSIExecutor.cpp | 3 --- .../jsiexecutor/jsireact/JSIExecutor.h | 1 - 4 files changed, 2 insertions(+), 24 deletions(-) diff --git a/Libraries/BatchedBridge/MessageQueue.js b/Libraries/BatchedBridge/MessageQueue.js index 8c35ee9f8eaa95..bbeace0abe9192 100644 --- a/Libraries/BatchedBridge/MessageQueue.js +++ b/Libraries/BatchedBridge/MessageQueue.js @@ -74,9 +74,6 @@ class MessageQueue { (this: any).callFunctionReturnFlushedQueue = this.callFunctionReturnFlushedQueue.bind( this, ); - (this: any).callFunctionReturnResultAndFlushedQueue = this.callFunctionReturnResultAndFlushedQueue.bind( - this, - ); (this: any).flushedQueue = this.flushedQueue.bind(this); (this: any).invokeCallbackAndReturnFlushedQueue = this.invokeCallbackAndReturnFlushedQueue.bind( this, @@ -115,19 +112,6 @@ class MessageQueue { return this.flushedQueue(); } - callFunctionReturnResultAndFlushedQueue( - module: string, - method: string, - args: any[], - ): $TEMPORARY$array, Array, Array, number]> { - let result; - this.__guard(() => { - result = this.__callFunction(module, method, args); - }); - - return [result, this.flushedQueue()]; - } - invokeCallbackAndReturnFlushedQueue( cbID: number, args: any[], @@ -398,7 +382,7 @@ class MessageQueue { Systrace.endEvent(); } - __callFunction(module: string, method: string, args: any[]): any { + __callFunction(module: string, method: string, args: any[]): void { this._lastFlush = Date.now(); this._eventLoopStartTime = this._lastFlush; if (__DEV__ || this.__spy) { @@ -422,9 +406,8 @@ class MessageQueue { method, module, ); - const result = moduleMethods[method].apply(moduleMethods, args); + moduleMethods[method].apply(moduleMethods, args); Systrace.endEvent(); - return result; } __invokeCallback(cbID: number, args: any[]) { diff --git a/RNTester/RNTesterUnitTests/RCTAllocationTests.m b/RNTester/RNTesterUnitTests/RCTAllocationTests.m index 9be7096c2c6a0a..71faf5a35ca60b 100644 --- a/RNTester/RNTesterUnitTests/RCTAllocationTests.m +++ b/RNTester/RNTesterUnitTests/RCTAllocationTests.m @@ -60,7 +60,6 @@ - (void)setUp " callFunctionReturnFlushedQueue: function() { return null; }," " invokeCallbackAndReturnFlushedQueue: function() { return null; }," " flushedQueue: function() { return null; }," - " callFunctionReturnResultAndFlushedQueue: function() { return null; }," "};"; NSURL *tempDir = [NSURL fileURLWithPath:NSTemporaryDirectory() isDirectory:YES]; diff --git a/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp b/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp index eaf7b71bc91bef..8368eb3f9bb1a5 100644 --- a/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +++ b/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp @@ -290,9 +290,6 @@ void JSIExecutor::bindBridge() { *runtime_, "invokeCallbackAndReturnFlushedQueue"); flushedQueue_ = batchedBridge.getPropertyAsFunction(*runtime_, "flushedQueue"); - callFunctionReturnResultAndFlushedQueue_ = - batchedBridge.getPropertyAsFunction( - *runtime_, "callFunctionReturnResultAndFlushedQueue"); }); } diff --git a/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h b/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h index cb4a7290f640db..e50231cd74e2b8 100644 --- a/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h +++ b/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h @@ -129,7 +129,6 @@ class JSIExecutor : public JSExecutor { folly::Optional callFunctionReturnFlushedQueue_; folly::Optional invokeCallbackAndReturnFlushedQueue_; folly::Optional flushedQueue_; - folly::Optional callFunctionReturnResultAndFlushedQueue_; }; using Logger =