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 in the for statement with script mode throws Error with "earlyErrors" set as false #317

Closed Shilpi3 closed 7 years ago

Shilpi3 commented 7 years ago

input script 88 : "use strict"; for (let [a = let];;) {} input script 90: "use strict"; for (let {a: b = let};;) {} 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:34]: Binding pattern appears without initializer in for statement init

bakkot commented 7 years ago

These are both invalid tests. Opened https://github.com/tc39/test262-parser-tests/issues/11.

We should be sure we have versions of these with the missing initializers also.