Bug 258647 - Support block scoped functions
Support block scoped functions
Status: RESOLVED FIXED
Product: javascript
Classification: Unclassified
Component: Editor
8.2
PC Linux
: P3 (vote)
: 8.2
Assigned To: Petr Pisl
issues@javascript
ecma6
:
Depends on:
Blocks: 242387
  Show dependency treegraph
 
Reported: 2016-04-04 14:31 UTC by Petr Pisl
Modified: 2016-04-27 13:13 UTC (History)
0 users

See Also:
Issue Type: TASK
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisl 2016-04-04 14:31:00 UTC
Function can be declared in ecma 6 script blocked scoped, without hoisting. 
Example:

"use strict";
var foo = function () {return 0}
console.log(foo());         // 0
{
    function foo () { return 1 }
    console.log(foo());     // 1
    {
        function foo () { return 2 }
        console.log(foo()); // 2
    }
    console.log(foo());     // 1
}
console.log(foo());         // 0


In this code there are defined 3 function foo, not one.
Comment 1 Petr Pisl 2016-04-27 13:13:30 UTC
Block scope declaration for function implemented in ecma6-truffle branch.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo