Propose simpler string constant

Brendan Eich brendan.eich at
Tue Dec 15 19:49:00 UTC 2015

What's wanted is `enum { APPLE, ORANGE, GRAPE }` instead.

Turns out `enum` was one of four Java-ish future reserved words that IE
actually reserved from the ancient days. So we could use it. Some
half-formed talk of using it to define categorical sum types, and even
value types -- i.e., allowing constructors for the parts of sum, and other
operations a la methods.


On Tue, Dec 15, 2015 at 11:45 AM Jordan Harband <ljharb at> wrote:

> That seems hazardous - if someone is converting a "var" codebase to
> "const" and "let", and they convert `var foo;` to `const foo;` expecting it
> to be undefined, the current TDZ error will be much more helpful to them
> than a silent change of meaning in their code to `const foo = 'foo';`.
> On Tue, Dec 15, 2015 at 8:35 AM, Kip Obenauf <mozilla at>
> wrote:
>> A common pattern I see is this:
>> Would it be helpful to allow a shorter version of this to be:
>> Rather than have that just be forever undefined, it could automatically
>> refer to a string of the same name, i.e. 'ADD_ALL_THE_STUFF'.
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at
> _______________________________________________
> es-discuss mailing list
> es-discuss at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list