From 9d9c40e21e185813ef998145f0d0e93eceff20a1 Mon Sep 17 00:00:00 2001 From: Alex Rodin Date: Sat, 27 Aug 2022 12:57:43 -0300 Subject: [PATCH] JS: Fix EmptyStmt Semicolon duplication when converts the ast back JavaScript --- js/ast.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/ast.go b/js/ast.go index f169577..9ccf67c 100644 --- a/js/ast.go +++ b/js/ast.go @@ -384,7 +384,9 @@ func (n BlockStmt) JS() string { s += "{ " } for _, item := range n.List { - s += item.JS() + "; " + if _, isEmpty := item.(*EmptyStmt); !isEmpty { + s += item.JS() + "; " + } } if n.Scope.Parent != nil { s += "}"