Permalink
Browse files

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

Fixes gh-3082
Closes gh-3084
  • Loading branch information...
1 parent 9f268ca commit 7f1e59343b1600e530472a90aa27a2bcc7b72c96 @gibson042 gibson042 committed Apr 27, 2016
Showing with 8 additions and 2 deletions.
  1. +4 −1 src/deferred.js
  2. +4 −1 test/unit/deferred.js
View
@@ -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 ] );
}
}
@@ -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();

0 comments on commit 7f1e593

Please sign in to comment.