| Summary: | [quickfix] provide fixes for no-new-wrappers rule | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Michael Rennie <Michael_Rennie> |
| Component: | JS Tools | Assignee: | Michael Rennie <Michael_Rennie> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | ||
| Version: | 11.0 | ||
| Target Milestone: | 11.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
We should offer the following fixes for the no-new-wrappers rule: 1. remove the 'new' keyword (perhaps they actually want to call the function) 2. convert the value to a literal, for example: var n = new String("hi"); -> var n = "hi"; var n = String(); -> var n = ""; var n = new Boolean(true); -> var n = true; var n = Boolean(); -> var n = false; var n = new Number(12); -> var n = 12; var n = Number(); -> var n = 0;