Skip to content

Commit 7f1e593

Browse files
committed
Deferred: Provide explicit undefined context for jQuery.when raw casts
Fixes gh-3082 Closes gh-3084
1 parent 9f268ca commit 7f1e593

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/deferred.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,10 @@ jQuery.extend( {
354354
master.reject
355355
);
356356
} else {
357-
updateFunc( i )( resolveValues[ i ] );
357+
358+
// Support: Android 4.0 only
359+
// Strict mode functions invoked without .call/.apply get global-object context
360+
updateFunc( i ).call( undefined, resolveValues[ i ] );
358361
}
359362
}
360363

test/unit/deferred.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,10 @@ QUnit.test( "jQuery.when - joined", function( assert ) {
843843
rejectedStandardPromise: true
844844
},
845845
counter = 49,
846-
expectedContext = (function() { "use strict"; return this; })();
846+
847+
// Support: Android 4.0 only
848+
// Strict mode functions invoked without .call/.apply get global-object context
849+
expectedContext = (function() { "use strict"; return this; }).call();
847850

848851
QUnit.stop();
849852

0 commit comments

Comments
 (0)