Skip to content

Commit

Permalink
fixes #20219; ignore comment/empty node in stmtListExpr (#20249)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout authored Aug 24, 2022
1 parent 0014b9c commit 9d9ecc3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/jsgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ proc isSimpleExpr(p: PProc; n: PNode): bool =
for c in n:
if not p.isSimpleExpr(c): return false
result = true
elif n.kind == nkStmtListExpr:
for i in 0..<n.len-1:
if n[i].kind notin {nkCommentStmt, nkEmpty}: return false
result = isSimpleExpr(p, n.lastSon)
elif n.isAtom:
result = true

Expand Down

0 comments on commit 9d9ecc3

Please sign in to comment.