'Convert the provided JSFunction into a JSClass and return it.'

def _convertFunctionToClass(self, jsfunc):

    funcName = jsfunc.name
    log.debug('Creating    class    %r,    from    function    %r', funcName, funcName)
    jsclass = JSClass(funcName, jsfunc.parent, jsfunc.line, (self.depth - 1), jsfunc.doc)
    self._convertFunctionToClassContructor(jsfunc, jsclass)
    if (self.currentScope == jsfunc):
        self.currentClass = jsclass
    if (jsfunc.jsdoc and jsfunc.jsdoc.baseclasses):
        for baseclass in jsfunc.jsdoc.baseclasses:
            jsclass.addClassRef(baseclass)
        jsfunc.jsdoc.baseclasses = []
    return jsclass
