In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
125 [In-Portal CMS] Optimization bug report always 2009-07-19 07:39 2009-10-03 07:56
alex  
alex  
normal  
closed 4.3.9  
fixed  
 
none 5.0.0  
0
0000125: Javascript cycle "for (index in array)" is used for arrays - replace with normal "for (index = 0; i < array.length; i++)"
Currently in some places arrays are accessed as objects in cycles:
var arr = ['one', 'two'];
for (var elem in arr) {
    alert( arr[elem] );
}

This approach works until someone adds new methods to Array class declaration. I propose to change such approach to normal "for" cycle:
var arr = ['one', 'two'];
for (var elem = 0; i < arr.length; elem++) {
    alert( arr[elem] );
}
child of 0000173closed  (5.0.1)alex In-Commerce Save button won't work on Add Product Options 
Issue History
2009-10-03 07:56 administrator Note Added: 0000649
2009-10-03 07:56 administrator Status resolved => closed
2009-08-04 09:21 alex Relationship added child of 0000173
2009-08-04 09:20 alex Changeset attached 5.0.x r12163
2009-07-19 08:17 alex Fixed in Version => 5.0.0
2009-07-19 08:17 alex Target Version => 5.0.0
2009-07-19 08:16 alex Note Added: 0000154
2009-07-19 08:16 alex Status active => resolved
2009-07-19 08:16 alex Resolution open => fixed
2009-07-19 08:16 alex Assigned To => alex
2009-07-19 08:16 alex Changeset attached RC r11932
2009-07-19 08:16 alex Summary Javascript cycle "for (index in array)" is used for arrays - replace with normal "for (index = 0; i < array.length; i++) => Javascript cycle "for (index in array)" is used for arrays - replace with normal "for (index = 0; i < array.length; i++)"
2009-07-19 07:39 alex New Issue

Notes
(0000154)
alex   
2009-07-19 08:16   
Fix committed to RC branch. Commit Message:

Fixes 0000125: Javascript cycle "for (index in array)" is used for arrays - replace with normal "for (index = 0; i < array.length; i++)"
(0000649)
administrator   
2009-10-03 07:56   
Closing issues from 5.0.0 version, because version was already released.