Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 691 Bytes

README.md

File metadata and controls

9 lines (5 loc) · 691 Bytes

Infinite Loop Buster!

Stop infinite loops before they happen.

This takes a string of JavaScript and alters it to ensure that infinite loops are broken, but otherwise doesn't affect the code. The purpose is so you can run it without fear of freezing the browser. Online code editors like CodePen are the use-case.

This uses Esprima to create an abstract syntax tree out of the JavaScript and do the instrumenting. Esprima is the only dependency, it doesn't require any additional libraries to output back to a string of JavaScript.

Ariya Hidayat is the creator of Esprima, and largely wrote this version of the Infinite Loop Buster as well. Thanks so much, Ariya!