Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expression.callee is undefined when evaluating custom decorators #121

Open
wassim-ben-amor opened this issue Oct 24, 2024 · 0 comments
Open

Comments

@wassim-ben-amor
Copy link

Hello, when using the linter, I have an error exactly here:

return dec.expression && dec.expression.callee.name;

When debugging the linter run, I have found that dec.expression.callee is undefined. The name of the decorator is situated directly on dec.expression. This issue is happening when using the decorator in this way:

@BindToInstance
  async onApply(
  ... 

instead of

@BindToInstance()
  async onApply(
  ... 

Do you agree to change it to:

function decoratorName(dec) {
  if (!dec.expression) return undefined;
  const { callee, name } = dec.expression;
  return callee ? callee.name : name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant