Skip to content

Commit 05e08bd

Browse files
Lekodanielleadams
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 166f14a commit 05e08bd

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/internal/console/constructor.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const {
1919
ReflectOwnKeys,
2020
Symbol,
2121
SymbolHasInstance,
22+
SymbolToStringTag,
2223
WeakMap,
2324
} = primordials;
2425

@@ -233,6 +234,12 @@ ObjectDefineProperties(Console.prototype, {
233234
...consolePropAttributes,
234235
value: groupIndentation
235236
},
237+
[SymbolToStringTag]: {
238+
writable: false,
239+
enumerable: false,
240+
configurable: true,
241+
value: 'console'
242+
}
236243
});
237244
}
238245
},

test/parallel/test-repl.js

Lines changed: 1 addition & 1 deletion
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)