Bug 258646 - Support block scoped variables
Support block scoped variables
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:16 UTC by Petr Pisl
Modified: 2016-04-27 13:12 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: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.


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