From 4cc3d0e4a428bfdafb046f6d3e6d7efe39b3dbbd Mon Sep 17 00:00:00 2001 From: Logan Tegman Date: Mon, 24 Oct 2016 05:26:33 -0700 Subject: [PATCH] Fix loopProtect comment detection --- public/js/lib/loop-protect/loop-protect.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/js/lib/loop-protect/loop-protect.js b/public/js/lib/loop-protect/loop-protect.js index 2ccaf9c027..48fb78d8f1 100644 --- a/public/js/lib/loop-protect/loop-protect.js +++ b/public/js/lib/loop-protect/loop-protect.js @@ -72,7 +72,7 @@ if (typeof DEBUG === 'undefined') { DEBUG = true; } } } j -= 1; - } while (j !== 0); + } while (j >= 0); return false; } @@ -88,8 +88,8 @@ if (typeof DEBUG === 'undefined') { DEBUG = true; } } if (character === '/' || character === '*') { // looks like a comment, go back one to confirm or not - --index; - if (character === '/') { + var prevCharacter = line.substr(index - 1, 1); + if (prevCharacter === '/') { // we've found a comment, so let's exit and ignore this line DEBUG && debug('- exit: part of a comment'); // jshint ignore:line return true;