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 uninitialized let (destructing assignment) in the for statement throws Error with "earlyErrors" set as false #318

Closed Shilpi3 closed 7 years ago

Shilpi3 commented 7 years ago

input script 190: for(let [let];;); input script 205: for(let [a, a];;) earlyErrors: false

Expected: No Exceptions Actual: Exception

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

Error: [1:15]: Binding pattern appears without initializer in for statement init `

bakkot commented 7 years ago

This is a misclassified test; shift-parser is correct.

michaelficarra commented 7 years ago

@Shilpi3 It looks like script 205 is not what you've copied into this issue.

bakkot commented 7 years ago

Moved to https://github.com/tc39/test262-parser-tests/issues/11