var param = $.param({
a: function () {},
b: function () { return null; }
});
Will result in a=undefined&b=null
jsfiddle
The value == null check on Line 61 should happen after the ternary statement, since both value and the result of value() can be null. i.e.
add = function( key, value ) {
// If value is a function, invoke it and return its value
value = jQuery.isFunction( value ) ? value() : value;
value = value == null ? "" : value;
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
};