shapesecurity / shift-parser-js

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

Add ASI for lexical declarations in single-statement iterative statements. Fixes #389 #396

Closed Protryon closed 5 years ago

bakkot commented 5 years ago

I'd like this to wait on https://github.com/shapesecurity/shift-parser-js/pull/395 and be rebased on top of it, so that we can make sure all of the xfail'd tests for this bug start passing.

bakkot commented 5 years ago

I'd prefer if we could accomplish this without introducing more global state in the parser. I think we can instead change the check for lookaheadLexicalDeclaration in parseStatementHelper to a check specifically for let [, with no other changes.