mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
remove || [] from jsgen because string cannot be nil anymore (#23508)
introduced in https://github.com/nim-lang/Nim/pull/9411
This commit is contained in:
@@ -2137,20 +2137,20 @@ proc genConStrStr(p: PProc, n: PNode, r: var TCompRes) =
|
||||
if skipTypes(n[1].typ, abstractVarRange).kind == tyChar:
|
||||
r.res.add("[$1].concat(" % [a.res])
|
||||
else:
|
||||
r.res.add("($1 || []).concat(" % [a.res])
|
||||
r.res.add("($1).concat(" % [a.res])
|
||||
|
||||
for i in 2..<n.len - 1:
|
||||
gen(p, n[i], a)
|
||||
if skipTypes(n[i].typ, abstractVarRange).kind == tyChar:
|
||||
r.res.add("[$1]," % [a.res])
|
||||
else:
|
||||
r.res.add("$1 || []," % [a.res])
|
||||
r.res.add("$1," % [a.res])
|
||||
|
||||
gen(p, n[^1], a)
|
||||
if skipTypes(n[^1].typ, abstractVarRange).kind == tyChar:
|
||||
r.res.add("[$1])" % [a.res])
|
||||
else:
|
||||
r.res.add("$1 || [])" % [a.res])
|
||||
r.res.add("$1)" % [a.res])
|
||||
|
||||
proc genReprAux(p: PProc, n: PNode, r: var TCompRes, magic: string, typ: Rope = "") =
|
||||
useMagic(p, magic)
|
||||
|
||||
Reference in New Issue
Block a user