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.
Summary: | Parameter incorrectly reported as unused | ||
---|---|---|---|
Product: | javascript | Reporter: | RobertJohnson |
Component: | Editor | Assignee: | Petr Pisl <ppisl> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | terje7601 |
Priority: | P3 | ||
Version: | 8.0 | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
Javascript function parameter marked as unused
js function source file showing unused parameter warning |
Created attachment 148519 [details]
js function source file showing unused parameter warning
reproducible Product Version: NetBeans IDE 8.0.1 RC1 (Build 201408031330) Java: 1.8.0_11; Java HotSpot(TM) 64-Bit Server VM 25.11-b03 Runtime: Java(TM) SE Runtime Environment 1.8.0_11-b12 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb) The problem is that the param has the same name as the private variable. It's not very good code, but maybe there should be a parameter redefinition warning instead? *** Bug 253676 has been marked as a duplicate of this bug. *** The first case work correctly in dev build, but this simple case doesn't work: function UnusedParameter(ctl) { console.log(ctl); var ctl = 20; console.log(ctl); } Integrated into 'main-silver', will be available in build *201608100002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/c915cd0f7ba8 User: Petr Pisl <ppisl@netbeans.org> Log: #246239 - Parameter incorrectly reported as unused Adding test for the first case This seems fixed in 8.2 |
Created attachment 148518 [details] Javascript function parameter marked as unused In the attached screen shot, the function parameter is used on line 4, then reassigned on line 5. As a result the parameter is underlined as 'unused' incorrectly.