js-beautify icon indicating copy to clipboard operation
js-beautify copied to clipboard

issue prettifying (function(){code();{code}})()

Open divinity76 opened this issue 4 years ago • 0 comments

Description

the code does not look pretty after "prettifying"

Input

The code looked like this before beautification:

(function() {
  	some_code_here();
    {
        /* IE11 let bug bypass */
        let index;
        for (index in a) {
            a[index];
        }
    }
})();

Current Output

The code actually looked like this after beautification:

(function() {
    some_code_here(); {
        /* IE11 let bug bypass */
        let index;
        for (index in a) {
            a[index];
        }
    }
})();

Expected Output

The code should have looked something like this after beautification:

(function() {
    some_code_here();
    {
        /* IE11 let bug bypass */
        let index;
        for (index in a) {
            a[index];
        }
    }
})();

Environment

Browser User Agent:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36

Language Selected: Beautify JavaScript

Settings

(just the default)

{
  "indent_size": "4",
  "indent_char": " ",
  "max_preserve_newlines": "5",
  "preserve_newlines": true,
  "keep_array_indentation": false,
  "break_chained_methods": false,
  "indent_scripts": "normal",
  "brace_style": "collapse",
  "space_before_conditional": true,
  "unescape_strings": false,
  "jslint_happy": false,
  "end_with_newline": false,
  "wrap_line_length": "0",
  "indent_inner_html": false,
  "comma_first": false,
  "e4x": false,
  "indent_empty_lines": false
}

divinity76 avatar Oct 25 '20 20:10 divinity76