'Everything in the function is applied to the supplied scope/namelist'

def _handleFunctionApply(self, namelist=None):

    if (namelist is None):
        scope = self.cile
    else:
        scope = self._findOrCreateScope(namelist, attrlist=('variables', 'classes', 'functions'))
    if (self.lastScope and isinstance(self.lastScope, JSFunction)):
        applyFrom = self.lastScope
        parent = applyFrom.parent
        if (isinstance(parent, JSClass) and (parent.name == applyFrom.name)):
            self._copyObjectToAnother(applyFrom, scope)
            del parent.functions[applyFrom.name]
            applyFrom = parent
        self._copyObjectToAnother(applyFrom, scope)
        self._removeObjectFromScope(applyFrom)
    elif (self.lastScope and isinstance(self.lastScope, JSVariable)):
        self._copyObjectToAnother(self.lastScope, scope)
    elif (self.objectArguments and isinstance(self.objectArguments[0][1], JSObject)):
        self._copyObjectToAnother(self.objectArguments[0][1], scope)
