mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
356a3bccb0
Single- and no-argument calls act like Promise.resolve. Multi-argument calls act like Promise.all. Fixes gh-3029 Closes gh-3059
23 lines
415 B
JavaScript
23 lines
415 B
JavaScript
/* jshint node: true */
|
|
|
|
"use strict";
|
|
|
|
require( "jsdom" ).env( "", function( errors, window ) {
|
|
if ( errors ) {
|
|
console.error( errors );
|
|
return;
|
|
}
|
|
|
|
var jQuery = require( ".." )( window );
|
|
|
|
exports.deferred = function() {
|
|
var deferred = jQuery.Deferred();
|
|
|
|
return {
|
|
promise: deferred.promise(),
|
|
resolve: deferred.resolve.bind( deferred ),
|
|
reject: deferred.reject.bind( deferred )
|
|
};
|
|
};
|
|
} );
|