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

Using Invalid left-hand side in assignment causes earlyErrors "false" test to fail #323

Closed Shilpi3 closed 7 years ago

Shilpi3 commented 7 years ago

Input string 572 : 0=0; Input string 574: ({a} += 0) Input string 575: [a] *= 0; Input string 581: for({a: 0} in 0); Input string 582: for([0] in 0); Input string 583: for({a: 0} of 0); Input string 585:for([0] of 0); Input string 586: for(0 in 0) Input string 587: for(0 of 0); Input string 588: for(({a: 0}) in 0); Input string 589: for(([0]) in 0); Input string 590: for(({a: 0}) of 0); Input string 591: for(([0]) of 0); Input string 592: for((0) in 0); Input string 593: for((0) of 0);

earlyErrors as false Expected: No Exception Actual: Exception

`..shift-parser-js/dist/parser.js:1182 throw this.createError(_errors.ErrorMessages.INVALID_LHS_IN_ASSIGNMENT); ^

Error: [1:9]: Invalid left-hand side in assignment`

bakkot commented 7 years ago

These are indeed supposed (here and here) to be an early error, but our AST format can't represent these programs. Closing as WONTFIX.