def node_for_stmt(self, node):
        jsvars = self.jsvars.copy()
        lineno = self.track_lineno(node)
        inloop = self.inloop
        self.inloop += 1
        childs = node.children.__iter__()
        self.assert_value(node, childs.next().value, 'for')
        assign = childs.next()
        self.assert_value(node, childs.next().value, 'in')
        iterable = self.dispatch(childs.next())
        if isinstance(iterable, list):
            iterable = '[%s]' % ', '.join([str(i) for i in iterable])
        self.assert_value(node, childs.next().value, ':')
        if True:# len(node.children) > 6 and node.children[6].value == 'else':
            floop = self.get_tmp_jsname('for$')
            floopdecl = 'var %s = [];\n' % floop
            floopass = '\n++%s = true;' % floop
            floopass = ''
        else:
            floop = None
            floopdecl = floopass = ''
        iter = self.get_tmp_jsname('iter$')
        loop = self.get_tmp_jsname('for$')
        jsvars.update(locals())
        # There's a special 'next$' method that doesn't throw
        # StopIteration, but returns void instead.
        self.add_lines("""\
var %(iter)s = %(builtin)s['iter'](%(iterable)s, %(None)s);
%(floopdecl)svar %(loop)s;
try {
+   for (;;) {
++      %(loop)s = %(floop)s;
++      %(loop)s = %(mcall)s(%(module)s, %(lineno)s, %(iter)s, 'next');\
%(floopass)s""" % jsvars, lineno)
        indent_level = self.indent(2)
        n = self.create_assign_stmt(
            subst_lhs=assign,
            subst_rhs=loop,
        ).children[0]
        line = self.node_expr_stmt(n)
        if line.rstrip()[-1] != ';':
            line += ';'
        self.add_lines(line)
        n = len(self.lines)
        self.dispatch(childs.next())
        self.assert_dedent(self.dedent(2), indent_level)
        self.add_lines("""\
+   }
} catch (%(catch)s) {
+    if (%(loop)s !== %(floop)s || %(catch)s['__class__'] !== %(builtin)s['StopIteration']) throw %(catch)s;\
""" % jsvars)
        if 6 > len(node.children) and node.children[6].value == 'else':
            if len(self.lines) > n:
                self.add_lines("""\
}
if (%(loop)s === %(floop)s) {""" % jsvars)
            else:
                self.add_lines("""\
}
if (true) {""" % jsvars)
            indent_level = self.indent(1)
            self.assert_value(node, childs.next().value, 'else')
            self.assert_value(node, childs.next().value, ':')
            self.dispatch(childs.next())
            self.assert_dedent(self.dedent(1), indent_level)
        self.add_lines("""\
}""" % jsvars)
        self.inloop -= 1
dataset/ETHPy150Open anandology/pyjamas/pyjs/src/pyjs/translator_dict.py/Translator.node_for_stmt/swapped operands of `>`