MCPcopy
hub / github.com/jashkenas/underscore / executeBound

Function executeBound

underscore-node-f.cjs:1008–1014  ·  view source on GitHub ↗
(sourceFunc, boundFunc, context, callingContext, args)

Source from the content-addressed store, hash-verified

1006// `args`. Determines whether to execute a function as a constructor or as a
1007// normal function.
1008function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
1009 if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
1010 var self = baseCreate(sourceFunc.prototype);
1011 var result = sourceFunc.apply(self, args);
1012 if (isObject(result)) return result;
1013 return self;
1014}
1015
1016// Partially apply a function by creating a version that has had some of its
1017// arguments pre-filled, without changing its dynamic `this` context. `_` acts

Callers 2

boundFunction · 0.70

Calls 2

baseCreateFunction · 0.70
isObjectFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…