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

Method execute

tools/common/_hyperscript.iife.js:8657–8697  ·  view source on GitHub ↗
(ctx)

Source from the content-addressed store, hash-verified

8655 this.queueLast = queueLast;
8656 }
8657 execute(ctx) {
8658 const onFeature = this;
8659 const every = this.every;
8660 const queueNone = this.queueNone;
8661 const queueFirst = this.queueFirst;
8662 const queueLast = this.queueLast;
8663 const start = this.start;
8664 let eventQueueInfo = ctx.meta.runtime.getEventQueueFor(ctx.me, onFeature);
8665 if (eventQueueInfo.executing && every === false) {
8666 if (queueNone || queueFirst && eventQueueInfo.queue.length > 0) {
8667 return;
8668 }
8669 if (queueLast) {
8670 eventQueueInfo.queue.length = 0;
8671 }
8672 eventQueueInfo.queue.push(ctx);
8673 return;
8674 }
8675 eventQueueInfo.executing = true;
8676 ctx.meta.onHalt = function() {
8677 eventQueueInfo.executing = false;
8678 var queued = eventQueueInfo.queue.shift();
8679 if (queued) {
8680 setTimeout(function() {
8681 onFeature.execute(queued);
8682 }, 1);
8683 }
8684 };
8685 ctx.meta.reject = function(err) {
8686 console.error(err.message ? err.message : err);
8687 console.error(err.stack);
8688 var hypertrace = ctx.meta.runtime.getHyperTrace(ctx, err);
8689 if (hypertrace) {
8690 hypertrace.print();
8691 }
8692 ctx.meta.runtime.triggerEvent(ctx.me, "exception", {
8693 error: err
8694 });
8695 };
8696 start.execute(ctx);
8697 }
8698 install(elt, source, args, runtime2) {
8699 const onFeature = this;
8700 const displayName = this.displayName;

Callers

nothing calls this directly

Calls 5

setTimeoutFunction · 0.70
getEventQueueForMethod · 0.45
executeMethod · 0.45
getHyperTraceMethod · 0.45
triggerEventMethod · 0.45

Tested by

no test coverage detected