tbel: add break to for, foreach, while, do, doUntil

This commit is contained in:
nick 2023-08-16 18:08:02 +03:00
parent 9c57108a59
commit a836b4eba4

View File

@ -4661,6 +4661,7 @@ var JSHINT = (function() {
case "in":
case "instanceof":
case "return":
case "until":
case "switch":
case "throw":
case "try":
@ -5388,6 +5389,7 @@ var JSHINT = (function() {
}
switch (state.funct["(verb)"]) {
case "break":
case "until":
case "continue":
case "return":
case "throw":
@ -7692,6 +7694,20 @@ var JSHINT = (function() {
return this;
}).labelled = true;
blockstmt("until", function(context) {
var t = state.tokens.next;
state.funct["(breakage)"] += 1;
state.funct["(loopage)"] += 1;
increaseComplexityCount();
advance("(");
checkCondAssignment(expression(context, 0));
advance(")", t);
block(context, true, true);
state.funct["(breakage)"] -= 1;
state.funct["(loopage)"] -= 1;
return this;
}).labelled = true;
blockstmt("with", function(context) {
var t = state.tokens.next;
if (state.isStrict()) {
@ -7841,7 +7857,12 @@ var JSHINT = (function() {
increaseComplexityCount();
this.first = block(context, true, true);
advance("while");
var s = state.tokens.next;
if (s.value !== "while") {
advance("until");
} else {
advance("while");
}
var t = state.tokens.next;
advance("(");
checkCondAssignment(expression(context, 0));
@ -9758,7 +9779,7 @@ Lexer.prototype = {
var keywords = [
"if", "in", "do", "var", "for", "foreach", "new",
"try", "let", "this", "else", "case",
"void", "with", "enum", "while", "break",
"void", "with", "enum", "while", "until", "break",
"catch", "throw", "const", "yield", "class",
"super", "return", "typeof", "delete",
"switch", "export", "import", "default",