shapesecurity / shift-parser-js

ECMAScript parser that produces a Shift format AST
http://shift-ast.org/parser.html
Apache License 2.0
249 stars 28 forks source link

Invalid left-hand side expression in postfix operation causes earlyErrors "false" test to fail #321

Closed Shilpi3 closed 7 years ago

Shilpi3 commented 7 years ago

input script 563: 0++ input script 564: 0-- input script 565: ++0 input script 566: --0

earlyErrors: false Expected: No Exception Actual: Exception ` ../shift-parser-js/dist/parser.js:1533 throw this.createErrorWithLocation(startLocation, _errors.ErrorMessages.INVALID_UPDATE_OPERAND); ^

Error: [1:1]: Increment/decrement target must be an identifier or member expression `

bakkot commented 7 years ago

This is indeed supposed to be an early error, but our AST format can't represent that program. Closing as WONTFIX.