Skip to content

Commit

Permalink
doc: inspector.close undefined in worker threads
Browse files Browse the repository at this point in the history
In the main thread, `inspector.close` is defined as `process._debugEnd`:

```
> inspector.close
[Function: _debugEnd]
```

It's not defined in worker threads:
```
> const {Worker} = require("worker_threads");
> new Worker("console.log(require(\"inspector\").close)", {eval:true})
undefined
```

(As far as I can tell this is intentional and has existed for quite some
time.)

PR-URL: nodejs#43867
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
  • Loading branch information
kvakil authored and Fyko committed Sep 15, 2022
1 parent 805b54d commit 04c1609
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/api/inspector.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const inspector = require('node:inspector');

Deactivate the inspector. Blocks until there are no active connections.

This function is not available in [worker threads][].

## `inspector.console`

* {Object} An object to send messages to the remote inspector console.
Expand Down Expand Up @@ -260,3 +262,4 @@ session.post('HeapProfiler.takeHeapSnapshot', null, (err, r) => {
[`'Debugger.paused'`]: https://chromedevtools.github.io/devtools-protocol/v8/Debugger#event-paused
[`session.connect()`]: #sessionconnect
[security warning]: cli.md#warning-binding-inspector-to-a-public-ipport-combination-is-insecure
[worker threads]: worker_threads.md

0 comments on commit 04c1609

Please sign in to comment.