aboutsummaryrefslogtreecommitdiff
path: root/lib/inspector.js
diff options
context:
space:
mode:
authorMatteo Collina <hello@matteocollina.com>2018-07-04 19:55:12 +0200
committerMatteo Collina <hello@matteocollina.com>2018-07-07 00:04:52 +0200
commit19795d83833de7489afec583f8773ee9c0452f70 (patch)
tree0e495abfe821e92a158b757fcb0a24715fc7d863 /lib/inspector.js
parentdd023df135207086c86129aa1683ea4688f97f53 (diff)
downloadandroid-node-v8-19795d83833de7489afec583f8773ee9c0452f70.tar.gz
android-node-v8-19795d83833de7489afec583f8773ee9c0452f70.tar.bz2
android-node-v8-19795d83833de7489afec583f8773ee9c0452f70.zip
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.js2
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
};