From 18901149d9bc2bc8d326887f41144e6fbb1f942c Mon Sep 17 00:00:00 2001 From: Geoff Wright Date: Sat, 19 Dec 2015 22:30:56 +0000 Subject: [PATCH] changing loop error message to close issue 5345 --- client/commonFramework/add-loop-protect.js | 6 +++++- client/commonFramework/update-preview.js | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/client/commonFramework/add-loop-protect.js b/client/commonFramework/add-loop-protect.js index 65aebd0ed4..56ad7389b2 100644 --- a/client/commonFramework/add-loop-protect.js +++ b/client/commonFramework/add-loop-protect.js @@ -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); }; diff --git a/client/commonFramework/update-preview.js b/client/commonFramework/update-preview.js index ab99e46a6f..138a9f2fd3 100644 --- a/client/commonFramework/update-preview.js +++ b/client/commonFramework/update-preview.js @@ -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.' ); };