Fixing RN Debugger
Reviewed By: cwdick, javache Differential Revision: D4409257 fbshipit-source-id: 062c798d1a1c9ad90884599ed262412c1dd51359
This commit is contained in:
parent
545072b02d
commit
154e183344
|
@ -73,10 +73,16 @@ void Instance::loadScriptFromFile(const std::string& filename,
|
||||||
"fileName", filename);
|
"fileName", filename);
|
||||||
|
|
||||||
std::unique_ptr<const JSBigFileString> script;
|
std::unique_ptr<const JSBigFileString> script;
|
||||||
RecoverableError::runRethrowingAsRecoverable<std::system_error>(
|
|
||||||
[&filename, &script]() {
|
// This function can be called in order to change the Bridge's Source URL.
|
||||||
script = JSBigFileString::fromPath(filename);
|
// In that case, the filename will be empty, and we should not attempt to
|
||||||
});
|
// load it.
|
||||||
|
if (!filename.empty()) {
|
||||||
|
RecoverableError::runRethrowingAsRecoverable<std::system_error>(
|
||||||
|
[&filename, &script]() {
|
||||||
|
script = JSBigFileString::fromPath(filename);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
nativeToJsBridge_->loadApplication(nullptr, std::move(script), sourceURL);
|
nativeToJsBridge_->loadApplication(nullptr, std::move(script), sourceURL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue