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 252469 - False positive 'The global variable "xxx" is not declared.' for "obj[id] = xxx = [];"
Summary: False positive 'The global variable "xxx" is not declared.' for "obj[id] = xx...
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-18 15:26 UTC by NukemBy
Modified: 2015-05-22 02:57 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (6.69 KB, image/png)
2015-05-18 15:26 UTC, NukemBy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NukemBy 2015-05-18 15:26:10 UTC
Created attachment 153731 [details]
screenshot

One more case for "The global variable "xxx" is not declared."

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
var MyLib = new function MyLib() {
    var _events;
     
    this.on = _on; 
    
    function _on(evtId, handler) {
        var handlers = _events[evtId];
        
        if( !handlers )
            _events[evtId] = handlers = []; // <-- related line
        
        return handlers.push(handler); // <-- here
    };
};
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

Warning disappears when double assignment in previous line is changed to single.
See screenshot for details.

Occurs in NetBeans IDE Dev (Build 201505170001).
Comment 1 Petr Pisl 2015-05-20 13:57:25 UTC
Fixed in web-main. Caused by wrong handling creating new Array objects.
Comment 2 Quality Engineering 2015-05-22 02:57:08 UTC
Integrated into 'main-silver', will be available in build *201505220001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/cf98fcbc5fe3
User: Petr Pisl <ppisl@netbeans.org>
Log: #252469 - False positive 'The global variable "xxx" is not declared.' for "obj[id] = xxx = [];"