react-juce
react-juce copied to clipboard
Gracefully Handle EcmascriptEngine::Error thrown outside of ReactApplicationRoot call stack
The duktape pimpl LambdaHelper::invokeFromDukContext can lead to a throw from safeCall that isn't caught when the invocation came from a timer callback, e.g.
setTimeout(()=> {
clearTimeout("a bad argument causing throw");
}, 1000);
This then leads to program termination!
Instead a way to call ReactApplicationRoot::handleRuntimeError would be good. E.g. if EcmascriptEngine carries a reference to the owning ReactApplicationRoot for use in safeCall or something better.