Generalising JSCompiledSourceError to JSLoadSourceError
Reviewed By: javache Differential Revision: D4312888 fbshipit-source-id: de38066247f52eeb64efa48807882b96e3737d0e
This commit is contained in:
parent
165676fa5d
commit
fb5678e33a
|
@ -373,19 +373,19 @@ void JSCExecutor::loadApplicationScript(
|
||||||
{
|
{
|
||||||
String jsSourceURL(m_context, sourceURL.c_str());
|
String jsSourceURL(m_context, sourceURL.c_str());
|
||||||
|
|
||||||
JSCompiledSourceError jsError;
|
JSLoadSourceError jsError;
|
||||||
auto bcSourceCode = JSCreateCompiledSourceCode(fd, jsSourceURL, &jsError);
|
auto bcSourceCode = JSCreateCompiledSourceCode(fd, jsSourceURL, &jsError);
|
||||||
|
|
||||||
switch (jsError) {
|
switch (jsError) {
|
||||||
case JSCompiledSourceErrorOnRead:
|
case JSLoadSourceErrorOnRead:
|
||||||
case JSCompiledSourceErrorNotCompiled:
|
case JSLoadSourceErrorNotCompiled:
|
||||||
// Not bytecode, fall through.
|
// Not bytecode, fall through.
|
||||||
return JSExecutor::loadApplicationScript(fd, sourceURL);
|
return JSExecutor::loadApplicationScript(fd, sourceURL);
|
||||||
|
|
||||||
case JSCompiledSourceErrorVersionMismatch:
|
case JSLoadSourceErrorVersionMismatch:
|
||||||
throw std::runtime_error("Compiled Source Version Mismatch");
|
throw std::runtime_error("Compiled Source Version Mismatch");
|
||||||
|
|
||||||
case JSCompiledSourceErrorNone:
|
case JSLoadSourceErrorNone:
|
||||||
folly::throwOnFail<std::runtime_error>(
|
folly::throwOnFail<std::runtime_error>(
|
||||||
bcSourceCode != nullptr,
|
bcSourceCode != nullptr,
|
||||||
"Unexpected error opening compiled bundle"
|
"Unexpected error opening compiled bundle"
|
||||||
|
|
Loading…
Reference in New Issue