Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: JAVASCRIPT-1.0
-
Component/s: JavaScript
-
Labels:None
-
Number of attachments :
Issue Links
- depends upon
-
SONARPLUGINS-1788
Provide JavaScript rule engine based on SSLR
-
- relates to
-
SONARPLUGINS-2508
Rule : Source should comply with the javascript strict mode
-
Manually tested !
Extend the description with the following section :
<p>The with statement was intended to provide a shorthand in accessing properties in deeply nested objects. Unfortunately, it behaves very badly when setting new properties. Never use the with statement. Use a var instead.</p> <pre> var ooo.eee.oo.ah_ah.ting.tang.walla.walla.bing = true; var ooo.eee.oo.ah_ah.ting.tang.walla.walla.bang = true; </pre> instead of <pre> with (ooo.eee.oo.ah_ah.ting.tang.walla.walla) { bing = true; bang = true; } </pre>