MCPcopy Create free account
hub / github.com/TruthHun/BookStack / executeBound

Function executeBound

static/word2md/mammoth.browser.js:28556–28562  ·  view source on GitHub ↗
(sourceFunc, boundFunc, context, callingContext, args)

Source from the content-addressed store, hash-verified

28554 // Determines whether to execute a function as a constructor
28555 // or a normal function with the provided arguments
28556 var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {
28557 if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
28558 var self = baseCreate(sourceFunc.prototype);
28559 var result = sourceFunc.apply(self, args);
28560 if (_.isObject(result)) return result;
28561 return self;
28562 };
28563
28564 // Create a function bound to a given object (assigning `this`, and arguments,
28565 // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if

Callers 1

boundFunction · 0.70

Calls 1

baseCreateFunction · 0.70

Tested by

no test coverage detected