* Creates a function that wraps `func` and invokes it with the `this` * binding of `thisArg`. * * @private * @param {Function} func The function to bind. * @param {*} [thisArg] The `this` binding of `func`. * @returns {Function} Returns the new bound function.
(func, thisArg)
| 15857 | * @returns {Function} Returns the new bound function. |
| 15858 | */ |
| 15859 | function createBindWrapper(func, thisArg) { |
| 15860 | var Ctor = createCtorWrapper(func); |
| 15861 | |
| 15862 | function wrapper() { |
| 15863 | var fn = (this && this !== global && this instanceof wrapper) ? Ctor : func; |
| 15864 | return fn.apply(thisArg, arguments); |
| 15865 | } |
| 15866 | return wrapper; |
| 15867 | } |
| 15868 | |
| 15869 | module.exports = createBindWrapper; |
| 15870 |
no test coverage detected