def node_classdef(self, node):
        jsvars = self.jsvars.copy()
        #print node.depth()
        childs = node.children.__iter__()
        self.assert_value(node, childs.next().value, 'class')
        name = childs.next().value
        self.add_name(name)
        tok = childs.next()
        if tok.value == ':':
            bases = self.get_jsname('object')
        else:
            self.assert_value(node, tok.value, '(')
            bases = childs.next()
            if isinstance(bases, Leaf):
                if bases.value == ')':
                    bases = None
                else:
                    bases = [self.get_jsname(bases.value)]
            else:
                bases = self.dispatch(bases)
            if bases is None:
                bases = self.get_jsname('object')
            elif isinstance(bases, list):
                bases = ', '.join([str(i) for i in bases])
                self.assert_value(node, childs.next().value, ')')
            else:
                self.assert_value(node, childs.next().value, ')')
            self.assert_value(node, childs.next().value, ':')
        lineno = self.track_lineno(node)
        jsvars.update(locals())
        if isinstance(self.names[-1], ClassNames):
            namespace = "%(funcbase)s['$dict']" % jsvars
        else:
            namespace = "%(locals)s" % jsvars
        jsvars.update(namespace=namespace)
        self.add_lines("""\
%(namespace)s[%(name)r] = %(builtin)s['B$type'](%(module)s, %(name)r, [%(bases)s], {});
(function(%(funcbase)s){
+   //var %(locals)s = %(funcbase)s['$dict'];""" % jsvars)
        names = ClassNames()
        self.names.append(names)
        indent_level = self.indent()
        self.next_func_type.append(func_type['function'])
        try:
            while True:
                child = childs.next()
                self.dispatch(child)
        except StopIteration:
            pass
        self.next_func_type.pop()
        self.assert_dedent(self.dedent(), indent_level)
        assert names is self.names.pop(), self.TranslationError("names pop error", self.get_lineno(node))
        if names in '__slots__':
            self.add_lines("""\
+   %(funcbase)s['__slots__'] =  %(module)s['$new'](%(tuple)s, %(locals)s['__slots__']).__array;\
""" % jsvars)
        self.add_lines("})(%(namespace)s[%(name)r]);" % jsvars)
        return name
dataset/ETHPy150Open anandology/pyjamas/pyjs/src/pyjs/translator_dict.py/Translator.node_classdef/swapped operands of `in`