js decorator arguments.callee.name为空

时间:2017-12-08 22:44:19

标签: javascript decorator

class Decorators {
    static PubSub(middleware) {
        let decoratorName = arguments.callee.name
        return function(target, key, descriptor) {
        }
    }
}

let PubSub = Decorators.PubSub

class User {
    @PubSub(null)
    static users() {}
}

我希望decoratorName是PubSub,但它是一个空字符串

0 个答案:

没有答案