summary refs log tree commit diff stats
path: root/compiler/jsgen.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/jsgen.nim')
-rw-r--r--compiler/jsgen.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim
index 13463cf35..f2e317f47 100644
--- a/compiler/jsgen.nim
+++ b/compiler/jsgen.nim
@@ -1141,6 +1141,8 @@ proc genConstant(p: var TProc, c: PSym, r: var TCompRes) =
   if lfNoDecl notin c.loc.flags and not p.g.generatedSyms.containsOrIncl(c.id):
     genLineDir(p, c.ast, r)
     genVarInit(p, c, c.ast, r)
+    app(p.g.code, r.com)
+    r.com = nil
 
 when false:
   proc genConstStmt(p: var TProc, n: PNode, r: var TCompRes) =