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

Summary: Support block scoped functions
Product: javascript Reporter: Petr Pisl <ppisl>
Component: EditorAssignee: Petr Pisl <ppisl>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Linux   
Issue Type: TASK Exception Reporter:
Bug Depends on:    
Bug Blocks: 242387    

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.