injector.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:FMoviesPlus.bundle 作者: coder-alpha 项目源码 文件源码
def fix_js_args(func):
    '''Use this function when unsure whether func takes this and arguments as its last 2 args.
       It will append 2 args if it does not.'''
    fcode = six.get_function_code(func)
    fargs = fcode.co_varnames[fcode.co_argcount-2:fcode.co_argcount]
    if fargs==('this', 'arguments') or fargs==('arguments', 'var'):
        return func
    code = append_arguments(six.get_function_code(func), ('this','arguments'))

    return types.FunctionType(code, six.get_function_globals(func), func.__name__, closure=six.get_function_closure(func))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号