diff options
author | Matteo Collina <hello@matteocollina.com> | 2018-07-04 19:55:12 +0200 |
---|---|---|
committer | Matteo Collina <hello@matteocollina.com> | 2018-07-07 00:04:52 +0200 |
commit | 19795d83833de7489afec583f8773ee9c0452f70 (patch) | |
tree | 0e495abfe821e92a158b757fcb0a24715fc7d863 /lib/inspector.js | |
parent | dd023df135207086c86129aa1683ea4688f97f53 (diff) | |
download | node-new-19795d83833de7489afec583f8773ee9c0452f70.tar.gz |
inspector: expose original console
Adds require('inspector').console, mapping it to the original
global.console of V8. This enables applications to send messages to
the inspector console programmatically.
Fixes: https://github.com/nodejs/node/issues/21651
PR-URL: https://github.com/nodejs/node/pull/21659
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'lib/inspector.js')
-rw-r--r-- | lib/inspector.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/inspector.js b/lib/inspector.js index f4ec71fd6c..f4e365b774 100644 --- a/lib/inspector.js +++ b/lib/inspector.js @@ -11,6 +11,7 @@ const { } = require('internal/errors').codes; const util = require('util'); const { Connection, open, url } = process.binding('inspector'); +const { originalConsole } = require('internal/process/per_thread'); if (!Connection || !require('internal/worker').isMainThread) throw new ERR_INSPECTOR_NOT_AVAILABLE(); @@ -103,5 +104,6 @@ module.exports = { open: (port, host, wait) => open(port, host, !!wait), close: process._debugEnd, url: url, + console: originalConsole, Session }; |