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

Method func

www/js/_hyperscript-max.js:9518–9547  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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