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

Should @this.dec be allowed? #460

Open
JLHwung opened this issue Mar 30, 2022 · 1 comment
Open

Should @this.dec be allowed? #460

JLHwung opened this issue Mar 30, 2022 · 1 comment

Comments

@JLHwung
Copy link

JLHwung commented Mar 30, 2022

The current syntax

DecoratorMemberExpression[Yield, Await] :
  IdentifierReference[?Yield, ?Await]
  DecoratorMemberExpression[?Yield, ?Await] . IdentifierName
  DecoratorMemberExpression[?Yield, ?Await] . PrivateIdentifier
  ( Expression[+In, ?Yield, ?Await] )

disallows this.dec as a decorator member expression, instead one would have to parenthesize it into @(this.dec).

Ref: #435 (comment), #435 (comment)

A related question: Should @this be allowed? I think we should either allow both or disallow both.

@ljharb
Copy link
Member

ljharb commented Mar 30, 2022

The receiver (and super, and arguments, and new.target) shouldn’t be treated any differently than any other identifier, ideally.

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

2 participants