aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2012-09-13 15:44:12 +0200
committerjaubourg <j@ubourg.net>2012-09-13 15:44:12 +0200
commit74cdd784975ba6e628d1934a859faeb017824a5f (patch)
tree8ff8503473fbafff2b4d2e563b936e2d9271b570 /src
parent9c5089a60d479a959b290a5b4ab8ef38c985e963 (diff)
downloadjquery-74cdd784975ba6e628d1934a859faeb017824a5f.tar.gz
jquery-74cdd784975ba6e628d1934a859faeb017824a5f.zip
deferred.promise(obj) should work with non-objects. Fixes #12521. Much needed unit tests added!
Diffstat (limited to 'src')
-rw-r--r--src/deferred.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/deferred.js b/src/deferred.js
index f0b1f96e6..e525fc068 100644
--- a/src/deferred.js
+++ b/src/deferred.js
@@ -44,7 +44,7 @@ jQuery.extend({
// Get a promise for this deferred
// If obj is provided, the promise aspect is added to the object
promise: function( obj ) {
- return typeof obj === "object" ? jQuery.extend( obj, promise ) : promise;
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
}
},
deferred = {};