register `nativeRequire` on JS thread
Reviewed By: tadeuzagallo Differential Revision: D3087194 fb-gh-sync-id: 9c7bb37260dd202d1ee54606007be02de6c0fb55 shipit-source-id: 9c7bb37260dd202d1ee54606007be02de6c0fb55
This commit is contained in:
parent
8edc35004c
commit
24508d0d58
|
@ -671,7 +671,7 @@ static int readBundle(FILE *fd, size_t offset, size_t length, void *ptr) {
|
||||||
- (void)registerNativeRequire
|
- (void)registerNativeRequire
|
||||||
{
|
{
|
||||||
__weak RCTJSCExecutor *weakSelf = self;
|
__weak RCTJSCExecutor *weakSelf = self;
|
||||||
_context.context[@"nativeRequire"] = ^(NSString *moduleName) {
|
[self addSynchronousHookWithName:@"nativeRequire" usingBlock:^(NSString *moduleName) {
|
||||||
RCTJSCExecutor *strongSelf = weakSelf;
|
RCTJSCExecutor *strongSelf = weakSelf;
|
||||||
if (!strongSelf || !moduleName) {
|
if (!strongSelf || !moduleName) {
|
||||||
return;
|
return;
|
||||||
|
@ -696,7 +696,7 @@ static int readBundle(FILE *fd, size_t offset, size_t length, void *ptr) {
|
||||||
[strongSelf invalidate];
|
[strongSelf invalidate];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSData *)loadRAMBundle:(NSURL *)sourceURL error:(NSError **)error
|
- (NSData *)loadRAMBundle:(NSURL *)sourceURL error:(NSError **)error
|
||||||
|
|
Loading…
Reference in New Issue