var outerT = function(left, right) { console.log(this); return left + right; } var handler = { apply: function(target, ctx, args) { // 第一个参数为目标对象,这里通过Reflect.apply把上次处理的结果传递给被代理执行 return Reflect.apply(...arguments) * 2; } } var p = new Proxy(outerT, handler); debugger console.log(p.apply({name: 'qinliang'}, [2, 3])); console.log(p(2, 3)); console.log(Reflect.apply(p, null, [2, 3]));