length property value for functions with parameter enhancements

Allen Wirfs-Brock allen at wirfs-brock.com
Mon Aug 29 18:20:37 PDT 2011


It looks like that in a number of these cases, what is being tested is the number of declared arguments  to the jquery Sizzle function which is a module function for its selector engine.  Very early versions of Sizzle seem to have had 3 formals (https://github.com/jquery/sizzle/commit/51ba623126501dd9381040bbdcbabe12cc9056db#diff-0 ) but it fairly soon evolved to take 4 formals (https://github.com/jquery/sizzle/blob/8b061ee512c50910d4e8e0247084446d03e90aa3/sizzle.js ).  I haven't found the code that does the actual test but this seems like the most likely reason to make such a test of that function.

Presumably that sort of version testings is s plausible use case for a function's length although it isn't clear that it is any better than just putting a version tag property on such a function.

Allen




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110829/041999ce/attachment.html>


More information about the es-discuss mailing list