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

Method execute

www/js/_hyperscript.js:9107–9147  ·  view source on GitHub ↗
(ctx)

Source from the content-addressed store, hash-verified

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