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: nodejs#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 joesepi committed Oct 22, 2020
1 parent ab22657 commit ffcc985
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
7 changes: 7 additions & 0 deletions lib/internal/console/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const {
ReflectOwnKeys,
Symbol,
SymbolHasInstance,
SymbolToStringTag,
WeakMap,
} = primordials;

Expand Down Expand Up @@ -233,6 +234,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
3 changes: 0 additions & 3 deletions test/wpt/status/console.json
Original file line number Diff line number Diff line change
@@ -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:/web-platform-tests/wpt/pull/24717"
}
}

0 comments on commit ffcc985

Please sign in to comment.