From 51cb0d42cad82279e9fe8d3860e12159607f385d Mon Sep 17 00:00:00 2001 From: Keyhan Vakil Date: Sat, 16 Jul 2022 18:36:31 +0000 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/43867 Reviewed-By: Luigi Pinca Reviewed-By: Feng Yu --- doc/api/inspector.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/api/inspector.md b/doc/api/inspector.md index 90bc90e2d12226..c0ab1ed1ce08f1 100644 --- a/doc/api/inspector.md +++ b/doc/api/inspector.md @@ -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