mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-24 08:15:25 +00:00
Fixing extraneous semicolon in jsgen output
jsgen was producing javascript objects like this
```
{, name:"foo"}
```
causing syntax errors in javascript interpretors.
This commit is contained in:
@@ -1431,7 +1431,7 @@ proc genObjConstr(p: PProc, n: PNode, r: var TCompRes) =
|
||||
r.res = toRope("{")
|
||||
r.kind = resExpr
|
||||
for i in countup(1, sonsLen(n) - 1):
|
||||
if i > 0: app(r.res, ", ")
|
||||
if i > 1: app(r.res, ", ")
|
||||
var it = n.sons[i]
|
||||
internalAssert it.kind == nkExprColonExpr
|
||||
gen(p, it.sons[1], a)
|
||||
|
||||
Reference in New Issue
Block a user