add a check for single line, multi-line formatted comments, to prevent loop protect from triggering in these instances

This commit is contained in:
patsul12
2016-01-01 14:31:07 -08:00
parent 057b5eacd7
commit 568259d897

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;