options = defaults(options, {
ascii_only : false,
beautify : false,
- bracketize : false,
+ braces : false,
comments : false,
ie8 : false,
indent_level : 4,
self.body.print(output);
output.semicolon();
});
- function print_bracketed_empty(self, output) {
+ function print_braced_empty(self, output) {
output.print("{");
output.with_indent(output.next_indent(), function() {
output.append_comments(self, true);
});
output.print("}");
}
- function print_bracketed(self, output, allow_directives) {
+ function print_braced(self, output, allow_directives) {
if (self.body.length > 0) {
output.with_block(function() {
display_body(self.body, false, output, allow_directives);
});
- } else print_bracketed_empty(self, output);
+ } else print_braced_empty(self, output);
};
DEFPRINT(AST_BlockStatement, function(self, output){
- print_bracketed(self, output);
+ print_braced(self, output);
});
DEFPRINT(AST_EmptyStatement, function(self, output){
output.semicolon();
});
});
output.space();
- print_bracketed(self, output, true);
+ print_braced(self, output, true);
});
DEFPRINT(AST_Lambda, function(self, output){
self._do_print(output);
/* -----[ if ]----- */
function make_then(self, output) {
var b = self.body;
- if (output.option("bracketize")
+ if (output.option("braces")
|| output.option("ie8") && b instanceof AST_Do)
return make_block(b, output);
// The squeezer replaces "block"-s that contain only a single
// IF having an ELSE clause where the THEN clause ends in an
// IF *without* an ELSE block (then the outer ELSE would refer
// to the inner IF). This function checks for this case and
- // adds the block brackets if needed.
+ // adds the block braces if needed.
if (!b) return output.force_semicolon();
while (true) {
if (b instanceof AST_If) {
});
output.space();
var last = self.body.length - 1;
- if (last < 0) print_bracketed_empty(self, output);
+ if (last < 0) print_braced_empty(self, output);
else output.with_block(function(){
self.body.forEach(function(branch, i){
output.indent(true);
DEFPRINT(AST_Try, function(self, output){
output.print("try");
output.space();
- print_bracketed(self, output);
+ print_braced(self, output);
if (self.bcatch) {
output.space();
self.bcatch.print(output);
self.argname.print(output);
});
output.space();
- print_bracketed(self, output);
+ print_braced(self, output);
});
DEFPRINT(AST_Finally, function(self, output){
output.print("finally");
output.space();
- print_bracketed(self, output);
+ print_braced(self, output);
});
/* -----[ var/const ]----- */
});
output.newline();
});
- else print_bracketed_empty(self, output);
+ else print_braced_empty(self, output);
});
function print_property_name(key, quote, output) {
});
function force_statement(stat, output) {
- if (output.option("bracketize")) {
+ if (output.option("braces")) {
make_block(stat, output);
} else {
if (!stat || stat instanceof AST_EmptyStatement)