Skip to content

Commit

Permalink
in the .vue file space_after_anon_function is invalid beautifier#1425
Browse files Browse the repository at this point in the history
  • Loading branch information
121595113 committed Jul 30, 2018
1 parent df452fc commit cbc6a79
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/lib/beautify.js
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,13 @@ function Beautifier(js_source_text, options) {
if (last_type === 'TK_WORD' &&
tokens[token_pos - 2] &&
!in_array(tokens[token_pos - 2].type, ['TK_DOT', 'TK_RESERVED']) &&
(previous_flags.parent.mode !== 'Statement' || previous_flags.parent.mode !== 'Expression')) {
(previous_flags.parent.mode !== 'Statement' || previous_flags.parent.mode !== 'Expression') &&
flag_store.length !== 0 &&
flag_store[flag_store.length - 1].last_word !== 'if' &&
flag_store[flag_store.length - 1].last_word !== 'else' &&
flag_store[flag_store.length - 1].last_text !== '=>' &&
flag_store[flag_store.length - 1].last_text !== ')'
) {
output.space_before_token = opt.space_after_function;
}
}
Expand Down

0 comments on commit cbc6a79

Please sign in to comment.