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:
Martín Bigio 2016-03-23 09:27:20 -07:00 коммит произвёл Facebook Github Bot 1
Родитель 8edc35004c
Коммит 24508d0d58
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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;
@ -696,7 +696,7 @@ static int readBundle(FILE *fd, size_t offset, size_t length, void *ptr) {
[strongSelf invalidate];
});
}
};
}];
}
- (NSData *)loadRAMBundle:(NSURL *)sourceURL error:(NSError **)error