diff options
Diffstat (limited to 'lib/output.js')
-rw-r--r-- | lib/output.js | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/output.js b/lib/output.js index 6d0dac5a..b7bcd1e3 100644 --- a/lib/output.js +++ b/lib/output.js @@ -61,7 +61,6 @@ function OutputStream(options) { comments : false, preserve_line : false, screw_ie8 : false, - negate_iife : !(options && options.beautify), }, true); var indentation = 0; @@ -351,21 +350,17 @@ function OutputStream(options) { AST_Node.DEFMETHOD("print", function(stream, force_parens){ var self = this, generator = self._codegen; - stream.push_node(self); - var needs_parens = self.needs_parens(stream); - var fc = self instanceof AST_Function && stream.option("negate_iife"); - if (force_parens || (needs_parens && !fc)) { - stream.with_parens(function(){ - self.add_comments(stream); - self.add_source_map(stream); - generator(self, stream); - }); - } else { + function doit() { self.add_comments(stream); - if (needs_parens && fc) stream.print("!"); self.add_source_map(stream); generator(self, stream); } + stream.push_node(self); + if (force_parens || self.needs_parens(stream)) { + stream.with_parens(doit); + } else { + doit(); + } stream.pop_node(); }); |