diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-11-05 13:09:39 +0200 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-11-05 13:09:39 +0200 |
commit | 85af942d64e007524d76454baf80011c3ecda2ce (patch) | |
tree | 027b40a9ff7d9fa08e1583db890841695a2d3f2a /lib/output.js | |
parent | 8413787efc6dd570b5cc48dec65e5ffe1a32084a (diff) | |
download | tracifyjs-85af942d64e007524d76454baf80011c3ecda2ce.tar.gz tracifyjs-85af942d64e007524d76454baf80011c3ecda2ce.zip |
print final semicolon
close #28
Diffstat (limited to 'lib/output.js')
-rw-r--r-- | lib/output.js | 3 |
1 files changed, 2 insertions, 1 deletions
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); |