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

Method execute

www/js/_hyperscript.esm.js:9105–9145  ·  view source on GitHub ↗
(ctx)

Source from the content-addressed store, hash-verified

9103 this.queueLast = queueLast;
9104 }
9105 execute(ctx) {
9106 const onFeature = this;
9107 const every = this.every;
9108 const queueNone = this.queueNone;
9109 const queueFirst = this.queueFirst;
9110 const queueLast = this.queueLast;
9111 const start = this.start;
9112 let eventQueueInfo = ctx.meta.runtime.getEventQueueFor(ctx.me, onFeature);
9113 if (eventQueueInfo.executing && every === false) {
9114 if (queueNone || queueFirst && eventQueueInfo.queue.length > 0) {
9115 return;
9116 }
9117 if (queueLast) {
9118 eventQueueInfo.queue.length = 0;
9119 }
9120 eventQueueInfo.queue.push(ctx);
9121 return;
9122 }
9123 eventQueueInfo.executing = true;
9124 ctx.meta.onHalt = function() {
9125 eventQueueInfo.executing = false;
9126 var queued = eventQueueInfo.queue.shift();
9127 if (queued) {
9128 setTimeout(function() {
9129 onFeature.execute(queued);
9130 }, 1);
9131 }
9132 };
9133 ctx.meta.reject = function(err) {
9134 console.error(err.message ? err.message : err);
9135 console.error(err.stack);
9136 var hypertrace = ctx.meta.runtime.getHyperTrace(ctx, err);
9137 if (hypertrace) {
9138 hypertrace.print();
9139 }
9140 ctx.meta.runtime.triggerEvent(ctx.me, "exception", {
9141 error: err
9142 });
9143 };
9144 start.execute(ctx);
9145 }
9146 install(elt, source, args, runtime2) {
9147 const onFeature = this;
9148 const displayName = this.displayName;

Callers

nothing calls this directly

Calls 5

setTimeoutFunction · 0.50
getEventQueueForMethod · 0.45
executeMethod · 0.45
getHyperTraceMethod · 0.45
triggerEventMethod · 0.45

Tested by

no test coverage detected