> On 2011-10-27 19:22:25, Dan Dumont wrote: > > http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/selection/selection.js, > > line 81 > > <https://reviews.apache.org/r/2576/diff/2/?file=53802#file53802line81> > > > > The way I like to write this is: > > for (var i = 0, savedListener; savedListener=listeners[i]; i++) { > > // no need to check length. > > if(savedListener===listener) { > > listeners.splice(i, 1); > > break; > > } > > }
Only do that, though, if you know your array will not have falsey values (null, undefined, "", or 0, etc) - Dan ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/2576/#review2883 ----------------------------------------------------------- On 2011-10-27 15:45:02, Jason Chiang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/2576/ > ----------------------------------------------------------- > > (Updated 2011-10-27 15:45:02) > > > Review request for shindig, Ryan Baxter and Dan Dumont. > > > Summary > ------- > > IE8 doesn't support both "forEach" and "indexOf" Javascript methods, replace > these methods with for loop. > > > This addresses bug SHINDIG-1652. > https://issues.apache.org/jira/browse/SHINDIG-1652 > > > Diffs > ----- > > > http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/selection/selection.js > 1189339 > > http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/selection/selection_container.js > 1189339 > > Diff: https://reviews.apache.org/r/2576/diff > > > Testing > ------- > > Test it with the sample container in IE8 > > > Thanks, > > Jason > >
