+ 6
[JS] Prevent error console from getting too busy with timers [TIP]
<script> tags share context but run independently, so you can step on your own feet if a timer interacts with a console. You may want to cancel timers on first error: [HTML] <head> <!-- Own block, ideally imported as the first script --> <script>window.onerror = function() { halt() } </script> <!-- [JS] auto-insertion point --> </head> [JS] function frame(timestamp) { // return if halt=true, or... } // ...cancel function halt() { stopAnimationFrame / clear Timeout/Interval }
1 ответ
+ 1
xorry no idea