MCPcopy
hub / github.com/webpack/webpack / interceptAllHooksFor

Function interceptAllHooksFor

lib/debug/ProfilingPlugin.js:406–416  ·  view source on GitHub ↗
(instance, tracer, logLabel)

Source from the content-addressed store, hash-verified

404 * @param {string} logLabel log label
405 */
406const 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.

Callers 5

applyMethod · 0.85
interceptAllParserHooksFunction · 0.85

Calls 4

makeInterceptorForFunction · 0.85
interceptMethod · 0.80
keysMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected