Display infinite loops to user

Also exits early if infinite loop
This commit is contained in:
Berkeley Martinez
2015-12-01 17:38:48 -08:00
parent f904f91f97
commit 636824aba3
2 changed files with 7 additions and 0 deletions

View File

@@ -10,6 +10,12 @@ window.$(document).ready(function() {
var tests = parent.tests;
var common = parent.common;
window.loopProtect.hit = function(line) {
window.__err = new Error(
'Potential infinite loop at line ' + line
);
};
common.getJsOutput = function evalJs(code = '') {
let output;
try {