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 252232 - Local variable is marked as global
Summary: Local variable is marked as global
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-04 14:31 UTC by Petr Pisl
Modified: 2015-05-13 08:23 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisl 2015-05-04 14:31:45 UTC
Have a simple code:

var MyLib = new function MyLib() {
    var functions = {
        fn1: function MyLib_fn1(data, id) {
            var xxx = data[id];
            
            this.xxx = xxx;    // <- here is the second xxx marked as global
        }
    };
};


The second xxx indent is marked as global variable, but is declared the line above.
Comment 1 Petr Pisl 2015-05-13 08:23:29 UTC
Caused by the line this.xxx = xxx. If the filed name would be different, then it works correctly -> problem in the same name of field and variable.