tbel: add break to for, foreach, while, do, doUntil
This commit is contained in:
parent
9c57108a59
commit
a836b4eba4
@ -4661,6 +4661,7 @@ var JSHINT = (function() {
|
|||||||
case "in":
|
case "in":
|
||||||
case "instanceof":
|
case "instanceof":
|
||||||
case "return":
|
case "return":
|
||||||
|
case "until":
|
||||||
case "switch":
|
case "switch":
|
||||||
case "throw":
|
case "throw":
|
||||||
case "try":
|
case "try":
|
||||||
@ -5388,6 +5389,7 @@ var JSHINT = (function() {
|
|||||||
}
|
}
|
||||||
switch (state.funct["(verb)"]) {
|
switch (state.funct["(verb)"]) {
|
||||||
case "break":
|
case "break":
|
||||||
|
case "until":
|
||||||
case "continue":
|
case "continue":
|
||||||
case "return":
|
case "return":
|
||||||
case "throw":
|
case "throw":
|
||||||
@ -7692,6 +7694,20 @@ var JSHINT = (function() {
|
|||||||
return this;
|
return this;
|
||||||
}).labelled = true;
|
}).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) {
|
blockstmt("with", function(context) {
|
||||||
var t = state.tokens.next;
|
var t = state.tokens.next;
|
||||||
if (state.isStrict()) {
|
if (state.isStrict()) {
|
||||||
@ -7841,7 +7857,12 @@ var JSHINT = (function() {
|
|||||||
increaseComplexityCount();
|
increaseComplexityCount();
|
||||||
|
|
||||||
this.first = block(context, true, true);
|
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;
|
var t = state.tokens.next;
|
||||||
advance("(");
|
advance("(");
|
||||||
checkCondAssignment(expression(context, 0));
|
checkCondAssignment(expression(context, 0));
|
||||||
@ -9758,7 +9779,7 @@ Lexer.prototype = {
|
|||||||
var keywords = [
|
var keywords = [
|
||||||
"if", "in", "do", "var", "for", "foreach", "new",
|
"if", "in", "do", "var", "for", "foreach", "new",
|
||||||
"try", "let", "this", "else", "case",
|
"try", "let", "this", "else", "case",
|
||||||
"void", "with", "enum", "while", "break",
|
"void", "with", "enum", "while", "until", "break",
|
||||||
"catch", "throw", "const", "yield", "class",
|
"catch", "throw", "const", "yield", "class",
|
||||||
"super", "return", "typeof", "delete",
|
"super", "return", "typeof", "delete",
|
||||||
"switch", "export", "import", "default",
|
"switch", "export", "import", "default",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user