doc: make some parameters optional in tracingChannel.traceCallback

Plus, add missing `position` parameter to CJS example.

PR-URL: https://github.com/nodejs/node/pull/54068
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
This commit is contained in:
Deokjin Kim
2024-07-27 22:38:25 +09:00
committed by jakecastelli
parent 7327e44a05
commit a4f609faf5

View File

@@ -872,7 +872,7 @@ channels.tracePromise(async () => {
});
```
#### `tracingChannel.traceCallback(fn, position, context, thisArg, ...args)`
#### `tracingChannel.traceCallback(fn[, position[, context[, thisArg[, ...args]]]])`
<!-- YAML
added:
@@ -927,7 +927,7 @@ const channels = diagnostics_channel.tracingChannel('my-channel');
channels.traceCallback((arg1, callback) => {
// Do something
callback(null, 'result');
}, {
}, 1, {
some: 'thing',
}, thisArg, arg1, callback);
```