You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
console-display: Symbol.toStringTag NOT work when extends EventTarget #37329
//worked, no extends
class ET {
#tag = "empty"
constructor(tag) {
this.#tag = tag
}
get [Symbol.toStringTag]() {return(this.#tag)}
}
> var et = new ET("uuid-xxxx")
> et
ET [uuid-xxxx] {} //I want this effect
>
//not work , when extends
class ETWithSig extends EventTarget {
#tag = "empty"
constructor(tag) {
super();
this.#tag = tag
}
get [Symbol.toStringTag]() {return(this.#tag)}
}
> var xt = new ETWithSig("uuid-yyyy")
> xt
ETWithSig {} //not-work when extends
>
How often does it reproduce? Is there a required condition?
I put together a "fix" but we have to be aware that it's more like a bandage. There could be way more things that do not work as expected due to not being the actual object inspected.
Anyone may feel free to open a PR with this change.
This issue has been marked as stale due to 210 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.
This issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 120 days).
If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.
Activity
targos commentedon Feb 12, 2021
@nodejs/util
BridgeAR commentedon Feb 12, 2021
It's an issue with the custom inspect function defined for the EventTarget. These rarely mimic the regular inspect behavior.
BridgeAR commentedon Feb 12, 2021
I put together a "fix" but we have to be aware that it's more like a bandage. There could be way more things that do not work as expected due to not being the actual object inspected.
Anyone may feel free to open a PR with this change.
benjamingr commentedon Feb 12, 2021
Just wondering - what are you doing with EventTarget?
navegador5 commentedon Feb 13, 2021
@benjamingr
in my application:
It is a automation testbed for javascripts.
github-actions commentedon Jun 27, 2026
This issue has been marked as stale due to 210 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.
github-actions commentedon Jul 28, 2026
This issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 120 days).
If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.