Closed luiscubal closed 3 years ago
Parse the following code:
esprima.parse('(-1) ** 2')
The expression (-1) ** 2 is accepted by mainstream browsers as valid and I believe that Esprima should accept it as well.
Esprima fails with the following error:
> esprima.parse('(-1)**2') Uncaught Error: Line 1: Unexpected token ** <stack trace>
The reason for Esprima's failure is that it identifies "(-1) 2" as "-1 2" which is indeed invalid.
Nevermind, I think this is a duplicate of https://github.com/jquery/esprima/issues/1981
Steps to reproduce
Parse the following code:
Expected output
The expression (-1) ** 2 is accepted by mainstream browsers as valid and I believe that Esprima should accept it as well.
Actual output
Esprima fails with the following error:
Relevant references
The reason for Esprima's failure is that it identifies "(-1) 2" as "-1 2" which is indeed invalid.