Boolean shortcuts

François REMY fremycompany_pub at
Wed Jan 4 15:23:08 PST 2012

Is breaking current code so much of a problem? If, by default, javascript 
refers to "ES5" and if we introduce a "use version 6" pragma, breaking old 
code isn't a problem anymore. Scripting languages on UNIX are doing exactly 
this []. The first line indicate 
the compiler/interpretor to use. That way you will never break the web, but 
you allow ECMAScript to move forward. We really need this.

That doesn't mean we have to start over a new language but if, to make the 
language better, we have to make some changes that will have a minor impact 
on existing code (seriously, who is using code blocks at all?), this should 
not be a blocking issue. The comitee removed the with functionnality in ES5 
strict. That wasn't a problem. People can still use their old code and can 
opt-in for a new version with stricter rules.

For people wanting to convert old code to ES6, there will be automated tools 
that can predict reliably if your code continues to work under ES6 and can 
notice you of problems. If those are rare engouh, most of our code will 
continue to run.

-----Message d'origine----- 
From: Brendan Eich
Sent: Thursday, January 05, 2012 12:03 AM
To: es-discuss
Subject: Re: Boolean shortcuts

On Jan 4, 2012, at 2:56 PM, Brendan Eich wrote:

> On Jan 4, 2012, at 1:57 PM, Herby Vojčík wrote:
>> Hi,
>> as I already posted in the parallel thread, there is that strawman called 
>> "do expression" by dherman that does just that.
>> I feel like crying when I see how powerful data constructs could be if 
>> not hampered by "possible to parse as code block" ambiguity.
> Yes, I have felt like crying too -- I did some work (see 

I should have also linked:

Of course,

is much simpler.

Neither addresses the empty-block/object issue by trying to evaluate {} as 
an object literal where today it's a block statement.


es-discuss mailing list
es-discuss at 

More information about the es-discuss mailing list