PDA

View Full Version : [FIXED] Ext.Array.intersect bug



troels
23 Nov 2012, 5:54 AM
Hello Sencha,

I've found a bug in the Ext.Array class in the intersect method. I presume it's there in all versions.

In the main loop for traversing the minimum array, the for loop has the conditions



for (i = 0,ln = minArray.length; i < ln,x = minArray[i]; i++)


In the condition that's evaluated after each iteration, someone has been a little too clever and written the condition


i < ln,x = minArray[i]

This comma expressions ignores the actual result of the loop and returns the second expression as the result.
In my case, there is a 0 in the array of values, causing the look to stop prematurely.

mitchellsimoens
23 Nov 2012, 7:08 AM
Thanks for the report! I have opened a bug in our bug tracker.

olegtaranenko
26 Nov 2012, 1:40 PM
one kind of bad programmers practice :P