diff options
author | Aleksei Koziatinskii <ak239spb@gmail.com> | 2019-06-25 15:28:56 -0700 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2019-07-22 21:20:43 +0200 |
commit | 77bdbc5f0d1bd7caada99d0097bca2a9bb1f4cee (patch) | |
tree | 1d7f1b9f8fb9ca9b308f496683d7130218a42549 /doc | |
parent | 49e4d72b5a7fcf643e1476b0f382ed08cacd6c0a (diff) | |
download | android-node-v8-77bdbc5f0d1bd7caada99d0097bca2a9bb1f4cee.tar.gz android-node-v8-77bdbc5f0d1bd7caada99d0097bca2a9bb1f4cee.tar.bz2 android-node-v8-77bdbc5f0d1bd7caada99d0097bca2a9bb1f4cee.zip |
inspector: add inspector.waitForDebugger()
This method blocks current node process until a client sends
Runtime.runifWaitingForDebugger.
It can be useful when we need to report inspector.url() before
waiting for connection:
```
inspector.open(0, undefined, false);
fs.writeFileSync(someFileName, inspector.url());
inspector.waitForDebugger();
```
PR-URL: https://github.com/nodejs/node/pull/28453
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/errors.md | 5 | ||||
-rw-r--r-- | doc/api/inspector.md | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/doc/api/errors.md b/doc/api/errors.md index fe81168e40..6147f768c8 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -1186,6 +1186,11 @@ after the session had already closed. An error occurred while issuing a command via the `inspector` module. +<a id="ERR_INSPECTOR_NOT_ACTIVE"></a> +### ERR_INSPECTOR_NOT_ACTIVE + +The `inspector` is not active when `inspector.waitForDebugger()` is called. + <a id="ERR_INSPECTOR_NOT_AVAILABLE"></a> ### ERR_INSPECTOR_NOT_AVAILABLE diff --git a/doc/api/inspector.md b/doc/api/inspector.md index 63d2a70272..e2980a278d 100644 --- a/doc/api/inspector.md +++ b/doc/api/inspector.md @@ -52,6 +52,16 @@ parameter usage. Return the URL of the active inspector, or `undefined` if there is none. +## inspector.waitForDebugger() +<!-- YAML +added: REPLACEME +--> + +Blocks until a client (existing or connected later) has sent +`Runtime.runIfWaitingForDebugger` command. + +An exception will be thrown if there is no active inspector. + ## Class: inspector.Session The `inspector.Session` is used for dispatching messages to the V8 inspector |