Skip to content

Commit

Permalink
Remove allowLoadingNonRAMBundles
Browse files Browse the repository at this point in the history
Differential Revision: D3555963

fbshipit-source-id: 24c23e8522c293aad030cd98e0c4ebcb76c54271
  • Loading branch information
adamjernst authored and Facebook Github Bot 2 committed Jul 13, 2016
1 parent 37d0339 commit 235dd00
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
5 changes: 2 additions & 3 deletions React/Base/RCTJavaScriptLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ typedef void (^RCTSourceLoadBlock)(NSError *error, NSData *source, int64_t sourc
/**
* @experimental
* Attempts to synchronously load the script at the given URL. The following two conditions must be met:
* 1. It must be a file URL.
* 2. It must point to a RAM bundle, or allowLoadingNonRAMBundles must be YES.
* 1. It must be a file URL.
* 2. It must point to a RAM bundle.
* If the URL does not meet those conditions, this method will return nil and supply an error with the domain
* RCTJavaScriptLoaderErrorDomain and the code RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously.
*/
+ (NSData *)attemptSynchronousLoadOfBundleAtURL:(NSURL *)scriptURL
sourceLength:(int64_t *)sourceLength
allowLoadingNonRAMBundles:(BOOL)allowLoadingNonRAMBundles
error:(NSError **)error;

@end
12 changes: 0 additions & 12 deletions React/Base/RCTJavaScriptLoader.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ + (void)loadBundleAtURL:(NSURL *)scriptURL onComplete:(RCTSourceLoadBlock)onComp
NSError *error;
NSData *data = [self attemptSynchronousLoadOfBundleAtURL:scriptURL
sourceLength:&sourceLength
allowLoadingNonRAMBundles:NO // we'll do it async
error:&error];
if (data) {
onComplete(nil, data, sourceLength);
Expand All @@ -51,7 +50,6 @@ + (void)loadBundleAtURL:(NSURL *)scriptURL onComplete:(RCTSourceLoadBlock)onComp

+ (NSData *)attemptSynchronousLoadOfBundleAtURL:(NSURL *)scriptURL
sourceLength:(int64_t *)sourceLength
allowLoadingNonRAMBundles:(BOOL)allowLoadingNonRAMBundles
error:(NSError **)error
{
NSString *unsanitizedScriptURLString = scriptURL.absoluteString;
Expand Down Expand Up @@ -111,16 +109,6 @@ + (NSData *)attemptSynchronousLoadOfBundleAtURL:(NSURL *)scriptURL

magicNumber = NSSwapLittleIntToHost(magicNumber);
if (magicNumber != RCTRAMBundleMagicNumber) {
if (allowLoadingNonRAMBundles) {
NSData *source = [NSData dataWithContentsOfFile:scriptURL.path
options:NSDataReadingMappedIfSafe
error:error];
if (sourceLength && source != nil) {
*sourceLength = source.length;
}
return source;
}

if (error) {
*error = [NSError errorWithDomain:RCTJavaScriptLoaderErrorDomain
code:RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously
Expand Down

0 comments on commit 235dd00

Please sign in to comment.