Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 485877

Summary: [quickfix] provide fixes for no-new-wrappers rule
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: 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:

Description Michael Rennie CLA 2016-01-14 14:54:56 EST
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;