Skip to content

console-display: Symbol.toStringTag NOT work when extends EventTarget #37329

Description

@navegador5
  • Version: v16.0.0-pre
  • Platform: linux
  • Subsystem: ubuntu

What steps will reproduce the bug?

     //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?

always

What is the expected behavior?

see the reproduce worked-example

What do you see instead?

see the reproduce extends-example

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    eventtargetIssues and PRs related to the EventTarget implementation.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions