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 258646 - Support block scoped variables
Summary: Support block scoped variables
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:16 UTC by Petr Pisl
Modified: 2016-04-27 13:12 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:16:56 UTC
Ecma 6 script introduce block scope variables without hoisting. For example 

"use strict";
var y = {
        name: "Honza",
        age: 12
    };
console.log(y);             // { name: 'Honza', age: 12 }
if (true) {
    let y = "test";
    console.log(y);         // test
    for (let i = 0; i < 3; i++) {
        let y = i;
        console.log(y);     // 0 1 2
    }
    console.log(y);         // test
}

console.log(y);             // { name: 'Honza', age: 12 }

Currently we mark 'y' in every occurrence, but there three variables of y in the code. Should be marked only its scoped.
Comment 1 Petr Pisl 2016-04-27 13:12:30 UTC
Block declaration scope for variables implemented in ecma6-trufle branch.