Skip to content

Commit

Permalink
Deferred: Provide explicit undefined context for jQuery.when raw casts
Browse files Browse the repository at this point in the history
  • Loading branch information
gibson042 committed Apr 27, 2016
1 parent 9f268ca commit 7f1e593
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/deferred.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ] );
}
}

Expand Down
5 changes: 4 additions & 1 deletion test/unit/deferred.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 7f1e593

Please sign in to comment.