aboutsummaryrefslogtreecommitdiffstats
path: root/src/deferred.js
diff options
context:
space:
mode:
authornanto_vi <nanto@moon.email.ne.jp>2013-01-06 17:09:28 +0900
committernanto_vi <nanto@moon.email.ne.jp>2013-01-07 02:49:15 +0900
commite7fdda981928befda72b78e9e2b17e33e232a603 (patch)
tree89a4eb15a5e89c507866b8deccb4afd6ef248f5a /src/deferred.js
parentc61150427fc8ccc8e884df8f221a6c9bb5477929 (diff)
downloadjquery-e7fdda981928befda72b78e9e2b17e33e232a603.tar.gz
jquery-e7fdda981928befda72b78e9e2b17e33e232a603.zip
Propagete context of returned deferred object in Deferred.then(). Fixes #13160
Diffstat (limited to 'src/deferred.js')
-rw-r--r--src/deferred.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/deferred.js b/src/deferred.js
index d84206570..4001c2384 100644
--- a/src/deferred.js
+++ b/src/deferred.js
@@ -35,7 +35,9 @@ jQuery.extend({
newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, [ returned ] );
}
} :
- newDefer[ action ]
+ function() {
+ newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, arguments );
+ }
);
});
fns = null;
@@ -72,7 +74,7 @@ jQuery.extend({
// deferred[ resolve | reject | notify ]
deferred[ tuple[0] ] = function() {
- deferred[ tuple[0] + "With" ]( promise, arguments );
+ deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
return this;
};
deferred[ tuple[0] + "With" ] = list.fireWith;