Increase loop protect timeout
This commit is contained in:
@ -20,6 +20,7 @@ if (typeof DEBUG === 'undefined') { DEBUG = true; }
|
|||||||
var reSingle = /\b(for|while|do)\b/;
|
var reSingle = /\b(for|while|do)\b/;
|
||||||
var labelRe = /\b([a-z_]{1}\w+:)/i;
|
var labelRe = /\b([a-z_]{1}\w+:)/i;
|
||||||
var comments = /(?:\/\*(?:[\s\S]*?)\*\/)|(?:([\s;])+\/\/(?:.*)$)/gm;
|
var comments = /(?:\/\*(?:[\s\S]*?)\*\/)|(?:([\s;])+\/\/(?:.*)$)/gm;
|
||||||
|
var loopTimeout = 500;
|
||||||
|
|
||||||
var loopProtect = rewriteLoops;
|
var loopProtect = rewriteLoops;
|
||||||
|
|
||||||
@ -404,8 +405,7 @@ if (typeof DEBUG === 'undefined') { DEBUG = true; }
|
|||||||
}
|
}
|
||||||
|
|
||||||
line.hit++;
|
line.hit++;
|
||||||
if ((now - line.time) > 100) {//} && line.hit !== line.last+1) {
|
if ((now - line.time) > loopTimeout) {//} && line.hit !== line.last+1) {
|
||||||
// We've spent over 100ms on this loop... smells infinite.
|
|
||||||
loopProtect.hit(state.line);
|
loopProtect.hit(state.line);
|
||||||
// Returning true prevents the loop running again
|
// Returning true prevents the loop running again
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user