Merge pull request #5378 from geoff616/fix/loop-disable-error-message
More descriptive error message for disabling loop protection
This commit is contained in:
@ -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);
|
||||
};
|
||||
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user