excluding features from sloppy mode

Oliver Hunt oliver at apple.com
Wed Jan 16 11:40:48 PST 2013


Even 10?  If that's the case anything using const is inherently tied to jsc,v8,moz,opera behaviour.

Presumably the strictest of those _works_, but maybe i'm wrong?

We should probably just enumerate all the differences and see which can be coalesced and which make "sense" in sloppy mode.

Obvious cases i can think of:

--
const x;
--
var x;
const x;
x = 5;
--
const x;
var x;
x = 5;
--
const x =4;
var x = 5;
log(x)
--
if (..)
   const x = ....
else
   const x = ....
--

That's it for now.  Maybe block scoping const will work in sloppy mode?  is for (const x = ...) valid?

--Oliver



On Jan 16, 2013, at 11:31 AM, Brendan Eich <brendan at mozilla.com> wrote:

> There's no const in IE, so we are pretty sure we can take the hit of breaking "Mozilla" (non-IE branches, also WebKit, maybe Opera) code that uses const.
> 
> /be
> 
> Brandon Benvie wrote:
>> The incompatibilities between let/const as implemented in V8 and Spidermonkey and how they're specified in ES6 are an additional factor:
>> 
>> * Per iteration loop binding (V8 and Spidermonkey don't do this for let/const).
>> * TDZ. `x; const x = 10` works in V8 and Spidermonkey currently, specified to throw ReferenceError in ES6
>> 
>> I think there's other differences.



More information about the es-discuss mailing list