summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/jsgen.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim
index ffc11789f..37db6f74f 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)