Re: Legacy const, attempt 2 (Re: Legacy const)

2012-04-19 Thread gaz Heyes
On 18 April 2012 19:13, Geoffrey Sneddon gsned...@opera.com wrote:

 I've just had it pointed out to me that my original email made little
 sense, so let's try again:

 const has historically been needed in non-strict/strict code for web
 compatibility on non-IE code (typically either down to server-side UA
 sniffing or just explicitly non-support of IE). IE still doesn't support
 it, which may suggest it's not needed for compatibility any more, but as
 far as I can tell removing it would break enough to make it infeasible.

 As such, we should spec it: likely block-scoped in modules, and
 function-scoped otherwise. We should only really not spec it if we can get
 everyone who currently supports it to drop it.


IE has consts, use execScript with vbs. I think Andrea did a blog post on
it:

http://webreflection.blogspot.co.uk/2007/10/cow-javascript-define-php-like-function.html


The const keyword is a little freaky overall, Firefox seems to support it
yet Opera (last time I checked) supports the keyword but doesn't perform a
const operation.
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Legacy const, attempt 2 (Re: Legacy const)

2012-04-19 Thread Brendan Eich

gaz Heyes wrote:
IE has consts, use execScript with vbs. I think Andrea did a blog post 
on it:

http://webreflection.blogspot.co.uk/2007/10/cow-javascript-define-php-like-function.html


Any port in a storm, but c'mon -- we're talking about 'const x = 42;' 
written in JS. That has never been supported in IE and I recall an IE 
blog post (from Allen, if memory serves) about why not.


/be
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Legacy const, attempt 2 (Re: Legacy const)

2012-04-19 Thread Allen Wirfs-Brock

On Apr 19, 2012, at 10:58 AM, Brendan Eich wrote:

 gaz Heyes wrote:
 IE has consts, use execScript with vbs. I think Andrea did a blog post on it:
 http://webreflection.blogspot.co.uk/2007/10/cow-javascript-define-php-like-function.html
 
 Any port in a storm, but c'mon -- we're talking about 'const x = 42;' written 
 in JS. That has never been supported in IE and I recall an IE blog post (from 
 Allen, if memory serves) about why not.

http://blogs.msdn.com/b/ie/archive/2010/08/25/chakra-interoperability-means-more-than-just-standards.aspx
 

But that was then and the world is different today. I certainly don't know 
anything about the plans for IE10.

Allen




___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Legacy const, attempt 2 (Re: Legacy const)

2012-04-18 Thread Geoffrey Sneddon
I've just had it pointed out to me that my original email made little 
sense, so let's try again:


const has historically been needed in non-strict/strict code for web 
compatibility on non-IE code (typically either down to server-side UA 
sniffing or just explicitly non-support of IE). IE still doesn't support 
it, which may suggest it's not needed for compatibility any more, but as 
far as I can tell removing it would break enough to make it infeasible.


As such, we should spec it: likely block-scoped in modules, and 
function-scoped otherwise. We should only really not spec it if we can 
get everyone who currently supports it to drop it.


--
Geoffrey Sneddon — Opera Software
http://gsnedders.com
http://opera.com
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Legacy const, attempt 2 (Re: Legacy const)

2012-04-18 Thread Brendan Eich

Geoffrey Sneddon wrote:
As such, we should spec it: likely block-scoped in modules, and 
function-scoped otherwise. We should only really not spec it if we can 
get everyone who currently supports it to drop it. 


The TC39 group met early this year (IIRC it was the Yahoo!-hosted 
meeting in January) and Gavin B. of Apple agreed to try changing const 
to match ES6 (block-scoped everywhere), and to reserve 'let' everywhere too.


TC39 is not inclined to maximize compatibility for 'const' given 
non-support in IE so far, and enough non-interoperation among the other 
browser implementations to keep web developers from relying on it even 
in non-IE (if (!document.all)) code forks.


/be
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Legacy const, attempt 2 (Re: Legacy const)

2012-04-18 Thread Oliver Hunt

On Apr 18, 2012, at 11:32 AM, Brendan Eich bren...@mozilla.org wrote:

 Geoffrey Sneddon wrote:
 As such, we should spec it: likely block-scoped in modules, and 
 function-scoped otherwise. We should only really not spec it if we can get 
 everyone who currently supports it to drop it. 
 
 The TC39 group met early this year (IIRC it was the Yahoo!-hosted meeting in 
 January) and Gavin B. of Apple agreed to try changing const to match ES6 
 (block-scoped everywhere), and to reserve 'let' everywhere too.

Alas reserving let everywhere failed, at least one canadian bank has some 
(really screwed up) code that has a variable named let.  Gavin and I are 
pondering the difficulty of having let reserved everywhere unless you use it in 
a non-let syntax.

 
 TC39 is not inclined to maximize compatibility for 'const' given non-support 
 in IE so far, and enough non-interoperation among the other browser 
 implementations to keep web developers from relying on it even in non-IE (if 
 (!document.all)) code forks.
 
 /be
 ___
 es-discuss mailing list
 es-discuss@mozilla.org
 https://mail.mozilla.org/listinfo/es-discuss

___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss