| Summary: | Quick Fix for unused parameter may not fix the warning | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Grant Gayed <grant_gayed> |
| Component: | JS Tools | Assignee: | Michael Rennie <Michael_Rennie> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | Michael_Rennie |
| Version: | unspecified | ||
| Target Milestone: | 8.0 | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
This is coming from a quirk in the way Esprima attaches comments. In this case, where the function expression appears as part of a call expression, it attaches the comment to the call expression rather than the function expression (like 'normally'), so we fail to find it while linting. Good find Grant. |
- start with: var c = { fn: function(a, b) { this.window.console.log(b); }.bind(this), }; - shows a warning on line 2 (Parameter 'a' is never used) - select the "Add @callback to function" quick fix, which then gives: var c = { fn: /* @callback */ function(a, b) { this.window.console.log(b); }.bind(this), }; - save it, note that the line 2 warning is not fixed by the Quick Fix change