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

Method evaluate

www/js/_hyperscript.js:4842–4860  ·  view source on GitHub ↗
(context)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

evaluateMethod · 0.45

Tested by

no test coverage detected