WebOfTrustInfo/satyrn

bad code is BAD

Closed this issue · 3 comments

I forced a crash by removing the closing quote on a console.log (using the latest default.md works great to reproduce this). When I run it, the dev console gets

Uncaught SyntaxError: Invalid or unexpected token
at Object.run (satyrnicon.js:41)
at HTMLElement.onclick (app.html:1)
And the div got an ellipsis it seemed. "...."

That seemed reasonable, although we should catch the exception, it seemed ok.

But then I fixed the typo and ran the code again, and the app fell over:

satyrnicon.js:31 Uncaught RangeError: Maximum call stack size exceeded
at console.log [as oldLog] (satyrnicon.js:31)
at console.log [as oldLog] (satyrnicon.js:33)
at console.log [as oldLog] (satyrnicon.js:33)
at console.log [as oldLog] (satyrnicon.js:33)
at console.log [as oldLog] (satyrnicon.js:33)
at console.log [as oldLog] (satyrnicon.js:33)
at console.log [as oldLog] (satyrnicon.js:33)
at console.log [as oldLog] (satyrnicon.js:33)
at console.log [as oldLog] (satyrnicon.js:33)
at console.log [as oldLog] (satyrnicon.js:33)

This happens every time I run the now corrected code.

FWIW, reloading the file works fine (restores the context to a viable one). So the separation between main and rendering helps a lot, but we should handle this explicitly.

This issue was moved by jandrieu to satyrnjs/satyrn#19.