From: Mihai Bazon Date: Mon, 5 Nov 2012 11:09:39 +0000 (+0200) Subject: print final semicolon X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=85af942d64e007524d76454baf80011c3ecda2ce;p=UglifyJS.git print final semicolon close #28 --- diff --git a/lib/output.js b/lib/output.js index 4b515ecd..ab44222f 100644 --- a/lib/output.js +++ b/lib/output.js @@ -137,7 +137,7 @@ function OutputStream(options) { str = String(str); var ch = str.charAt(0); if (might_need_semicolon) { - if (";}".indexOf(ch) < 0 && !/[;]$/.test(last)) { + if ((!ch || ";}".indexOf(ch) < 0) && !/[;]$/.test(last)) { if (options.semicolons || requireSemicolonChars(ch)) { OUTPUT += ";"; current_col++; @@ -529,6 +529,7 @@ function OutputStream(options) { }); DEFPRINT(AST_Toplevel, function(self, output){ display_body(self.body, true, output); + output.print(""); }); DEFPRINT(AST_LabeledStatement, function(self, output){ self.label.print(output);