esprima
esprima copied to clipboard
Parses invalid yield in for-in statement
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