Skip to content

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

Open
@navegador5

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    eventtargetIssues and PRs related to the EventTarget implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions