summary refs log tree commit diff stats
path: root/compiler/jsgen.nim
diff options
context:
space:
mode:
authorhlaaftana <10591326+hlaaftana@users.noreply.github.com>2020-02-22 22:04:46 +0300
committerGitHub <noreply@github.com>2020-02-22 20:04:46 +0100
commit13d292786e5a43b23f9a48643744c121c244b6ed (patch)
treeb66cc171d7c416097ffb55d983a11328d0fe9a62 /compiler/jsgen.nim
parentc11b91d52db77de4958a504966b353d53f6404ae (diff)
downloadNim-13d292786e5a43b23f9a48643744c121c244b6ed.tar.gz
Remove genToArray in jsgen, a PHP remnant (#13466)
Diffstat (limited to 'compiler/jsgen.nim')
-rw-r--r--compiler/jsgen.nim20
1 files changed, 0 insertions, 20 deletions
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim
index d63856b87..51d23662c 100644
--- a/compiler/jsgen.nim
+++ b/compiler/jsgen.nim
@@ -1795,26 +1795,6 @@ proc genConStrStr(p: PProc, n: PNode, r: var TCompRes) =
   else:
     r.res.add("$1 || [])" % [a.res])
 
-proc genToArray(p: PProc; n: PNode; r: var TCompRes) =
-  # we map mArray to PHP's array constructor, a mild hack:
-  var a, b: TCompRes
-  r.kind = resExpr
-  r.res = rope("array(")
-  let x = skipConv(n[1])
-  if x.kind == nkBracket:
-    for i in 0..<x.len:
-      let it = x[i]
-      if it.kind in {nkPar, nkTupleConstr} and it.len == 2:
-        if i > 0: r.res.add(", ")
-        gen(p, it[0], a)
-        gen(p, it[1], b)
-        r.res.add("$# => $#" % [a.rdLoc, b.rdLoc])
-      else:
-        localError(p.config, it.info, "'toArray' needs tuple constructors")
-  else:
-    localError(p.config, x.info, "'toArray' needs an array literal")
-  r.res.add(")")
-
 proc genReprAux(p: PProc, n: PNode, r: var TCompRes, magic: string, typ: Rope = nil) =
   useMagic(p, magic)
   r.res.add(magic & "(")