Merge pull request #5974 from ltegman/fix/loop-protect-default-case

Fix loop protect thinking default cases are loop labels
This commit is contained in:
Rex Schrader
2016-01-08 11:56:35 -08:00
2 changed files with 3 additions and 3 deletions

View File

@@ -18,7 +18,7 @@ if (typeof DEBUG === 'undefined') { DEBUG = true; }
// the standard loops - note that recursive is not supported
var re = /\b(for|while|do)\b/g;
var reSingle = /\b(for|while|do)\b/;
var labelRe = /\b([a-z_]{1}\w+:)/i;
var labelRe = /\b(?!default:)([a-z_]{1}\w+:)/i;
var comments = /(?:\/\*(?:[\s\S]*?)\*\/)|(?:([\s;])+\/\/(?:.*)$)/gm;
var loopTimeout = 1000;
@@ -136,7 +136,7 @@ if (typeof DEBUG === 'undefined') { DEBUG = true; }
// so that we insert in to the correct location (instead of possibly
// outside the logic
return line.slice(0, matchPosition) + ';' + method + '({ line: ' + lineNum + ', reset: true }); ' + line.slice(matchPosition);
};
}
if (!offset) {
offset = 0;