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

Summary: Local variable is marked as global
Product: javascript Reporter: Petr Pisl <ppisl>
Component: EditorAssignee: Petr Pisl <ppisl>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

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.