diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index a2af66f4b8521c..af027cf3b3cc59 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -17,6 +17,7 @@ const { ReflectOwnKeys, Symbol, SymbolHasInstance, + SymbolToStringTag, WeakMap, } = primordials; @@ -228,6 +229,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 73a919e5eacb3c..76dec355381299 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],',