aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Snover <github.com@zetafleet.com>2010-12-22 18:54:22 -0600
committerColin Snover <github.com@zetafleet.com>2010-12-22 18:54:22 -0600
commit1f92edee207829a28de80ee72548cdbd599bcc79 (patch)
tree59b2072f09221e4ed97f498370d17adb9e2112d3
parent82ac384b494258e17e2856ee2259475ecb0174ca (diff)
downloadjquery-1f92edee207829a28de80ee72548cdbd599bcc79.tar.gz
jquery-1f92edee207829a28de80ee72548cdbd599bcc79.zip
Fix fix for #6481 introduced at 7862c45ad2f32096383a21b8b301155787724476 which did not like it when Array.prototype was modified on empty arrays.
-rw-r--r--src/ajax.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ajax.js b/src/ajax.js
index da130faed..3f4f732bd 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -343,7 +343,9 @@ function buildParams( prefix, obj, traditional, add ) {
});
} else if ( !traditional && obj != null && typeof obj === "object" ) {
- if ( jQuery.isEmptyObject( obj ) ) {
+ // If we see an array here, it is empty and should be treated as an empty
+ // object
+ if ( jQuery.isArray( obj ) || jQuery.isEmptyObject( obj ) ) {
add( prefix, "" );
// Serialize object item.