encodeURIComponent( value == null ? "" : value );
};
+ if ( a == null ) {
+ return "";
+ }
+
// If an array was passed in, assume that it is an array of form elements.
if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
QUnit.module( "serialize", { teardown: moduleTeardown } );
QUnit.test( "jQuery.param()", function( assert ) {
- assert.expect( 23 );
+ assert.expect( 24 );
var params;
params = { "test": [ 1, 2, null ] };
assert.equal( jQuery.param( params ), "test%5B%5D=1&test%5B%5D=2&test%5B%5D=", "object with array property with null value" );
+
+ params = undefined;
+ assert.equal( jQuery.param( params ), "", "jQuery.param( undefined ) === empty string" );
} );
QUnit.test( "jQuery.param() not affected by ajaxSettings", function( assert ) {