From 1559cd8f9f8140bb622d7438caa0d0fd5ef3128b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerhard=20St=C3=B6bich?= <18708370+Flarna@users.noreply.github.com> Date: Wed, 6 Dec 2023 08:05:22 +0100 Subject: [PATCH 1/2] 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. --- 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..ec8fdc6f756ff1 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)`