Sorry guys, a little OT for jQuery developers: guys did you get the fact jQuery.inArray could be easily optimized? The code I posted does not exist in the latest jQuery core.js file, you are using the loop version for every browser - it's a quick improvement, I would go for it :D
On Thu, Sep 3, 2009 at 12:20 PM, ludovic <ludothebe...@gmail.com> wrote: > > @THD > I agree with the principle of creating your own precompilation syntax, > but not to have a regression, it would be preferrable to use features > detection. > > > inArray = function( elem, array ) { > > /* @if support indexOf > * Creates correct inArray function when browser does not support > native > array.indexOf > * Use === because on IE, window == document > */ > for ( var i = 0, length = array.length; i < length; i++ ) > if ( array[ i ] === elem ) > return i; > return -1; > /* @else */ > return array.indexOf(elem); > /* @ */ > } > > And create a database of correspondances between features support and > browsers. Then, when you want to create your IE file, you search in > your correspondances what features are known to be supported by the IE > version, and then, excecute precomputation tests by replacing features > detection by the value. > > It would cost much less work to make the migration of jquery as > features detection are already managed. > > Regards, > Ludovic > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---