This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 258647 - Support block scoped functions
Summary: Support block scoped functions
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks: 242387
  Show dependency tree
 
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
Exception Reporter:


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.