Bug 215750 - Console object's @@toStringTag should be "console" instead of "Console"
Summary: Console object's @@toStringTag should be "console" instead of "Console"
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-21 22:37 PDT by Yusuke Suzuki
Modified: 2020-08-22 11:09 PDT (History)
12 users (show)

See Also:


Attachments
Patch (29.34 KB, patch)
2020-08-21 22:38 PDT, Yusuke Suzuki
ross.kirsling: review+
Details | Formatted Diff | Diff
Patch (37.75 KB, patch)
2020-08-21 23:33 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (37.75 KB, patch)
2020-08-21 23:33 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2020-08-21 22:37:20 PDT
Console object's @@toStringTag should be "console" instead of "Console"
Comment 1 Yusuke Suzuki 2020-08-21 22:38:01 PDT
Created attachment 407042 [details]
Patch
Comment 2 Ross Kirsling 2020-08-21 22:57:27 PDT
Comment on attachment 407042 [details]
Patch

r=me, given that CSS[@@toStringTag] will be addressed in a later patch.

We should probably link https://github.com/web-platform-tests/wpt/pull/24717 in the ChangeLog though.
Comment 3 Yusuke Suzuki 2020-08-21 23:27:29 PDT
(In reply to Ross Kirsling from comment #2)
> Comment on attachment 407042 [details]
> Patch
> 
> r=me, given that CSS[@@toStringTag] will be addressed in a later patch.
> 
> We should probably link https://github.com/web-platform-tests/wpt/pull/24717
> in the ChangeLog though.

Sounds good!
Comment 4 Yusuke Suzuki 2020-08-21 23:33:01 PDT
Created attachment 407044 [details]
Patch

Patch for landing
Comment 5 Yusuke Suzuki 2020-08-21 23:33:34 PDT
Created attachment 407045 [details]
Patch

Patch for landing
Comment 6 Alexey Shvayka 2020-08-22 07:37:01 PDT
(In reply to Ross Kirsling from comment #2)
> Comment on attachment 407042 [details]
> Patch
> 
> r=me, given that CSS[@@toStringTag] will be addressed in a later patch.

For `CSS`, it might get tricky since `CodeGeneratorJS.pm` has no notion of namespace objects.
Currently, `CSS.prototype[Symbol.toStringTag] === "CSS"`, but it's wrong since `CSS` shouldn't be a function.
Making `CSS` an ordinary object will take some tweaking to code generator (an extra attribute) + might break some sites depending on `typeof CSS === "function"` check.
So instead, we may consider adding Symbol.toStringTag in [CustomToJSObject] or something, until Chromium will ship `CSS` as ordinary object change.

Tests for namespace objects: https://github.com/web-platform-tests/wpt/pull/24724.
Comment 7 Alexey Shvayka 2020-08-22 07:45:26 PDT
(In reply to Alexey Shvayka from comment #6)
> So instead, we may consider adding Symbol.toStringTag in [CustomToJSObject]
> or something, until Chromium will ship `CSS` as ordinary object change.

Or we can just hardcode `$interfaceName eq "CSS"` at CodeGeneratorJS.pm:4445 and add it there, but it won't look nice.
Comment 8 Yusuke Suzuki 2020-08-22 10:51:28 PDT
I'll land it with testapi rebaseline.
Comment 9 Yusuke Suzuki 2020-08-22 11:02:19 PDT
(In reply to Alexey Shvayka from comment #7)
> (In reply to Alexey Shvayka from comment #6)
> > So instead, we may consider adding Symbol.toStringTag in [CustomToJSObject]
> > or something, until Chromium will ship `CSS` as ordinary object change.
> 
> Or we can just hardcode `$interfaceName eq "CSS"` at CodeGeneratorJS.pm:4445
> and add it there, but it won't look nice.

Yeah, I think, supporting `namespace` in IDL would be the best way :)
Comment 10 Yusuke Suzuki 2020-08-22 11:08:57 PDT
Committed r266030: <https://trac.webkit.org/changeset/266030>
Comment 11 Radar WebKit Bug Importer 2020-08-22 11:09:15 PDT
<rdar://problem/67620195>