From 235dd0051dba1452738149822c80590e376f102a Mon Sep 17 00:00:00 2001 From: Adam Ernst Date: Wed, 13 Jul 2016 16:39:15 -0700 Subject: [PATCH] Remove allowLoadingNonRAMBundles Differential Revision: D3555963 fbshipit-source-id: 24c23e8522c293aad030cd98e0c4ebcb76c54271 --- React/Base/RCTJavaScriptLoader.h | 5 ++--- React/Base/RCTJavaScriptLoader.m | 12 ------------ 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/React/Base/RCTJavaScriptLoader.h b/React/Base/RCTJavaScriptLoader.h index f98a7bdd2..141649556 100755 --- a/React/Base/RCTJavaScriptLoader.h +++ b/React/Base/RCTJavaScriptLoader.h @@ -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 diff --git a/React/Base/RCTJavaScriptLoader.m b/React/Base/RCTJavaScriptLoader.m index 9a7edca86..f07b9adae 100755 --- a/React/Base/RCTJavaScriptLoader.m +++ b/React/Base/RCTJavaScriptLoader.m @@ -31,7 +31,6 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init) NSError *error; NSData *data = [self attemptSynchronousLoadOfBundleAtURL:scriptURL sourceLength:&sourceLength - allowLoadingNonRAMBundles:NO // we'll do it async error:&error]; if (data) { onComplete(nil, data, sourceLength); @@ -51,7 +50,6 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init) + (NSData *)attemptSynchronousLoadOfBundleAtURL:(NSURL *)scriptURL sourceLength:(int64_t *)sourceLength - allowLoadingNonRAMBundles:(BOOL)allowLoadingNonRAMBundles error:(NSError **)error { NSString *unsanitizedScriptURLString = scriptURL.absoluteString; @@ -111,16 +109,6 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init) 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