react-native/ReactCommon/cxxreact/JSBundleType.cpp
Marc Horowitz 816d417189 Delete RCTBatchedBridge
Summary:
I've talked to several major community users, and they're all ok with deleting this
code.  There's several doc fixes which will make it easier for third
party developers which should land about the same time this will.

Also buried along with it is RCTJSCExecutor.

Reviewed By: javache

Differential Revision: D6880781

fbshipit-source-id: b4cb1143def6fd23a96290e478fa728adbedacd3
2018-02-05 12:02:35 -08:00

38 lines
856 B
C++

// Copyright 2004-present Facebook. All Rights Reserved.
#include "JSBundleType.h"
#include <folly/Bits.h>
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;
}
}
const char *stringForScriptTag(const ScriptTag& tag) {
switch (tag) {
case ScriptTag::String:
return "String";
case ScriptTag::RAMBundle:
return "RAM Bundle";
case ScriptTag::BCBundle:
return "BC Bundle";
}
return "";
}
} // namespace react
} // namespace facebook