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 we allow super [ Expression ] in PatternMatchingMemberExpression? #331

Open
JLHwung opened this issue Jul 6, 2024 · 3 comments
Open

Comments

@JLHwung
Copy link
Contributor

JLHwung commented Jul 6, 2024

Here is the current PatternMatchingMemberExpression production:

PatternMatchingMemberExpression[Yield, Await] :
  this
  MetaProperty
  IdentifierReference[?Yield, ?Await]
  super . IdentifierName
  PatternMatchingMemberExpression[?Yield, ?Await] . IdentifierName
  PatternMatchingMemberExpression[?Yield, ?Await] . PrivateIdentifier
  PatternMatchingMemberExpression[?Yield, ?Await] [ Expression[+In, ?Yield, ?Await] ]

As we can see, the following examples are valid PatternMatchingMemberExpression:

  • this[expr]
  • super.prop[expr]
  • import.meta[expr]

However, this production does not cover super [ Expression[+In, ?Yield, ?Await] ], should we also include it?
If yes we can replace super . IdentifierName by the SuperProperty production, which already covers super[expr].

@ljharb
Copy link
Member

ljharb commented Jul 6, 2024

My expectation is that we’d match decorators here.

@Jack-Works
Copy link
Member

looks like I forgot that production

@Jack-Works
Copy link
Member

Jack-Works commented Jul 7, 2024

My expectation is that we’d match decorators here.

DecoratorMemberExpression is too limited. It doesn't include this MetaProperty or super.*, it also includes (Expression) we don't want.

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

3 participants