summaryrefslogtreecommitdiff
path: root/lib/console.js
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2017-02-17 18:15:09 +0100
committerAnna Henningsen <anna@addaleax.net>2017-02-21 16:50:58 +0100
commitc969047d62c90f8c7838342c262b9bf63c72baa3 (patch)
tree97e0c4bafe01ca209caefe178db58090f4e5fa8e /lib/console.js
parent193468667b84b416cd5c5a9f42bc34deedae858e (diff)
downloadandroid-node-v8-c969047d62c90f8c7838342c262b9bf63c72baa3.tar.gz
android-node-v8-c969047d62c90f8c7838342c262b9bf63c72baa3.tar.bz2
android-node-v8-c969047d62c90f8c7838342c262b9bf63c72baa3.zip
console: fixup `console.dir()` error handling
Apply the `console: do not emit error events` changes properly to `console.dir()`. This was overlooked in f18e08d820dde161788d95a5603546ceca021e90 (https://github.com/nodejs/node/pull/9744). Ref: https://github.com/nodejs/node/commit/f18e08d820dde161788d95a5603546ceca021e90#commitcomment-20934407 PR-URL: https://github.com/nodejs/node/pull/11443 Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/console.js')
-rw-r--r--lib/console.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/console.js b/lib/console.js
index 7c4e4bb786..6de9d43ef3 100644
--- a/lib/console.js
+++ b/lib/console.js
@@ -103,7 +103,10 @@ Console.prototype.error = Console.prototype.warn;
Console.prototype.dir = function dir(object, options) {
options = Object.assign({customInspect: false}, options);
- write(this._ignoreErrors, this._stdout, `${util.inspect(object, options)}\n`);
+ write(this._ignoreErrors,
+ this._stdout,
+ `${util.inspect(object, options)}\n`,
+ this._stdoutErrorHandler);
};