esprima icon indicating copy to clipboard operation
esprima copied to clipboard

Parses invalid yield in for-in statement

Open ghost opened this issue 8 years ago • 0 comments

When a yield (@mikesherov ) appears within the Initializer of an AssignmentElement outside of a generator function body, it behaves as an IdentifierReference. (For..in statement)

Steps to reproduce

esprima.parse('for ([ x = yield ] in [[]]) ;')

Expected output

Should throw

Actual output

Parses invalid AST

ghost avatar Dec 05 '17 02:12 ghost