mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
lib: refactor to use validateFunction in diagnostics_channel
Use validateFunction to remove duplicate implementation. PR-URL: https://github.com/nodejs/node/pull/50955 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
This commit is contained in:
@@ -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, () => {
|
||||
|
||||
Reference in New Issue
Block a user