Merge pull request #5726 from patsul12/fix/loop-protect-triggering-in-comments

Fixes loop protect triggering in comments
This commit is contained in:
Logan Tegman
2016-01-08 09:15:18 -08:00

View File

@ -50,7 +50,6 @@ if (typeof DEBUG === 'undefined') { DEBUG = true; }
var openPos = -1;
do {
j -= 1;
DEBUG && debug('looking backwards ' + lines[j]); // jshint ignore:line
closePos = lines[j].indexOf('*/');
openPos = lines[j].indexOf('/*');
@ -59,6 +58,11 @@ if (typeof DEBUG === 'undefined') { DEBUG = true; }
closeCommentTags++;
}
// check for single line /* comment */ formatted comments
if (closePos === lines[j].length - 2 && openPos !== -1) {
closeCommentTags--;
}
if (openPos !== -1) {
closeCommentTags--;
@ -67,6 +71,7 @@ if (typeof DEBUG === 'undefined') { DEBUG = true; }
return true;
}
}
j -= 1;
} while (j !== 0);
return false;