mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-01 22:41:28 +08:00
Experimental App Bundle API
Reviewed By: michalgr Differential Revision: D4198629 fbshipit-source-id: b96a4b3ad3e5ab6b4cb8892442c6077edf7058a3
This commit is contained in:
committed by
Facebook Github Bot
parent
bcac6e7d39
commit
9e00a42fd7
@@ -363,6 +363,35 @@ void JSCExecutor::loadApplicationScript(
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WITH_FBJSCEXTENSIONS
|
||||
void JSCExecutor::loadApplicationScript(
|
||||
int fd,
|
||||
std::string sourceURL)
|
||||
{
|
||||
String jsSourceURL {sourceURL.c_str()};
|
||||
|
||||
auto bcSourceCode = JSCreateCompiledSourceCode(fd, jsSourceURL);
|
||||
if (!bcSourceCode) {
|
||||
// Not bytecode, fall through.
|
||||
return JSExecutor::loadApplicationScript(fd, sourceURL);
|
||||
}
|
||||
|
||||
ReactMarker::logMarker("RUN_JS_BUNDLE_START");
|
||||
|
||||
evaluateSourceCode(m_context, bcSourceCode, jsSourceURL);
|
||||
|
||||
// TODO(luk): t13903306 Remove this check once we make native modules
|
||||
// working for java2js
|
||||
if (m_delegate) {
|
||||
bindBridge();
|
||||
flush();
|
||||
}
|
||||
|
||||
ReactMarker::logMarker("CREATE_REACT_CONTEXT_END");
|
||||
ReactMarker::logMarker("RUN_JS_BUNDLE_END");
|
||||
}
|
||||
#endif
|
||||
|
||||
void JSCExecutor::loadApplicationScript(std::unique_ptr<const JSBigString> script, std::string sourceURL) throw(JSException) {
|
||||
SystraceSection s("JSCExecutor::loadApplicationScript",
|
||||
"sourceURL", sourceURL);
|
||||
|
||||
Reference in New Issue
Block a user