Review in conjunction with #1663.
Dealing with “var x” – Part 1
There is an ambiguity in patterns, the input “var x” could be recognised as a declaration_pattern or as a var_pattern. As is this PR only deals with the latter, on line 191 below, and says nothing about the former.
I think the intended semantics are:
- In declaration_pattern the type cannot be the identifier
var; i.e. if it starts with var then var_pattern is considered.
- A var_pattern is invalid (not considered as a valid parse) if a type called
var is in scope.
This is tackled with two suggestions:
- This one, covering declaration_pattern
- Reword the original statement on line 191 (Part 2)
The *type* of a *declaration_pattern* cannot be the *identifier* `var`.
> *Note:* In such a case the input may be recognisable as a *var_pattern* (§11.2.4).
Originally posted by @Nigel-Ecma in #873 (comment)
Review in conjunction with #1663.
Dealing with “var x” – Part 1
There is an ambiguity in patterns, the input “var x” could be recognised as a declaration_pattern or as a var_pattern. As is this PR only deals with the latter, on line 191 below, and says nothing about the former.
I think the intended semantics are:
var; i.e. if it starts withvarthen var_pattern is considered.varis in scope.This is tackled with two suggestions:
Originally posted by @Nigel-Ecma in #873 (comment)