I think returning undefined is the intention here, same when you do a lookup for a property that doesn't exist, returning null is not equivalent. Referencing undefined properties is not a problem in JS, this "error" is silly not taking the context in consideration.
- ricardo On Feb 26, 2:30 pm, James Ballon <z0036...@gmail.com> wrote: > This was mentioned in part in the previous post, and this is not about > warnings - I can disregard warnings as they do not cause Firebug to > stop processing the > script.http://groups.google.com/group/jquery-dev/browse_thread/thread/ce38e4... > > When "Break on All Errors" is enabled on Firebug - Firebug breaks on > all undefined variables and other errors, it does not break on > warnings. The problem is the following code (Line 1295) has a good > chance of returning a undefined variable causing Firebug to break, > which can be disruptive when diagnosing a real problem. > > // Return the named cache data, or the ID for the element > return name ? > jQuery.cache[ id ][ name ] : > id; > > Rewriting the code in the following way is longer, but does not return > undefined. > > // Return the named cache data, or the ID for the element > if ( name ) { > // Prevent overriding the named cache with undefined > values > if ( data !== undefined ) > jQuery.cache[ id ][ name ] = data; > if ( jQuery.cache[ id ][ name ] !== undefined ) > return jQuery.cache[ id ][ name ]; > return null; > } > return id; > > James --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---