From 3f942e2c49087e4e54cdfd9a79b3daf15b213e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerhard=20St=C3=B6bich?= Date: Fri, 8 Dec 2023 22:01:23 +0100 Subject: [PATCH] doc: correct tracingChannel.traceCallback() tracingChannel.traceCallback() requires a callback otherwise it throws and invalid argument error. As a result arguments are not optional. Correct the documentation to reflect that arguments are not optional. Besides that correct description regarding signaling of errors. Remove an unneeded null check in wrappedCallback() which can't happen because it's validated that callback is of type function. PR-URL: https://github.com/nodejs/node/pull/51068 Fixes: https://github.com/nodejs/node/issues/50996 Reviewed-By: Stephen Belanger Reviewed-By: Luigi Pinca Reviewed-By: Mohammed Keyvanzadeh --- doc/api/diagnostics_channel.md | 18 +++++++++--------- lib/diagnostics_channel.js | 4 +--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/doc/api/diagnostics_channel.md b/doc/api/diagnostics_channel.md index 9f31c72183768b..7b68b3b8d1cf21 100644 --- a/doc/api/diagnostics_channel.md +++ b/doc/api/diagnostics_channel.md @@ -862,7 +862,7 @@ channels.tracePromise(async () => { }); ``` -#### `tracingChannel.traceCallback(fn[, position[, context[, thisArg[, ...args]]]])` +#### `tracingChannel.traceCallback(fn, position, context, thisArg, ...args)`