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:
juxiliary
2014-12-06 21:57:20 +10:00
parent 898501d9d1
commit cd0f17202e
2 changed files with 35 additions and 1 deletions

View File

@@ -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)