Skip to content

Commit ab455f2

Browse files
Dominator008marijnh
authored andcommitted
[dtd mode] Fix code that lacks side-effects
The 6 "n"s are reported as suspicious code by Closure Compiler. They can just be empty statements instead.
1 parent aa0b249 commit ab455f2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mode/dtd/dtd.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,17 @@ CodeMirror.defineMode("dtd", function(config) {
114114

115115
if( textAfter.match(/\]\s+|\]/) )n=n-1;
116116
else if(textAfter.substr(textAfter.length-1, textAfter.length) === ">"){
117-
if(textAfter.substr(0,1) === "<")n;
118-
else if( type == "doindent" && textAfter.length > 1 )n;
117+
if(textAfter.substr(0,1) === "<") {}
118+
else if( type == "doindent" && textAfter.length > 1 ) {}
119119
else if( type == "doindent")n--;
120-
else if( type == ">" && textAfter.length > 1)n;
121-
else if( type == "tag" && textAfter !== ">")n;
120+
else if( type == ">" && textAfter.length > 1) {}
121+
else if( type == "tag" && textAfter !== ">") {}
122122
else if( type == "tag" && state.stack[state.stack.length-1] == "rule")n--;
123123
else if( type == "tag")n++;
124124
else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule" && type === ">")n--;
125-
else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule")n;
125+
else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule") {}
126126
else if( textAfter.substr(0,1) !== "<" && textAfter.substr(0,1) === ">" )n=n-1;
127-
else if( textAfter === ">")n;
127+
else if( textAfter === ">") {}
128128
else n=n-1;
129129
//over rule them all
130130
if(type == null || type == "]")n--;

0 commit comments

Comments
 (0)