Skip to content

Commit

Permalink
Ensure apply is not called with undefined.
Browse files Browse the repository at this point in the history
Fixes a bug in IE8
Fixes marionettejs#2225
  • Loading branch information
samccone committed Jan 30, 2015
1 parent 2478c5d commit be6f1b4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Marionette.proxyGetOption = function(optionName) {
// undefined return a default value
Marionette._getValue = function(value, context, params) {
if (_.isFunction(value)) {
// We need to ensure that params is not undefined
// to prevent `apply` from failing in ie8
params = params || [];

value = value.apply(context, params);
}
return value;
Expand Down

0 comments on commit be6f1b4

Please sign in to comment.