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

Method evaluate

www/js/_hyperscript.esm.js:4840–4858  ·  view source on GitHub ↗
(context)

Source from the content-addressed store, hash-verified

4838 }
4839 // override to handle promise-compatible and/or short-circuiting
4840 evaluate(context) {
4841 var self2 = this;
4842 var shortCircuitValue = this.operator === "or";
4843 var lhsVal = this.lhs.evaluate(context);
4844 var continueWith = function(resolvedLhs) {
4845 if (!!resolvedLhs === shortCircuitValue) {
4846 return resolvedLhs;
4847 }
4848 var rhsVal = self2.rhs.evaluate(context);
4849 if (rhsVal && rhsVal.then) {
4850 return rhsVal.then((r) => self2.resolve(context, { lhs: resolvedLhs, rhs: r }));
4851 }
4852 return self2.resolve(context, { lhs: resolvedLhs, rhs: rhsVal });
4853 };
4854 if (lhsVal && lhsVal.then) {
4855 return lhsVal.then(continueWith);
4856 }
4857 return continueWith(lhsVal);
4858 }
4859};
4860var DotOrColonPathNode = class extends Expression {
4861 constructor(path, separator) {

Callers

nothing calls this directly

Calls 1

evaluateMethod · 0.45

Tested by

no test coverage detected