Fix loopProtect comment detection

pull/11361/head
Logan Tegman 2016-10-24 05:26:33 -07:00 committed by Stuart Taylor
parent 3a48daaa21
commit 4cc3d0e4a4
1 changed files with 3 additions and 3 deletions

View File

@ -72,7 +72,7 @@ if (typeof DEBUG === 'undefined') { DEBUG = true; }
} }
} }
j -= 1; j -= 1;
} while (j !== 0); } while (j >= 0);
return false; return false;
} }
@ -88,8 +88,8 @@ if (typeof DEBUG === 'undefined') { DEBUG = true; }
} }
if (character === '/' || character === '*') { if (character === '/' || character === '*') {
// looks like a comment, go back one to confirm or not // looks like a comment, go back one to confirm or not
--index; var prevCharacter = line.substr(index - 1, 1);
if (character === '/') { if (prevCharacter === '/') {
// we've found a comment, so let's exit and ignore this line // we've found a comment, so let's exit and ignore this line
DEBUG && debug('- exit: part of a comment'); // jshint ignore:line DEBUG && debug('- exit: part of a comment'); // jshint ignore:line
return true; return true;