I agree with all of David's points. I wonder though: would it make more
sense if we'd spec. the get trap of Proxy.Handler as:
get: function(name, proxy) {
let val = this.target[name];
return typeof val === function ? val.bind(this.target) : val;
}
Then both method accessor
With ordinary objects, methods and property getter functions are both
invoked on the object itself. If this object is proxied with
Proxy.Handler, however, the property getter function will be invoked on
the original object and the method will be invoked on the proxy object.
The code below
2 matches
Mail list logo