jquery/test/promises_aplus_adapter_deferred.js
Richard Gibson 356a3bccb0 Deferred: Separate the two paths in jQuery.when
Single- and no-argument calls act like Promise.resolve.
Multi-argument calls act like Promise.all.

Fixes gh-3029
Closes gh-3059
2016-05-02 12:30:31 -04:00

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 )
};
};
} );