diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index dfad0811b25201..aae511cb6c7ca0 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -19,6 +19,7 @@ const { ReflectOwnKeys, Symbol, SymbolHasInstance, + SymbolToStringTag, WeakMap, } = primordials; @@ -233,6 +234,12 @@ ObjectDefineProperties(Console.prototype, { ...consolePropAttributes, value: groupIndentation }, + [SymbolToStringTag]: { + writable: false, + enumerable: false, + configurable: true, + value: 'console' + } }); } }, diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js index e200ebbaeee4ea..fb7006fbc1db48 100644 --- a/test/parallel/test-repl.js +++ b/test/parallel/test-repl.js @@ -757,7 +757,7 @@ const errorTests = [ { send: 'console', expect: [ - '{', + 'Object [console] {', ' log: [Function: log],', ' warn: [Function: warn],', ' dir: [Function: dir],',