From 838179b096c184b32660f82bf7d60e92300d28f2 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 b92ee0b014de02..ba60c7e28d4050 100644 --- a/doc/api/diagnostics_channel.md +++ b/doc/api/diagnostics_channel.md @@ -853,7 +853,7 @@ channels.tracePromise(async () => { }); ``` -#### `tracingChannel.traceCallback(fn[, position[, context[, thisArg[, ...args]]]])` +#### `tracingChannel.traceCallback(fn, position, context, thisArg, ...args)`