Restrict duplicate keys #2352

wants to merge 2 commits into

4 participants


This is my proposal for disallowing object initialisers with duplicate keys. Opened at the request of @jashkenas.


Thanks for putting this on a branch. Much appreciated.


just curious — why indirect eval is a shitty solution? It doesn't hit performance / minifiers like direct one.

  1. Creating strings of code and evaluating them dynamically is bad style. You can't always statically type or analyse it. Using it to parse a single value with a known format in the way that we are, though, is an exception, and is not very detestable.

  2. We're tightly binding the definition of CoffeeScript strings/numbers to JavaScript.

So not terrible, but still worth avoiding if we can. It's a trade-off.


bumpin' @michaelficarra ?

@vendethiel vendethiel closed this Feb 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment