aboutsummaryrefslogtreecommitdiff
path: root/lib/internal/console
diff options
context:
space:
mode:
Diffstat (limited to 'lib/internal/console')
-rw-r--r--lib/internal/console/constructor.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js
index 7e1bcf802f..e10eef74c2 100644
--- a/lib/internal/console/constructor.js
+++ b/lib/internal/console/constructor.js
@@ -294,10 +294,11 @@ Console.prototype.warn = function warn(...args) {
Console.prototype.error = Console.prototype.warn;
Console.prototype.dir = function dir(object, options) {
- options = Object.assign({
- customInspect: false
- }, this[kGetInspectOptions](this._stdout), options);
- this[kWriteToConsole](kUseStdout, util.inspect(object, options));
+ this[kWriteToConsole](kUseStdout, util.inspect(object, {
+ customInspect: false,
+ ...this[kGetInspectOptions](this._stdout),
+ ...options
+ }));
};
Console.prototype.time = function time(label = 'default') {