console: add Symbol.toStringTag property

Add Symbol.toStringTag property to console object to follow WPT changes
Update WPT status of console and the repl test case

Refs: https://github.com/web-platform-tests/wpt/pull/24717

PR-URL: https://github.com/nodejs/node/pull/35399
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Leko authored and Danielle Adams committed 2020-10-06 12:16:01 -04:00
1 parent 166f14ac98
commit 05e08bdf13
2 files changed
+8 -1

No files matched your search

+7
View File
@@ -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'
}
});
}
},
+1 -1
View File
@@ -757,7 +757,7 @@ const errorTests = [
{
send: 'console',
expect: [
'{',
'Object [console] {',
' log: [Function: log],',
' warn: [Function: warn],',
' dir: [Function: dir],',