Merge pull request #5726 from patsul12/fix/loop-protect-triggering-in-comments
Fixes loop protect triggering in comments
This commit is contained in:
@ -50,7 +50,6 @@ if (typeof DEBUG === 'undefined') { DEBUG = true; }
|
|||||||
var openPos = -1;
|
var openPos = -1;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
j -= 1;
|
|
||||||
DEBUG && debug('looking backwards ' + lines[j]); // jshint ignore:line
|
DEBUG && debug('looking backwards ' + lines[j]); // jshint ignore:line
|
||||||
closePos = lines[j].indexOf('*/');
|
closePos = lines[j].indexOf('*/');
|
||||||
openPos = lines[j].indexOf('/*');
|
openPos = lines[j].indexOf('/*');
|
||||||
@ -59,6 +58,11 @@ if (typeof DEBUG === 'undefined') { DEBUG = true; }
|
|||||||
closeCommentTags++;
|
closeCommentTags++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check for single line /* comment */ formatted comments
|
||||||
|
if (closePos === lines[j].length - 2 && openPos !== -1) {
|
||||||
|
closeCommentTags--;
|
||||||
|
}
|
||||||
|
|
||||||
if (openPos !== -1) {
|
if (openPos !== -1) {
|
||||||
closeCommentTags--;
|
closeCommentTags--;
|
||||||
|
|
||||||
@ -67,6 +71,7 @@ if (typeof DEBUG === 'undefined') { DEBUG = true; }
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
j -= 1;
|
||||||
} while (j !== 0);
|
} while (j !== 0);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user