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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Zeyu Yang <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • 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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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.