Skip to content

Commit

Permalink
Merge pull request #100 from nidorx/fix/emptystmt-semicolon-dup
Browse files Browse the repository at this point in the history
JS: Fix EmptyStmt Semicolon duplication when converts the AST to JS
  • Loading branch information
tdewolff authored Aug 28, 2022
2 parents 838debd + 9d9c40e commit e5690f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 += "}"
Expand Down

0 comments on commit e5690f8

Please sign in to comment.