Display infinite loops to user
Also exits early if infinite loop
This commit is contained in:
@ -11,6 +11,7 @@ window.common = (function(global) {
|
||||
<script>
|
||||
window.$ = parent.$.proxy(parent.$.fn.find, parent.$(document));
|
||||
window.loopProtect = parent.loopProtect;
|
||||
window.__err = null;
|
||||
</script>
|
||||
<link
|
||||
rel='stylesheet'
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user