Skip to content

Commit 2e766a6

Browse files
LekoMylesBorins
authored andcommitted
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: 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]>
1 parent ae14923 commit 2e766a6

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/internal/console/constructor.js

+7
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const {
1717
ReflectOwnKeys,
1818
Symbol,
1919
SymbolHasInstance,
20+
SymbolToStringTag,
2021
WeakMap,
2122
} = primordials;
2223

@@ -228,6 +229,12 @@ ObjectDefineProperties(Console.prototype, {
228229
...consolePropAttributes,
229230
value: groupIndentation
230231
},
232+
[SymbolToStringTag]: {
233+
writable: false,
234+
enumerable: false,
235+
configurable: true,
236+
value: 'console'
237+
}
231238
});
232239
}
233240
},

test/parallel/test-repl.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ const errorTests = [
757757
{
758758
send: 'console',
759759
expect: [
760-
'{',
760+
'Object [console] {',
761761
' log: [Function: log],',
762762
' warn: [Function: warn],',
763763
' dir: [Function: dir],',

0 commit comments

Comments
 (0)