Skip to content
Permalink
Browse files
doc: inspector.close undefined in worker threads
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: #43867
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
  • Loading branch information
kvakil authored and danielleadams committed Jul 26, 2022
1 parent c789c0f commit 51cb0d42cad82279e9fe8d3860e12159607f385d
Showing 1 changed file with 3 additions and 0 deletions.
@@ -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.
@@ -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 51cb0d4

Please sign in to comment.