(target, method, wrapper)
| 875 | * method in its place. |
| 876 | */ |
| 877 | const wrapMethod = (target, method, wrapper) => { |
| 878 | return new Proxy(method, { |
| 879 | apply(targetMethod, thisObj, args) { |
| 880 | return wrapper.call(thisObj, target, ...args); |
| 881 | } |
| 882 | }); |
| 883 | }; |
| 884 | let hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty); |
| 885 | |
| 886 | /** |