Experimental App Bundle API

Reviewed By: michalgr

Differential Revision: D4198629

fbshipit-source-id: b96a4b3ad3e5ab6b4cb8892442c6077edf7058a3
This commit is contained in:
Ashok Menon
2016-11-18 05:01:09 -08:00
committed by Facebook Github Bot
parent bcac6e7d39
commit 9e00a42fd7
4 changed files with 67 additions and 1 deletions

View File

@@ -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);