RE: Functions as blocks

2014-03-06 Thread Brian Terlson
. Although, to provide some context, the same set contains nearly 2000 sites that declare functions in blocks (~60 of those declare those functions in loops). John Barton wrote: As you say all browsers seem to allow it. Browsers made the mistake and we should not go back now and blame developers

Re: Functions as blocks

2014-03-06 Thread Allen Wirfs-Brock
On Mar 6, 2014, at 10:07 AM, Brian Terlson wrote: Chakra, and other implementations I imagine, will remove features that are non-standard and are unused. Getting usage data is the hard part, so anything concrete anyone can share would be helpful. I am in favor of removing this if we can

Functions as blocks

2014-03-05 Thread Brian Terlson
We have discussed, at length, the various ways in which browsers differ in their handling of functions-in-blocks: ```js if(test) { function foo() { } } ``` At the last TC-39 we approved semantics for block-scoped functions in sloppy mode. We did not discuss directly, that I recall

Re: Functions as blocks

2014-03-05 Thread Brendan Eich
Brian Terlson wrote: I haven't collected much data on this so I'm not sure what the prevalence is, Can you try to find some sightings in the wild? /be ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

RE: Functions as blocks

2014-03-05 Thread Brian Terlson
Brendan Eich wrote: Brian Terlson wrote: I haven't collected much data on this so I'm not sure what the prevalence is, Can you try to find some sightings in the wild? I have searched my Alexa Top 10k dataset and didn't find any occurrences. The dataset has the same limitations as before

Re: Functions as blocks

2014-03-05 Thread John Barton
On Wed, Mar 5, 2014 at 3:08 PM, Brian Terlson brian.terl...@microsoft.comwrote: Brendan Eich wrote: Brian Terlson wrote: I haven't collected much data on this so I'm not sure what the prevalence is, Can you try to find some sightings in the wild? I have searched my Alexa Top 10k

Re: Functions as blocks

2014-03-05 Thread Brendan Eich
John Barton wrote: As you say all browsers seem to allow it. Browsers made the mistake and we should not go back now and blame developers on smaller sites because they use this kind of code. Make it a syntax error in modules and save yourself a lot of headaches. We could do this for sure,

Re: Functions as blocks

2014-03-05 Thread Allen Wirfs-Brock
On Mar 5, 2014, at 6:23 PM, Brendan Eich wrote: John Barton wrote: As you say all browsers seem to allow it. Browsers made the mistake and we should not go back now and blame developers on smaller sites because they use this kind of code. Make it a syntax error in modules and save yourself

Re: Functions as blocks

2014-03-05 Thread Brendan Eich
On Mar 5, 2014, at 6:53 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Mar 5, 2014, at 6:23 PM, Brendan Eich wrote: John Barton wrote: As you say all browsers seem to allow it. Browsers made the mistake and we should not go back now and blame developers on smaller sites because

Re: Functions as blocks

2014-03-05 Thread Boris Zbarsky
On 3/5/14 4:26 PM, Brian Terlson wrote: I haven't collected much data on this so I'm not sure what the prevalence is Given the number of stackoverflow posts I've seen that come down to browsers not being exactly compatible on their handling of this code, its prevalence is too high to allow

Functions in blocks?

2013-09-13 Thread Axel Rauschmayer
Has a decision been made how to handle functions in blocks in sloppy mode? Did I miss it? Similarly: are only the bodies of modules implicitly strict? Or the bodies of classes, too? Given the trick with contextually interpreting `let` as a keyword in sloppy mode, all ES6 features seem

Re: Functions in blocks?

2013-09-13 Thread Brendan Eich
:13 PM Has a decision been made how to handle functions in blocks in sloppy mode? Did I miss it? Similarly: are only the bodies of modules implicitly strict? Or the bodies of classes, too? Given the trick with contextually interpreting `let` as a keyword in sloppy mode, all ES6 features seem

Re: Functions in blocks?

2013-09-13 Thread Allen Wirfs-Brock
intersection semantics [for function in block outside of strict code], and (later) Class, Modules implicitly strict. /be Axel Rauschmayer mailto:a...@rauschma.de September 13, 2013 10:13 PM Has a decision been made how to handle functions in blocks in sloppy mode? Did I miss