Skip to content

Commit

Permalink
console: add Symbol.toStringTag property
Browse files Browse the repository at this point in the history
Add Symbol.toStringTag property to console object to follow WPT changes
Update WPT status of console and the repl test case

Refs: web-platform-tests/wpt#24717

PR-URL: #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>
  • Loading branch information
Leko authored and MylesBorins committed Nov 16, 2020
1 parent ae14923 commit 2e766a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/internal/console/constructor.js
Expand Up @@ -17,6 +17,7 @@ const {
ReflectOwnKeys,
Symbol,
SymbolHasInstance,
SymbolToStringTag,
WeakMap,
} = primordials;

Expand Down Expand Up @@ -228,6 +229,12 @@ ObjectDefineProperties(Console.prototype, {
...consolePropAttributes,
value: groupIndentation
},
[SymbolToStringTag]: {
writable: false,
enumerable: false,
configurable: true,
value: 'console'
}
});
}
},
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-repl.js
Expand Up @@ -757,7 +757,7 @@ const errorTests = [
{
send: 'console',
expect: [
'{',
'Object [console] {',
' log: [Function: log],',
' warn: [Function: warn],',
' dir: [Function: dir],',
Expand Down

0 comments on commit 2e766a6

Please sign in to comment.