diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index 7932929530..d95c2cfbba 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -1632,7 +1632,7 @@ proc createVar(p: PProc, typ: PType, indirect: bool): Rope = of tyObject: var initList: Rope createObjInitList(p, t, initIntSet(), initList) - result = ("{$1}") % [initList] + result = ("({$1})") % [initList] if indirect: result = "[$1]" % [result] of tyVar, tyPtr, tyLent, tyRef, tyPointer: if mapType(p, t) == etyBaseIndex: