Skip to content

Should we allow super [ Expression ] in PatternMatchingMemberExpression? #331

@JLHwung

Description

@JLHwung

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].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions