def node_comparison(self, node):
        jsvars = self.jsvars.copy()
        left = op = right = None
        childs = node.children.__iter__()
        first_left = left = self.dispatch(childs.next())
        prev_right = None
        cmp_expr = []
        tmp = None
        try:
            while True:
                op_node = childs.next()
                right = self.dispatch(childs.next())
                if isinstance(op_node, Leaf):
                    op = op_compare[op_node.value]
                elif type_repr(op_node.type) == 'comp_op':
                    op = self.dispatch(op_node)
                jsvars.update(locals())
                if prev_right is None:
                    cmp_expr.append("""\
%(builtin)s['%(op)s'](%(left)s, %(right)s)""" % jsvars)
                else:
                    if tmp is None:
                        tmp = self.get_tmp_jsname('comp$')
                        jsvars['tmp'] = tmp
                        self.add_lines(tmp % "var %s;")
                        cmp_expr = ["""\
%(builtin)s['%(op)s'](%(first_left)s, %(tmp)s=%(prev_right)s)""" % jsvars]
                    cmp_expr.append("""\
%(builtin)s['%(op)s'](%(tmp)s, %(tmp)s=%(right)s)""" % jsvars)
                left = right
                prev_right = right
        except StopIteration:
            pass
        if cmp_expr:
            if len(cmp_expr) == 1:
                return cmp_expr[0]
            s = ' && '.join([
                "(%s).valueOf()" % i
                for i in cmp_expr
            ])
            jsvars.update(locals())
            return "(%(s)s ? %(True)s : %(False)s)" % jsvars
        self.not_implemented(node)
dataset/ETHPy150Open anandology/pyjamas/pyjs/src/pyjs/translator_dict.py/Translator.node_comparison/swapped operands of `%`