MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / baseCreateWrapper

Function baseCreateWrapper

MathBox/mathbox-bundle.js:36052–36095  ·  view source on GitHub ↗

* The base implementation of `createWrapper` that creates the wrapper and * sets its meta data. * * @private * @param {Array} bindData The bind data array. * @returns {Function} Returns the new function.

(bindData)

Source from the content-addressed store, hash-verified

36050 * @returns {Function} Returns the new function.
36051 */
36052 function baseCreateWrapper(bindData) {
36053 var func = bindData[0],
36054 bitmask = bindData[1],
36055 partialArgs = bindData[2],
36056 partialRightArgs = bindData[3],
36057 thisArg = bindData[4],
36058 arity = bindData[5];
36059
36060 var isBind = bitmask & 1,
36061 isBindKey = bitmask & 2,
36062 isCurry = bitmask & 4,
36063 isCurryBound = bitmask & 8,
36064 key = func;
36065
36066 function bound() {
36067 var thisBinding = isBind ? thisArg : this;
36068 if (partialArgs) {
36069 var args = slice(partialArgs);
36070 push.apply(args, arguments);
36071 }
36072 if (partialRightArgs || isCurry) {
36073 args || (args = slice(arguments));
36074 if (partialRightArgs) {
36075 push.apply(args, partialRightArgs);
36076 }
36077 if (isCurry && args.length < arity) {
36078 bitmask |= 16 & ~32;
36079 return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity]);
36080 }
36081 }
36082 args || (args = arguments);
36083 if (isBindKey) {
36084 func = thisBinding[key];
36085 }
36086 if (this instanceof bound) {
36087 thisBinding = baseCreate(func.prototype);
36088 var result = func.apply(thisBinding, args);
36089 return isObject(result) ? result : thisBinding;
36090 }
36091 return func.apply(thisBinding, args);
36092 }
36093 setBindData(bound, bindData);
36094 return bound;
36095 }
36096
36097 /**
36098 * The base implementation of `_.difference` that accepts a single array

Callers 1

boundFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected