@@ -13,7 +13,7 @@ function Thrower( ex ) {
1313 throw ex ;
1414}
1515
16- function adoptValue ( value , resolve , reject ) {
16+ function adoptValue ( value , resolve , reject , noValue ) {
1717 var method ;
1818
1919 try {
@@ -29,9 +29,10 @@ function adoptValue( value, resolve, reject ) {
2929 // Other non-thenables
3030 } else {
3131
32- // Support: Android 4.0 only
33- // Strict mode functions invoked without .call/.apply get global-object context
34- resolve . call ( undefined , value ) ;
32+ // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
33+ // * false: [ value ].slice( 0 ) => resolve( value )
34+ // * true: [ value ].slice( 1 ) => resolve()
35+ resolve . apply ( undefined , [ value ] . slice ( noValue ) ) ;
3536 }
3637
3738 // For Promises/A+, convert exceptions into rejections
@@ -41,7 +42,7 @@ function adoptValue( value, resolve, reject ) {
4142
4243 // Support: Android 4.0 only
4344 // Strict mode functions invoked without .call/.apply get global-object context
44- reject . call ( undefined , value ) ;
45+ reject . apply ( undefined , [ value ] ) ;
4546 }
4647}
4748
@@ -366,7 +367,8 @@ jQuery.extend( {
366367
367368 // Single- and empty arguments are adopted like Promise.resolve
368369 if ( remaining <= 1 ) {
369- adoptValue ( singleValue , master . done ( updateFunc ( i ) ) . resolve , master . reject ) ;
370+ adoptValue ( singleValue , master . done ( updateFunc ( i ) ) . resolve , master . reject ,
371+ ! remaining ) ;
370372
371373 // Use .then() to unwrap secondary thenables (cf. gh-3000)
372374 if ( master . state ( ) === "pending" ||
0 commit comments