Skip to content

Commit

Permalink
Fix WSH-related bug: don't use array.indexOf()
Browse files Browse the repository at this point in the history
  • Loading branch information
Infocatcher committed Nov 23, 2015
1 parent 8a92a0f commit f20d1e3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion jsBeautifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ function detectXMLType(str) {
// a.b('c',
// () => d.e
// )
if (current_token.text === '(' && ['TK_WORD', 'TK_RESERVED'].indexOf(last_type) === -1) {
if (current_token.text === '(' && last_type !== 'TK_WORD' && last_type !== 'TK_RESERVED') {
allow_wrap_or_preserved_newline();
}

Expand Down Expand Up @@ -8046,6 +8046,13 @@ function convertSource(file, text) {
"$& tl.restore();\r\n"
);
}
else if(file == "js/lib/beautify.js") {
text = text
.replace(
"['TK_WORD', 'TK_RESERVED'].indexOf(last_type) === -1",
"last_type !== 'TK_WORD' && last_type !== 'TK_RESERVED'"
);
}
return text;
}
function selfUpdate() {
Expand Down

0 comments on commit f20d1e3

Please sign in to comment.