From 14481de0e9141eff41877f56876f7e6a78c3d059 Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Mon, 17 Sep 2012 12:03:02 +0300 Subject: [PATCH] empty block to empty statement: {} ==> ; --- lib/compress.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/compress.js b/lib/compress.js index ddb4437b..7b865fdd 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -759,8 +759,10 @@ function Compressor(options, false_by_default) { }); AST_BlockStatement.DEFMETHOD("optimize", function(compressor){ - if (this.body.length == 1) - return this.body[0]; + switch (this.body.length) { + case 1: return this.body[0]; + case 0: return make_node(AST_EmptyStatement, this); + } return this; }); -- 2.34.1