aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/deferred.js
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2012-12-07 15:14:12 +0100
committerjaubourg <j@ubourg.net>2012-12-07 15:14:12 +0100
commit23d7cf0488bfeaab51d8f55435cab01f5cf990ca (patch)
treee05a56e92c282eb0b993f46202ab02bc609456fd /test/unit/deferred.js
parent282c044d64e366d1bcb76d7d4f49c54098c6547f (diff)
downloadjquery-23d7cf0488bfeaab51d8f55435cab01f5cf990ca.tar.gz
jquery-23d7cf0488bfeaab51d8f55435cab01f5cf990ca.zip
Deferred: .resolve(), .reject() and .notify() now set the callback context to the promise instance rather than the deferred instance ; .then() has also been amended. Fixes #11405.
Diffstat (limited to 'test/unit/deferred.js')
-rw-r--r--test/unit/deferred.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/unit/deferred.js b/test/unit/deferred.js
index 80827c641..86b0b3411 100644
--- a/test/unit/deferred.js
+++ b/test/unit/deferred.js
@@ -292,7 +292,7 @@ test( "jQuery.Deferred.then - context", function() {
defer.resolve( 2 );
piped.done(function( value ) {
- strictEqual( this.promise(), piped, "default context gets updated to latest defer in the chain" );
+ strictEqual( this, piped, "default context gets updated to latest promise in the chain" );
strictEqual( value, 6, "proper value received" );
});
});
@@ -395,8 +395,8 @@ test( "jQuery.when - joined", function() {
expected = shouldResolve ? [ 1, 1 ] : [ 0, undefined ],
expectedNotify = shouldNotify && [ willNotify[ id1 ], willNotify[ id2 ] ],
code = id1 + "/" + id2,
- context1 = defer1 && jQuery.isFunction( defer1.promise ) ? defer1 : undefined,
- context2 = defer2 && jQuery.isFunction( defer2.promise ) ? defer2 : undefined;
+ context1 = defer1 && jQuery.isFunction( defer1.promise ) ? defer1.promise() : undefined,
+ context2 = defer2 && jQuery.isFunction( defer2.promise ) ? defer2.promise() : undefined;
jQuery.when( defer1, defer2 ).done(function( a, b ) {
if ( shouldResolve ) {