Skip to content

Commit

Permalink
fixes #23382; gives compiler errors for closure iterators in JS (#23398)
Browse files Browse the repository at this point in the history
fixes #23382
follow up #15823
  • Loading branch information
ringabout authored Mar 14, 2024
1 parent 78c834d commit 7c11da3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/jsgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2959,7 +2959,9 @@ proc gen(p: PProc, n: PNode, r: var TCompRes) =
let s = n[namePos].sym
discard mangleName(p.module, s)
r.res = s.loc.r
if lfNoDecl in s.loc.flags or s.magic notin generatedMagics: discard
if s.kind == skIterator and s.typ.callConv == TCallingConvention.ccClosure:
globalError(p.config, n.info, "Closure iterators are not supported by JS backend!")
elif lfNoDecl in s.loc.flags or s.magic notin generatedMagics: discard
elif not p.g.generatedSyms.containsOrIncl(s.id):
p.locals.add(genProc(p, s))
of nkType: r.res = genTypeInfo(p, n.typ)
Expand Down

0 comments on commit 7c11da3

Please sign in to comment.