mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
RCTAssertJSThread was removed
Summary: RCTAssertJSThread is a specific to RCTCxxBridge assert that ensured that the code is executed on JavaScript thread. It was here from the very beginning. Now we need to remove it. Reasons: - The overall concept of limiting the execution of JavaScript code to a single thread is gone. Now we think about this as some queue, not thread. Fabric heavily relies on that and that asserts fires in Fabric. - The assert is already far from being trivial: it checks for a custom executor, and if it's not nil, it does not fire. We can introduce another special flag for Fabric that will also disable that... but that's pointless. Such kinda asserts should not be complex to be useful. - This asserts was used only in two places, and both of them are not exposed as public API. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D18946388 fbshipit-source-id: 1e5fc732abdcb4bff3cfadcba24f7a433f1a480e
This commit is contained in:
committed by
Facebook Github Bot
parent
62a079ed12
commit
f798e2bc8d
@@ -49,10 +49,6 @@
|
||||
#import <React/RCTDevLoadingView.h>
|
||||
#endif
|
||||
|
||||
#define RCTAssertJSThread() \
|
||||
RCTAssert(self.executorClass || self->_jsThread == [NSThread currentThread], \
|
||||
@"This method must be called on JS thread")
|
||||
|
||||
static NSString *const RCTJSThreadName = @"com.facebook.react.JavaScript";
|
||||
|
||||
typedef void (^RCTPendingCall)();
|
||||
@@ -557,7 +553,6 @@ struct RCTInstanceCallback : public InstanceCallback {
|
||||
return;
|
||||
}
|
||||
|
||||
RCTAssertJSThread();
|
||||
__weak RCTCxxBridge *weakSelf = self;
|
||||
_jsMessageThread = std::make_shared<RCTMessageThread>([NSRunLoop currentRunLoop], ^(NSError *error) {
|
||||
if (error) {
|
||||
@@ -1289,8 +1284,6 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleUR
|
||||
*/
|
||||
- (void)_immediatelyCallTimer:(NSNumber *)timer
|
||||
{
|
||||
RCTAssertJSThread();
|
||||
|
||||
if (_reactInstance) {
|
||||
_reactInstance->callJSFunction("JSTimers", "callTimers",
|
||||
folly::dynamic::array(folly::dynamic::array([timer doubleValue])));
|
||||
|
||||
Reference in New Issue
Block a user