Skip to content

Commit

Permalink
register nativeRequire on JS thread
Browse files Browse the repository at this point in the history
Reviewed By: tadeuzagallo

Differential Revision: D3087194

fb-gh-sync-id: 9c7bb37260dd202d1ee54606007be02de6c0fb55
shipit-source-id: 9c7bb37260dd202d1ee54606007be02de6c0fb55
  • Loading branch information
martinbigio authored and Facebook Github Bot 1 committed Mar 23, 2016
1 parent 8edc350 commit 24508d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions React/Executors/RCTJSCExecutor.m
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ static int readBundle(FILE *fd, size_t offset, size_t length, void *ptr) {
- (void)registerNativeRequire
{
__weak RCTJSCExecutor *weakSelf = self;
_context.context[@"nativeRequire"] = ^(NSString *moduleName) {
[self addSynchronousHookWithName:@"nativeRequire" usingBlock:^(NSString *moduleName) {
RCTJSCExecutor *strongSelf = weakSelf;
if (!strongSelf || !moduleName) {
return;
Expand All @@ -696,7 +696,7 @@ - (void)registerNativeRequire
[strongSelf invalidate];
});
}
};
}];
}

- (NSData *)loadRAMBundle:(NSURL *)sourceURL error:(NSError **)error
Expand Down

0 comments on commit 24508d0

Please sign in to comment.