Deferred: Provide explicit undefined context for jQuery.when raw casts

Fixes gh-3082
Closes gh-3084
This commit is contained in:
Richard Gibson 2016-04-27 12:46:14 -04:00
parent 9f268caaf4
commit 7f1e59343b
2 changed files with 8 additions and 2 deletions

View File

@ -354,7 +354,10 @@ jQuery.extend( {
master.reject
);
} else {
updateFunc( i )( resolveValues[ i ] );
// Support: Android 4.0 only
// Strict mode functions invoked without .call/.apply get global-object context
updateFunc( i ).call( undefined, resolveValues[ i ] );
}
}

View File

@ -843,7 +843,10 @@ QUnit.test( "jQuery.when - joined", function( assert ) {
rejectedStandardPromise: true
},
counter = 49,
expectedContext = (function() { "use strict"; return this; })();
// Support: Android 4.0 only
// Strict mode functions invoked without .call/.apply get global-object context
expectedContext = (function() { "use strict"; return this; }).call();
QUnit.stop();