Skip to content

Fix parsing error in exponent expressions with unary left-hand sides.#201

Merged
lahma merged 2 commits into
sebastienros:mainfrom
jogibear9988:fixUnaryHandLeftSides
Nov 2, 2021
Merged

Fix parsing error in exponent expressions with unary left-hand sides.#201
lahma merged 2 commits into
sebastienros:mainfrom
jogibear9988:fixUnaryHandLeftSides

Conversation

@jogibear9988
Copy link
Copy Markdown
Contributor

Esprima (correctly) rejects expressions like -1**2. - jquery/esprima#2070
However, expressions like (-1)**2 are valid but still rejected.
This commit fixes this issue by identifying when the left operand
is parenthesized.

Fixes jquery/esprima#1981

Esprima (correctly) rejects expressions like -1**2. - jquery/esprima#2070
However, expressions like (-1)**2 are valid but still rejected.
This commit fixes this issue by identifying when the left operand
is parenthesized.

Fixes jquery/esprima#1981
@sebastienros
Copy link
Copy Markdown
Owner

Can you add the test case?

Copy link
Copy Markdown
Collaborator

@lahma lahma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good 👍🏻

@lahma lahma merged commit b7a1ed0 into sebastienros:main Nov 2, 2021
@jogibear9988 jogibear9988 deleted the fixUnaryHandLeftSides branch January 3, 2022 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parsing error with unary and exponentiation operator

3 participants