mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-18 04:13:51 +08:00
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
This commit is contained in:
committed by
Facebook Github Bot 2
parent
a203cf4791
commit
7e1ea48379
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user