espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.78k stars 746 forks source link

SyntaxError not thrown for duplicate parameters in arrow functions #2544

Open theauk opened 2 months ago

theauk commented 2 months ago

https://github.com/espruino/Espruino/commit/ff487e008472deff8113a32ebd3217dbd606405c

Test Case

(a, a) => {  }

Expected Behavior I would expect to see a syntax error about duplicated parameters not being allowed in this context. Running the test case on other JavaScript engines (Node, Hermes, QuickJS, Deno, Ecargot), I get some version of a duplicated parameter SyntaxError.

gfwilliams commented 2 months ago

Thanks for these reports! I'll take a look at them when I get a bit of free time.

In the mean time if you or anyone else wants to contribute fixes that'd be awesome!