File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -255,7 +255,12 @@ function qFactory(nextTick, exceptionHandler) {
255
255
* @returns {Deferred } Returns a new instance of deferred.
256
256
*/
257
257
var defer = function ( ) {
258
- return new Deferred ( ) ;
258
+ var d = new Deferred ( ) ;
259
+ //Necessary to support unbound execution :/
260
+ d . resolve = simpleBind ( d , d . resolve ) ;
261
+ d . reject = simpleBind ( d , d . reject ) ;
262
+ d . notify = simpleBind ( d , d . notify ) ;
263
+ return d ;
259
264
} ;
260
265
261
266
function Promise ( ) {
@@ -328,10 +333,6 @@ function qFactory(nextTick, exceptionHandler) {
328
333
329
334
function Deferred ( ) {
330
335
this . promise = new Promise ( ) ;
331
- //Necessary to support unbound execution :/
332
- this . resolve = simpleBind ( this , this . resolve ) ;
333
- this . reject = simpleBind ( this , this . reject ) ;
334
- this . notify = simpleBind ( this , this . notify ) ;
335
336
}
336
337
337
338
extend ( Deferred . prototype , {
You can’t perform that action at this time.
0 commit comments