You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In member_expression and subscript_expression, just parse lhs as an expression
This is simpler and more intuitive, and it will prevent the left-hand-side of 'a ?. ()' from
being parsed as a bare identifier followed by a '?.' token. We need the 'a' to be wrapped
in an expression in order for that construct to parse as a call expression.
This works, except that it breaks the parsing of 'new Foo.Bar()'. That code should parse as a
'new_expression' with arguments, but it now parses as a 'call_expression' *containing*
a 'new_expression'.
The reason for the breakage is that 'new_expression' has a non-zero precedence, and it
still allows a plain 'identifier' after the 'new' (as opposed to an expression). So when
the parser sees the '.' token in 'new Foo.Bar()', it needs to decide whether the 'Foo'
is an 'expression' or part of a 'new_expression'. Because of the non-zero precedence on
'new_expression', it chooses the latter (which is wrong).
0 commit comments