A bit confused by B.3.2 - Web Legacy Compatibility for Block-Level Function Declarations
John Lenz
concavelenz at gmail.com
Fri Jun 6 09:08:54 PDT 2014
Or a link to the discussion that led to the content of this section?
On Thu, Jun 5, 2014 at 9:51 AM, John Lenz <concavelenz at gmail.com> wrote:
> Is there any place that has some concrete examples of the different cases
> we are trying support with this section (and whether the function is block
> scoped or not in each case)?
>
>
> On Thu, Jun 5, 2014 at 9:45 AM, Allen Wirfs-Brock <allen at wirfs-brock.com>
> wrote:
>
>>
>> On Jun 5, 2014, at 8:14 AM, John Lenz <concavelenz at gmail.com> wrote:
>>
>> On Wed, Jun 4, 2014 at 8:52 PM, Allen Wirfs-Brock <allen at wirfs-brock.com>
>> wrote:
>>
>>>
>>> We don’t want to leave the meaning of function declarations in blocks
>>> completely unspecified, as in ES1-5 as we; know there are legacy
>>> compatibility requirements for them. So, we need to have some semantics
>>> for them. The easiest way to provide any semantics is to simply use the
>>> same block scoping semantics that is used in strict mode (slight
>>> augmented to over the legacy intersection semantics). That actually
>>> limits the refactoring hazard because as long as you have no code that
>>> depends upon the legacy intersection there is no difference between the
>>> function in block strict and sloppy semantics.
>>>
>>>
>> It is the slightly augmented part that seems to be the problem here. It
>> is (1) very confusing and (2) creating the refactoring hazard: introducing
>> a function of the same name in a different block breaks the scoping. I
>> would be happy to be misunderstanding that section.
>>
>>
>> Nobody likes the augmented part, but it’s what is necessary for web
>> legacy compatibility.
>>
>> Allen
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140606/1579dd81/attachment.html>
More information about the es-discuss
mailing list