JazzleWare / jazzle-parser

relatively small and ridiculously fast parser for all versions of ECMAScript/Javascript, written in the greatest common divisor of all versions of ECMAScript
MIT License
8 stars 2 forks source link

What should the error reported by `function *l() { (yield=12)=>12; }` be? #6

Closed nenionoda closed 7 years ago

nenionoda commented 8 years ago

Hello as it currently stands, this results in a 'unexpected =`; i know it is being rather too pedantic, and that it might require extra work to achieve it, but I believe it should be 'invalid parameter name: yield' instead.

icefapper commented 7 years ago

yield is an actual keyword in generator context; as a result, (yield=12)=>12 inside a generator is as much an error as (while=12)=>12 is. ADHD is nothing to be ashamed about (Zooey Deschanel also has it.)

But please make sure you are no longer inflicted with the next time you file a ticket on this repo.