diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index ffc11789f9128..37db6f74f72f4 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -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)