Fix minor array indenting issue

This commit is contained in:
Einar Lielmanis 2010-03-02 00:24:05 +02:00
parent 1d912103a5
commit daa5e3e183
2 changed files with 5 additions and 1 deletions

View File

@ -305,5 +305,7 @@ function run_beautifier_tests(test_obj)
bt("a = ['a','b','c']", "a = ['a', 'b', 'c']");
bt("a = ['a', 'b','c']", "a = ['a', 'b', 'c']");
bt('{a([[a1]], {b;});}', '{\n a([[a1]], {\n b;\n });\n}');
return sanitytest;
}

View File

@ -656,7 +656,9 @@ function js_beautify(js_source_text, options) {
case 'TK_END_EXPR':
if (token_text === ']') {
if (flags.mode === '[INDENTED-EXPRESSION]') {
unindent();
if (!opt_keep_array_indentation) {
unindent();
}
if (last_text === ']') {
print_newline();
}