Hmm, I don't think you're doing anything wrong. That looks like a bug to me... For instance this will work:
function outer() { try { console.log('In outer'); inner(); console.log('Out outer'); } catch(x) { console.log('Catch outer'); } } function inner() { var caught; try { console.log('In inner'); throw "coucou"; console.log('Out inner'); } catch(x) { console.log('Catch inner'+x); caught = x; } if (caught) throw caught; } outer();
I'll make sure I put that in the bug tracker.
To be honest I don't think people generally use exceptions much with Espruino, so it probably hasn't come up before.
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hmm, I don't think you're doing anything wrong. That looks like a bug to me... For instance this will work:
I'll make sure I put that in the bug tracker.
To be honest I don't think people generally use exceptions much with Espruino, so it probably hasn't come up before.