Skip to content

There is a bug about decorators support in esbuild #15

@jincandev

Description

@jincandev

Code Position: esbuild-decorators.ts

Regular expressions don't work when decorator functions start with '$'. for example:

function Test(target: any, key?: string, pKey?: any) {
  if(!key) {
    return
  }
  console.log(">>>", Reflect.getMetadata("design:type", target, key))
}

@$Test
class Nardy {

  @$Test
  private name: Date = new Date()

  @$Test
  setName() {}

}

I think we should judge the legal function name instead of limiting it to letters, numbers and underscores next the '@' character

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions