Skip to content

Commit 4a6005c

Browse files
committed
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 91837e9 commit 4a6005c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
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],',

test/wpt/status/console.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
22
"idlharness.any.js": {
33
"fail": ".table, .dir and .timeLog parameter lengths are wrong"
4-
},
5-
"console-namespace-object-class-string.any.js": {
6-
"fail": "TODO: https://github.com/web-platform-tests/wpt/pull/24717"
74
}
85
}

0 commit comments

Comments
 (0)