aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2016-04-27 12:46:14 -0400
committerRichard Gibson <richard.gibson@gmail.com>2016-04-27 15:33:12 -0400
commit7f1e59343b1600e530472a90aa27a2bcc7b72c96 (patch)
tree7cbce73bd61d008d36931b6f7106ba0a4b9bd950
parent9f268caaf43629addb9a1a2001ab341839300b14 (diff)
downloadjquery-7f1e59343b1600e530472a90aa27a2bcc7b72c96.tar.gz
jquery-7f1e59343b1600e530472a90aa27a2bcc7b72c96.zip
Deferred: Provide explicit undefined context for jQuery.when raw casts
Fixes gh-3082 Closes gh-3084
-rw-r--r--src/deferred.js5
-rw-r--r--test/unit/deferred.js5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/deferred.js b/src/deferred.js
index 91c55a64e..0ea1e7f1f 100644
--- a/src/deferred.js
+++ b/src/deferred.js
@@ -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 ] );
}
}
diff --git a/test/unit/deferred.js b/test/unit/deferred.js
index af237acf4..305740fa4 100644
--- a/test/unit/deferred.js
+++ b/test/unit/deferred.js
@@ -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();