react-juce icon indicating copy to clipboard operation
react-juce copied to clipboard

Gracefully Handle EcmascriptEngine::Error thrown outside of ReactApplicationRoot call stack

Open olidacombe opened this issue 5 years ago • 0 comments

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.

olidacombe avatar Dec 28 '20 15:12 olidacombe