From 7e1ea4837973766f7c7cd66f7c85beb8f80447e1 Mon Sep 17 00:00:00 2001 From: Adam Ernst Date: Thu, 7 Jul 2016 13:31:24 -0700 Subject: [PATCH] Make executeAsyncBlockOnJavaScriptQueue required Summary: This leaves no optional methods on `RCTJavaScriptExecutor`, which is certainly a good thing. Reviewed By: majak Differential Revision: D3518915 fbshipit-source-id: e606b9076c3299f81a225a181ea244148a1832cb --- React/Base/RCTBatchedBridge.m | 11 ++--------- React/Base/RCTJavaScriptExecutor.h | 2 -- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/React/Base/RCTBatchedBridge.m b/React/Base/RCTBatchedBridge.m index 2db2c4bbc88..bad2a4de3ca 100644 --- a/React/Base/RCTBatchedBridge.m +++ b/React/Base/RCTBatchedBridge.m @@ -747,18 +747,11 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleUR - (void)_immediatelyCallTimer:(NSNumber *)timer { RCTAssertJSThread(); - - dispatch_block_t block = ^{ + [_javaScriptExecutor executeAsyncBlockOnJavaScriptQueue:^{ [self _actuallyInvokeAndProcessModule:@"JSTimersExecution" method:@"callTimers" arguments:@[@[timer]]]; - }; - - if ([_javaScriptExecutor respondsToSelector:@selector(executeAsyncBlockOnJavaScriptQueue:)]) { - [_javaScriptExecutor executeAsyncBlockOnJavaScriptQueue:block]; - } else { - [_javaScriptExecutor executeBlockOnJavaScriptQueue:block]; - } + }]; } - (void)enqueueApplicationScript:(NSData *)script diff --git a/React/Base/RCTJavaScriptExecutor.h b/React/Base/RCTJavaScriptExecutor.h index 832b78e3cdd..aa47d3cae19 100644 --- a/React/Base/RCTJavaScriptExecutor.h +++ b/React/Base/RCTJavaScriptExecutor.h @@ -76,8 +76,6 @@ typedef void (^RCTJavaScriptCallback)(id json, NSError *error); */ - (void)executeBlockOnJavaScriptQueue:(dispatch_block_t)block; -@optional - /** * Special case for Timers + ContextExecutor - instead of the default * if jsthread then call else dispatch call on jsthread