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 destructuring assignment target causes earlyErrors "false" test to fail #322

Closed Shilpi3 closed 7 years ago

Shilpi3 commented 7 years ago

Input string 567: ({a: 0} = 0); Input string 568: ({get a(){}} = 0) Input string 570: ({set a(b){}} = 0) Input string 571: [0] = 0 Input string 577: [...{a: 0}] = 0; Input string 578: [...[0]] = 0; Input string 579: [...0] = 0; Input string 580: [...new a] = 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 all misclassified: see the supplemental syntax section here. See tc39/test262-parser-tests#11.