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

Function evaluate

tools/common/_hyperscript.iife.js:9960–9981  ·  view source on GitHub ↗
(src, ctx, args)

Source from the content-addressed store, hash-verified

9958 });
9959 });
9960 function evaluate(src, ctx, args) {
9961 let body;
9962 if ("document" in globalScope) {
9963 body = globalScope.document.body;
9964 } else {
9965 body = new HyperscriptModule(args && args.module);
9966 }
9967 ctx = Object.assign(runtime.makeContext(body, null, body, null), ctx || {});
9968 let element = kernel.parse(tokenizer, src);
9969 if (element && element.errors && element.errors.length > 0) {
9970 throw new Error(element.errors[0].message + "\n\n" + Parser.formatErrors(element.errors));
9971 }
9972 if (element.execute) {
9973 element.execute(ctx);
9974 return ctx.meta.returnValue !== void 0 ? ctx.meta.returnValue : ctx.result;
9975 } else if (element.apply) {
9976 element.apply(body, body, args, runtime);
9977 return runtime.getHyperscriptFeatures(body);
9978 } else {
9979 return element.evaluate(ctx);
9980 }
9981 }
9982 var _hyperscript = Object.assign(
9983 evaluate,
9984 {

Callers 15

htmx.jsFile · 0.50
pick.jsFile · 0.50
select.jsFile · 0.50
fetch.jsFile · 0.50
toggle.jsFile · 0.50
throw.jsFile · 0.50
remove.jsFile · 0.50
morph.jsFile · 0.50
add.jsFile · 0.50
put.jsFile · 0.50
installVTMockFunction · 0.50
viewTransition.jsFile · 0.50

Calls 7

makeContextMethod · 0.45
parseMethod · 0.45
formatErrorsMethod · 0.45
executeMethod · 0.45
applyMethod · 0.45
evaluateMethod · 0.45

Tested by

no test coverage detected