Merge pull request #3325 from yglukhov/js-generic-types-fix
Fixed JS gen for generic array types.
This commit is contained in:
commit
272df1e52f
1 changed files with 2 additions and 3 deletions
|
|
@ -116,8 +116,7 @@ proc genEnumInfo(p: PProc, typ: PType, name: Rope) =
|
||||||
[name, genTypeInfo(p, typ.sons[0])])
|
[name, genTypeInfo(p, typ.sons[0])])
|
||||||
|
|
||||||
proc genTypeInfo(p: PProc, typ: PType): Rope =
|
proc genTypeInfo(p: PProc, typ: PType): Rope =
|
||||||
var t = typ
|
let t = typ.skipTypes({tyGenericInst})
|
||||||
if t.kind == tyGenericInst: t = lastSon(t)
|
|
||||||
result = "NTI$1" % [rope(t.id)]
|
result = "NTI$1" % [rope(t.id)]
|
||||||
if containsOrIncl(p.g.typeInfoGenerated, t.id): return
|
if containsOrIncl(p.g.typeInfoGenerated, t.id): return
|
||||||
case t.kind
|
case t.kind
|
||||||
|
|
@ -141,7 +140,7 @@ proc genTypeInfo(p: PProc, typ: PType): Rope =
|
||||||
[result, rope(ord(t.kind))]
|
[result, rope(ord(t.kind))]
|
||||||
prepend(p.g.typeInfo, s)
|
prepend(p.g.typeInfo, s)
|
||||||
addf(p.g.typeInfo, "$1.base = $2;$n",
|
addf(p.g.typeInfo, "$1.base = $2;$n",
|
||||||
[result, genTypeInfo(p, typ.sons[1])])
|
[result, genTypeInfo(p, t.sons[1])])
|
||||||
of tyEnum: genEnumInfo(p, t, result)
|
of tyEnum: genEnumInfo(p, t, result)
|
||||||
of tyObject: genObjectInfo(p, t, result)
|
of tyObject: genObjectInfo(p, t, result)
|
||||||
of tyTuple: genTupleInfo(p, t, result)
|
of tyTuple: genTupleInfo(p, t, result)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue