Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Funny that you mentioned this as I added some heuristics to my playground [1] yesterday for this use case. It relies on Babel [2] which looks for `for`, `while` and `do-while` loops and injects a counter that throws an 'infinite loop detected' error to prevent the browser freezing. You can opt out if you know what you are doing. It's not perfect, but it covers this base cases.

[1] https://www.jsplayground.dev [2] https://babeljs.io



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: