MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / func

Method func

www/js/_hyperscript.esm.js:9517–9546  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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