| 28554 | // Determines whether to execute a function as a constructor |
| 28555 | // or a normal function with the provided arguments |
| 28556 | var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) { |
| 28557 | if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); |
| 28558 | var self = baseCreate(sourceFunc.prototype); |
| 28559 | var result = sourceFunc.apply(self, args); |
| 28560 | if (_.isObject(result)) return result; |
| 28561 | return self; |
| 28562 | }; |
| 28563 | |
| 28564 | // Create a function bound to a given object (assigning `this`, and arguments, |
| 28565 | // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if |