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.
Please try following code in either JS file or embedded in HTML: var pool = []; // purple function makeRequests() { pool = []; // green for (var i = 0; i < numberOfRequests; i++) { pool[i] = i; // green } } and notice "pool" variable: 1) On line with declaration, it is purple but 2 following occurrences are green 2) Navigator shows pool twice, once in global scope, once below makeRequests function 3) if you select "purple" pool and press Ctrl+R, two following occurrences are not renamed (also "mark occurrences" ignores them). The same happens vice versa, if you try "green" pool and repeat, only 2nd green is highlighted/renamed, purple one is ignored. It seems to be caused by the pool = [] inside makeRequests function. It is reproducible also if the entire code is inside another function I'd vote for P2 but I don't have a string opinion (it is reproducible in 7.4 as well and no one noticed it) Product Version: NetBeans IDE Dev (Build 201401030002) Java: 1.8.0-ea; Java HotSpot(TM) Client VM 25.0-b65 Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b122 System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Seems like it happens just with [] array. If pool would be var pool = new Date() and the same in makeRequests() it works, the same for {} or combination of both => P3
Fixed in web-main.
Integrated into 'main-silver', will be available in build *201401170001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/5c99a50720eb User: Petr Pisl <ppisl@netbeans.org> Log: #239967 - Variable incorrectly marked as local after assignment
Thank you, verified Product Version: NetBeans IDE Dev (Build 201401170001) Java: 1.8.0-ea; Java HotSpot(TM) Client VM 25.0-b65 Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b122 System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)