Fixed const sets in JS (#5790)

This commit is contained in:
Yuriy Glukhov 2017-05-10 10:29:30 +03:00 • committed by Andreas Rumpf
commit 6e0e3b75cf
2 changed files with 1 additions and 2 deletions

View file

@ -2272,7 +2272,6 @@ proc myProcess(b: PPassContext, n: PNode): PNode =
genModule(p, n)
add(p.g.code, p.locals)
add(p.g.code, p.body)
globals.unique = p.unique
proc wholeCode(graph: ModuleGraph; m: BModule): Rope =
for prc in globals.forwarded:

View file

@ -59,7 +59,7 @@ proc genObjectFields(p: PProc, typ: PType, n: PNode): Rope =
u = rope(lengthOrd(field.typ))
else: internalError(n.info, "genObjectFields(nkRecCase)")
if result != nil: add(result, ", " & tnl)
addf(result, "[SetConstr($1), $2]",
addf(result, "[setConstr($1), $2]",
[u, genObjectFields(p, typ, lastSon(b))])
result = ("{kind: 3, offset: \"$1\", len: $3, " &
"typ: $2, name: $4, sons: [$5]}") % [