MCPcopy Index your code
hub / github.com/bigskysoftware/_hyperscript / func

Method func

www/js/_hyperscript.js:9519–9548  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9517 const funcName = this.name;
9518 const functionFeature = this;
9519 var func = function() {
9520 var ctx = runtime2.makeContext(source, functionFeature, target, null);
9521 ctx.meta.errorHandler = errorHandler;
9522 ctx.meta.errorSymbol = errorSymbol;
9523 ctx.meta.finallyHandler = finallyHandler;
9524 for (var i = 0; i < args.length; i++) {
9525 var name = args[i];
9526 var argumentVal = arguments[i];
9527 if (name) {
9528 ctx.locals[name.value] = argumentVal;
9529 }
9530 }
9531 ctx.meta.caller = arguments[args.length];
9532 if (ctx.meta.caller) {
9533 ctx.meta.callingCommand = ctx.meta.caller.meta.command;
9534 }
9535 var resolve, reject;
9536 var promise = new Promise(function(theResolve, theReject) {
9537 resolve = theResolve;
9538 reject = theReject;
9539 });
9540 start.execute(ctx);
9541 if (ctx.meta.returned) {
9542 return ctx.meta.returnValue;
9543 } else {
9544 ctx.meta.resolve = resolve;
9545 ctx.meta.reject = reject;
9546 return promise;
9547 }
9548 };
9549 func.hyperfunc = true;
9550 func.hypername = nameVal;
9551 runtime2.assignToNamespace(target, nameSpace, funcName, func);

Callers

nothing calls this directly

Calls 2

makeContextMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected