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

Method func

tools/common/_hyperscript.iife.js:9069–9098  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9067 const funcName = this.name;
9068 const functionFeature = this;
9069 var func = function() {
9070 var ctx = runtime2.makeContext(source, functionFeature, target, null);
9071 ctx.meta.errorHandler = errorHandler;
9072 ctx.meta.errorSymbol = errorSymbol;
9073 ctx.meta.finallyHandler = finallyHandler;
9074 for (var i = 0; i < args.length; i++) {
9075 var name = args[i];
9076 var argumentVal = arguments[i];
9077 if (name) {
9078 ctx.locals[name.value] = argumentVal;
9079 }
9080 }
9081 ctx.meta.caller = arguments[args.length];
9082 if (ctx.meta.caller) {
9083 ctx.meta.callingCommand = ctx.meta.caller.meta.command;
9084 }
9085 var resolve, reject;
9086 var promise = new Promise(function(theResolve, theReject) {
9087 resolve = theResolve;
9088 reject = theReject;
9089 });
9090 start.execute(ctx);
9091 if (ctx.meta.returned) {
9092 return ctx.meta.returnValue;
9093 } else {
9094 ctx.meta.resolve = resolve;
9095 ctx.meta.reject = reject;
9096 return promise;
9097 }
9098 };
9099 func.hyperfunc = true;
9100 func.hypername = nameVal;
9101 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