diff --git a/React/Base/RCTJavaScriptLoader.h b/React/Base/RCTJavaScriptLoader.h index e4123cb3b10..729fa371804 100755 --- a/React/Base/RCTJavaScriptLoader.h +++ b/React/Base/RCTJavaScriptLoader.h @@ -92,7 +92,6 @@ typedef void (^RCTSourceLoadBlock)(NSError *error, RCTSource *source); * RCTJavaScriptLoaderErrorDomain and the code RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously. */ + (NSData *)attemptSynchronousLoadOfBundleAtURL:(NSURL *)scriptURL - runtimeBCVersion:(int32_t)runtimeBCVersion sourceLength:(int64_t *)sourceLength error:(NSError **)error; diff --git a/React/Base/RCTJavaScriptLoader.mm b/React/Base/RCTJavaScriptLoader.mm index a95446b0093..d902f0c92d0 100755 --- a/React/Base/RCTJavaScriptLoader.mm +++ b/React/Base/RCTJavaScriptLoader.mm @@ -19,8 +19,6 @@ NSString *const RCTJavaScriptLoaderErrorDomain = @"RCTJavaScriptLoaderErrorDomain"; -static const int32_t JSNoBytecodeFileFormatVersion = -1; - const UInt32 RCT_BYTECODE_ALIGNMENT = 4; UInt32 RCTReadUInt32LE(NSData *script, UInt32 offset) { @@ -92,10 +90,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init) { int64_t sourceLength; NSError *error; - NSData *data = [self attemptSynchronousLoadOfBundleAtURL:scriptURL - runtimeBCVersion:JSNoBytecodeFileFormatVersion - sourceLength:&sourceLength - error:&error]; + NSData *data = [self attemptSynchronousLoadOfBundleAtURL:scriptURL sourceLength:&sourceLength error:&error]; if (data) { onComplete(nil, RCTSourceCreate(scriptURL, data, sourceLength)); return; @@ -112,7 +107,6 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init) } + (NSData *)attemptSynchronousLoadOfBundleAtURL:(NSURL *)scriptURL - runtimeBCVersion:(int32_t)runtimeBCVersion sourceLength:(int64_t *)sourceLength error:(NSError **)error { @@ -203,27 +197,6 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init) return nil; #endif } - case facebook::react::ScriptTag::BCBundle: - if (runtimeBCVersion == JSNoBytecodeFileFormatVersion || runtimeBCVersion < 0) { - if (error) { - *error = [NSError - errorWithDomain:RCTJavaScriptLoaderErrorDomain - code:RCTJavaScriptLoaderErrorBCNotSupported - userInfo:@{NSLocalizedDescriptionKey : @"Bytecode bundles are not supported by this runtime."}]; - } - return nil; - } else if ((uint32_t)runtimeBCVersion != header.version) { - if (error) { - NSString *errDesc = [NSString - stringWithFormat:@"BC Version Mismatch. Expect: %d, Actual: %u", runtimeBCVersion, header.version]; - - *error = [NSError errorWithDomain:RCTJavaScriptLoaderErrorDomain - code:RCTJavaScriptLoaderErrorBCVersion - userInfo:@{NSLocalizedDescriptionKey : errDesc}]; - } - return nil; - } - break; } struct stat statInfo; diff --git a/ReactCommon/cxxreact/JSBundleType.cpp b/ReactCommon/cxxreact/JSBundleType.cpp index c676c738e0a..05bacb4107c 100644 --- a/ReactCommon/cxxreact/JSBundleType.cpp +++ b/ReactCommon/cxxreact/JSBundleType.cpp @@ -13,14 +13,11 @@ namespace facebook { namespace react { static uint32_t constexpr RAMBundleMagicNumber = 0xFB0BD1E5; -static uint32_t constexpr BCBundleMagicNumber = 0x6D657300; ScriptTag parseTypeFromHeader(const BundleHeader &header) { switch (folly::Endian::little(header.magic)) { case RAMBundleMagicNumber: return ScriptTag::RAMBundle; - case BCBundleMagicNumber: - return ScriptTag::BCBundle; default: return ScriptTag::String; } @@ -32,8 +29,6 @@ const char *stringForScriptTag(const ScriptTag &tag) { return "String"; case ScriptTag::RAMBundle: return "RAM Bundle"; - case ScriptTag::BCBundle: - return "BC Bundle"; } return ""; } diff --git a/ReactCommon/cxxreact/JSBundleType.h b/ReactCommon/cxxreact/JSBundleType.h index 0a5bad0894c..45a90458188 100644 --- a/ReactCommon/cxxreact/JSBundleType.h +++ b/ReactCommon/cxxreact/JSBundleType.h @@ -27,7 +27,6 @@ namespace react { enum struct ScriptTag { String = 0, RAMBundle, - BCBundle, }; /**