changing loop error message to close issue 5345

pull/5378/head
Geoff Wright 2015-12-19 22:30:56 +00:00 committed by Geoffrey Wright
parent 8331d90d20
commit 18901149d9
2 changed files with 10 additions and 2 deletions

View File

@ -5,7 +5,11 @@ window.common = (function(global) {
} = global;
loopProtect.hit = function hit(line) {
var err = `Error: Exiting potential infinite loop at line ${line}.`;
var err = 'Error: Exiting potential infinite loop at line ' +
line +
'. To disable loop protection, write: \n\\/\\/ noprotect\nas the first' +
'line. Beware that if you do have an infinite loop in your code' +
'this will crash your browser.';
console.error(err);
};

View File

@ -13,7 +13,11 @@ window.common = (function(global) {
window.__err = null;
window.loopProtect.hit = function(line) {
window.__err = new Error(
'Potential infinite loop at line ' + line
'Potential infinite loop at line ' +
line +
'. To disable loop protection, write: \\n\\/\\/ noprotect\\nas the first' +
' line. Beware that if you do have an infinite loop in your code' +
' this will crash your browser.'
);
};
</script>