Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
var oldAjax = jQuery.ajax; | ||
|
||
jQuery.ajax = function( ) { | ||
var jQXHR = oldAjax.apply( this, arguments ); | ||
|
||
// Be sure we got a jQXHR (e.g., not sync) | ||
if ( jQXHR.promise ) { | ||
migrateWarnProp( jQXHR, "success", jQXHR.done, | ||
"jQXHR.success is deprecated and removed" ); | ||
migrateWarnProp( jQXHR, "error", jQXHR.fail, | ||
"jQXHR.error is deprecated and removed" ); | ||
migrateWarnProp( jQXHR, "complete", jQXHR.always, | ||
"jQXHR.complete is deprecated and removed" ); | ||
} | ||
|
||
return jQXHR; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module( "ajax" ); | ||
|
||
test( "jQuery.ajax() deprecations on jqXHR", function( assert ) { | ||
assert.expect( 3 ); | ||
|
||
var done = assert.async(); | ||
|
||
expectWarning( ".success(), .error(), .compete() calls", 3, function() { | ||
|
||
jQuery.ajax( "/not-found.404" ) | ||
.success( jQuery.noop ) | ||
.error( function( jQXHR ) { | ||
|
||
// Local file errors returns 0, pretend it's a 404 | ||
assert.equal( jQXHR.status || 404, 404, "ajax error" ); | ||
} ) | ||
.complete( function() { | ||
assert.ok( true, "ajax complete" ); | ||
done(); | ||
} ); | ||
} ); | ||
|
||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ TestManager = { | |
"version", | ||
"migrate", | ||
"core", | ||
"ajax", | ||
"css", | ||
"effects", | ||
"event", | ||
|