(instance, tracer, logLabel)
| 404 | * @param {string} logLabel log label |
| 405 | */ |
| 406 | const interceptAllHooksFor = (instance, tracer, logLabel) => { |
| 407 | if (Reflect.has(instance, "hooks")) { |
| 408 | const hooks = /** @type {Hooks} */ (instance.hooks); |
| 409 | for (const hookName of Object.keys(hooks)) { |
| 410 | const hook = hooks[hookName]; |
| 411 | if (hook && !hook._fakeHook) { |
| 412 | hook.intercept(makeInterceptorFor(logLabel, tracer)(hookName)); |
| 413 | } |
| 414 | } |
| 415 | } |
| 416 | }; |
| 417 | |
| 418 | /** |
| 419 | * Intercept all parser hooks. |
no test coverage detected