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 10a7e5ab189bba..663b13ca0fe985 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],', diff --git a/test/wpt/status/console.json b/test/wpt/status/console.json index ed3e1ddda5bfa7..d611638b924c10 100644 --- a/test/wpt/status/console.json +++ b/test/wpt/status/console.json @@ -1,8 +1,5 @@ { "idlharness.any.js": { "fail": ".table, .dir and .timeLog parameter lengths are wrong" - }, - "console-namespace-object-class-string.any.js": { - "fail": "TODO: https://github.com/web-platform-tests/wpt/pull/24717" } }