Skip to content

Commit a32cf63

Browse files
authored
Deferred: Rename master to primary
Closes gh-4828
1 parent d38528b commit a32cf63

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/deferred.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -353,39 +353,39 @@ jQuery.extend( {
353353
resolveContexts = Array( i ),
354354
resolveValues = slice.call( arguments ),
355355

356-
// the master Deferred
357-
master = jQuery.Deferred(),
356+
// the primary Deferred
357+
primary = jQuery.Deferred(),
358358

359359
// subordinate callback factory
360360
updateFunc = function( i ) {
361361
return function( value ) {
362362
resolveContexts[ i ] = this;
363363
resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
364364
if ( !( --remaining ) ) {
365-
master.resolveWith( resolveContexts, resolveValues );
365+
primary.resolveWith( resolveContexts, resolveValues );
366366
}
367367
};
368368
};
369369

370370
// Single- and empty arguments are adopted like Promise.resolve
371371
if ( remaining <= 1 ) {
372-
adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
372+
adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,
373373
!remaining );
374374

375375
// Use .then() to unwrap secondary thenables (cf. gh-3000)
376-
if ( master.state() === "pending" ||
376+
if ( primary.state() === "pending" ||
377377
typeof( resolveValues[ i ] && resolveValues[ i ].then ) === "function" ) {
378378

379-
return master.then();
379+
return primary.then();
380380
}
381381
}
382382

383383
// Multiple arguments are aggregated like Promise.all array elements
384384
while ( i-- ) {
385-
adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
385+
adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );
386386
}
387387

388-
return master.promise();
388+
return primary.promise();
389389
}
390390
} );
391391

0 commit comments

Comments
 (0)