mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
56689e9e28
Summary: Changelog: [Internal] A long time ago we experimented with JSC bytecode. We are not experimenting with JSC bytecode any more. This code can be removed. Reviewed By: mhorowitz Differential Revision: D22017374 fbshipit-source-id: 6fe3fb7ad7966f92a5cd103605ac5c0bd1f17a8e
38 lines
816 B
C++
38 lines
816 B
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#include "JSBundleType.h"
|
|
|
|
#include <folly/Bits.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
static uint32_t constexpr RAMBundleMagicNumber = 0xFB0BD1E5;
|
|
|
|
ScriptTag parseTypeFromHeader(const BundleHeader &header) {
|
|
switch (folly::Endian::little(header.magic)) {
|
|
case RAMBundleMagicNumber:
|
|
return ScriptTag::RAMBundle;
|
|
default:
|
|
return ScriptTag::String;
|
|
}
|
|
}
|
|
|
|
const char *stringForScriptTag(const ScriptTag &tag) {
|
|
switch (tag) {
|
|
case ScriptTag::String:
|
|
return "String";
|
|
case ScriptTag::RAMBundle:
|
|
return "RAM Bundle";
|
|
}
|
|
return "";
|
|
}
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|