Skip to content

static name method that has the method name dynamically set is overridden with a string when keepNames is enabled #4340

@sapphi-red

Description

@sapphi-red
window.foo = 'name'
class Foo {
  static [window.foo]() {}
}
console.log(Foo.name)

esbuild try

The input code outputs ƒ [window.foo]() {}. On the other hand, the output code outputs Foo.

(Note: this is not what I encountered in a real world usage. I found it when trying to know how keepNames feature works in esbuild.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions