From 3d71e97dd100fe150db3a5585d744e109bfa53ac Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Wed, 14 Oct 2020 16:39:35 +0100 Subject: fix corner cases in `braces` & `sequences` (#4221) fixes #4220 --- lib/output.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/output.js') diff --git a/lib/output.js b/lib/output.js index 7077d6dd..70bd74be 100644 --- a/lib/output.js +++ b/lib/output.js @@ -990,7 +990,7 @@ function OutputStream(options) { /* -----[ if ]----- */ function make_then(self, output) { var b = self.body; - if (output.option("braces") + if (output.option("braces") && !(b instanceof AST_Const) || output.option("ie8") && b instanceof AST_Do) return make_block(b, output); // The squeezer replaces "block"-s that contain only a single @@ -1381,7 +1381,7 @@ function OutputStream(options) { }); function force_statement(stat, output) { - if (output.option("braces")) { + if (output.option("braces") && !(stat instanceof AST_Const)) { make_block(stat, output); } else if (!stat || stat instanceof AST_EmptyStatement) { output.force_semicolon(); -- cgit v1.2.3