tc39/proposal-extractors

Allow `this` to be part of the qualified name.

Closed this issue · 3 comments

If I read things correctly - this is not allowed because QualifiedName only allows Identifiers and those don't allow reserved words: https://tc39.es/ecma262/multipage/ecmascript-language-expressions.html#prod-Identifier

It would be cool if this.X could be used as an extractor object. A wrapper object/class might accept another that is responsible for maintaining a state that otherwise is opaque to the wrapper itself and it would be very nice if the extraction concerns could be delegated to that inner object.

This will be addressed by #12.

do I need to make any changes to the pattern-matching site?

No, I believe the definitions I'm using in the current spec text are essentially the same as the ones used in pattern matching.