(obj: any, method: string | symbol | number)
| 404 | } |
| 405 | |
| 406 | function getDescriptor(obj: any, method: string | symbol | number): [any, PropertyDescriptor] | undefined { |
| 407 | const objDescriptor = Object.getOwnPropertyDescriptor(obj, method) |
| 408 | if (objDescriptor) { |
| 409 | return [obj, objDescriptor] |
| 410 | } |
| 411 | let currentProto = Object.getPrototypeOf(obj) |
| 412 | while (currentProto !== null) { |
| 413 | const descriptor = Object.getOwnPropertyDescriptor(currentProto, method) |
| 414 | if (descriptor) { |
| 415 | return [currentProto, descriptor] |
| 416 | } |
| 417 | currentProto = Object.getPrototypeOf(currentProto) |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | function assert(condition: any, message: string): asserts condition { |
| 422 | if (!condition) { |
no test coverage detected