Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid UpdateExpression's arguments #2115

Open
wind-of opened this issue Jun 10, 2022 · 0 comments
Open

Invalid UpdateExpression's arguments #2115

wind-of opened this issue Jun 10, 2022 · 0 comments

Comments

@wind-of
Copy link

wind-of commented Jun 10, 2022

Invalid UpdateExpression's arguments

Esprima' UpdateExpression's argument is one of: ObjectExpression, ArrayExpression, MemberExpression, Identifier.

Consider behaviour of V8:
image

Should be:
Argument of UpdateExpression is one of: Identifier, MemberExpression

Steps to reproduce

esprima.parse('--[]') // or --{}, []--, (++[]), etc.

Expected output

Expected "Invalid left-hand side expression in prefix operation"

Actual output

{
  "type": "UpdateExpression",
  "operator": "--",
  "argument": {
    "type": "ArrayExpression",
    "elements": []
  },
  "prefix": true
}

Relevant references

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant