aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2015-09-07 23:22:56 +0200
committerMichał Gołębiowski <m.goleb@gmail.com>2015-09-07 23:22:56 +0200
commit14c0fe44328f22debb5b531d2b671923658542b3 (patch)
treee49a18a76ec5a377990f4da2a7ec2b05919a702c /src
parent3d7ce0a65f0707ff01a851822e57ba80adcff075 (diff)
downloadjquery-14c0fe44328f22debb5b531d2b671923658542b3.tar.gz
jquery-14c0fe44328f22debb5b531d2b671923658542b3.zip
Serialize: Fix object detection
jQuery.type doesn't just return "null" for null but also e.g. "array" for arrays instead of object so it's not really a typeof analogue. My suggestion was stupid. Sorry. Refs 3d7ce0a65f0707ff01a851822e57ba80adcff075
Diffstat (limited to 'src')
-rw-r--r--src/serialize.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/serialize.js b/src/serialize.js
index e0839dc09..94698fc2f 100644
--- a/src/serialize.js
+++ b/src/serialize.js
@@ -28,7 +28,7 @@ function buildParams( prefix, obj, traditional, add ) {
// Item is non-scalar (array or object), encode its numeric index.
buildParams(
- prefix + "[" + ( jQuery.type( v ) === "object" ? i : "" ) + "]",
+ prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
v,
traditional,
add