MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / createBindWrapper

Function createBindWrapper

lib/web/jshint.js:4670–4678  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

4668 * @returns {Function} Returns the new bound function.
4669 */
4670 function createBindWrapper(func, thisArg) {
4671 var Ctor = createCtorWrapper(func);
4672
4673 function wrapper() {
4674 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
4675 return fn.apply(thisArg, arguments);
4676 }
4677 return wrapper;
4678 }
4679
4680 /**
4681 * Creates a `Set` cache object to optimize linear searches of large arrays.

Callers 1

createWrapperFunction · 0.85

Calls 1

createCtorWrapperFunction · 0.85

Tested by

no test coverage detected