(obj, _methodName)
| 25 | } |
| 26 | |
| 27 | replaceObjectMethod(obj, _methodName) { |
| 28 | |
| 29 | const _originalMethod = obj[_methodName]; |
| 30 | assert(isFunction(_originalMethod)); |
| 31 | // create closure variable |
| 32 | const that = this; |
| 33 | const methodName = _methodName; |
| 34 | const originalMethod = _originalMethod; |
| 35 | |
| 36 | function performOperation() { |
| 37 | |
| 38 | return that.__performedCachedOperation(this, originalMethod, `${methodName}#${this.uuid}`, arguments); |
| 39 | |
| 40 | } |
| 41 | |
| 42 | Object.defineProperty(obj, methodName, {value: performOperation, enumerable: false}); |
| 43 | |
| 44 | // xx obj[methodName] = performOperation;= |
| 45 | |
| 46 | } |
| 47 | |
| 48 | |
| 49 | installProxyMethods(obj) { |
no test coverage detected