I believe that would be interoperable as long as each such function is only 
declared and used within a single block.  Multiple declarations with the same 
function name in separate blocks wouldn't be interoperable among all browsers.

Allen

> -----Original Message-----
> From: Michael Day [mailto:mike...@yeslogic.com]
> Sent: Thursday, November 11, 2010 4:48 PM
> To: Brendan Eich
> Cc: ES-Discuss; Allen Wirfs-Brock
> Subject: Re: Function declarations as statements
> 
> Hi Brendan and Allen,
> 
> Thanks for the pointers.
> 
> > So for Harmony, we are reclaiming function in block (must be a direct child 
> > of
> a braced block) to bind a block-local name on block entry (so hoisting lives, 
> but
> only to top of block -- so you can't emulate with var f = function ...).
> 
> If we implemented this behaviour now, I think that would be sufficient to make
> JQuery and Raphaƫl work. Here is an example from JQuery that is giving us
> trouble:
> 
> if (condition) {
>      var val, props, ... ;
> 
>      function getWH() { ... this is the function ... }
> 
>      if ( elem.offsetWidth !== 0 ) {
>          getWH();
>      } else {
>          jQuery.swap( elem, props, getWH );
>      }
> 
>      return Math.max(0, Math.round(val)); }
> 
> The getWH() function is declared in the block and only used in the block, so 
> if we
> hoisted the definition to the top of the block there would not be any problems
> with this usage.
> 
> Best regards,
> 
> Michael
> 
> --
> Print XML with Prince!
> http://www.princexml.com

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

Reply via email to