Permalink
Browse files

Force local builds to use regular JS bundles

Reviewed By: dcaspi

Differential Revision: D5824552

fbshipit-source-id: a435fc0ad5b43a8bd3c6a873a4147c4d92190f4e
  • Loading branch information...
pakoito authored and facebook-github-bot committed Sep 18, 2017
1 parent 6e28179 commit 6b733a4fe7595fe4d5e4e76c6683ec5623bc406a
Showing with 12 additions and 2 deletions.
  1. +12 −2 React/Base/RCTJavaScriptLoader.mm
@@ -157,15 +157,25 @@ + (NSData *)attemptSynchronousLoadOfBundleAtURL:(NSURL *)scriptURL
case facebook::react::ScriptTag::RAMBundle:
break;
case facebook::react::ScriptTag::String:
case facebook::react::ScriptTag::String: {
#if RCT_ENABLE_INSPECTOR
NSData *source = [NSData dataWithContentsOfFile:scriptURL.path
options:NSDataReadingMappedIfSafe
error:error];
if (sourceLength && source != nil) {
*sourceLength = source.length;
}
return source;
#else
if (error) {
*error = [NSError errorWithDomain:RCTJavaScriptLoaderErrorDomain
code:RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously
userInfo:@{NSLocalizedDescriptionKey:
@"Cannot load text/javascript files synchronously"}];
}
return nil;
#endif
}
case facebook::react::ScriptTag::BCBundle:
if (runtimeBCVersion == JSNoBytecodeFileFormatVersion || runtimeBCVersion < 0) {
if (error) {

0 comments on commit 6b733a4

Please sign in to comment.