diff --git a/lib/diagnostics_channel.js b/lib/diagnostics_channel.js index 10d35054f56535..4e73b39c451427 100644 --- a/lib/diagnostics_channel.js +++ b/lib/diagnostics_channel.js @@ -381,9 +381,7 @@ class TracingChannel { } const callback = ArrayPrototypeAt(args, position); - if (typeof callback !== 'function') { - throw new ERR_INVALID_ARG_TYPE('callback', ['function'], callback); - } + validateFunction(callback, 'callback'); ArrayPrototypeSplice(args, position, 1, wrappedCallback); return start.runStores(context, () => {