Skip to content

Commit

Permalink
Generalising JSCompiledSourceError to JSLoadSourceError
Browse files Browse the repository at this point in the history
Reviewed By: javache

Differential Revision: D4312888

fbshipit-source-id: de38066247f52eeb64efa48807882b96e3737d0e
  • Loading branch information
Ashok Menon authored and Facebook Github Bot committed Dec 12, 2016
1 parent 165676f commit fb5678e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ReactCommon/cxxreact/JSCExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,19 +373,19 @@ void JSCExecutor::loadApplicationScript(
{
String jsSourceURL(m_context, sourceURL.c_str());

JSCompiledSourceError jsError;
JSLoadSourceError jsError;
auto bcSourceCode = JSCreateCompiledSourceCode(fd, jsSourceURL, &jsError);

switch (jsError) {
case JSCompiledSourceErrorOnRead:
case JSCompiledSourceErrorNotCompiled:
case JSLoadSourceErrorOnRead:
case JSLoadSourceErrorNotCompiled:
// Not bytecode, fall through.
return JSExecutor::loadApplicationScript(fd, sourceURL);

case JSCompiledSourceErrorVersionMismatch:
case JSLoadSourceErrorVersionMismatch:
throw std::runtime_error("Compiled Source Version Mismatch");

case JSCompiledSourceErrorNone:
case JSLoadSourceErrorNone:
folly::throwOnFail<std::runtime_error>(
bcSourceCode != nullptr,
"Unexpected error opening compiled bundle"
Expand Down

0 comments on commit fb5678e

Please sign in to comment.