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

Function executeBound

underscore.js:1015–1021  ·  view source on GitHub ↗
(sourceFunc, boundFunc, context, callingContext, args)

Source from the content-addressed store, hash-verified

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

Callers 2

boundFunction · 0.70
underscore.jsFile · 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…