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

Function render

tools/common/_hyperscript.iife.js:9918–9942  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9916 }
9917 }
9918 function render() {
9919 var ctx = runtime.makeContext(wrapper, null, wrapper, null);
9920 var buf = [];
9921 ctx.meta.__ht_template_result = buf;
9922 var tokens = tokenizer.tokenize(source, "lines");
9923 var parser = new Parser(kernel, tokens);
9924 var cmds;
9925 try {
9926 cmds = parser.parseElement("commandList");
9927 parser.ensureTerminated(cmds);
9928 } catch (e) {
9929 console.error("live-template parse error:", e.message || e);
9930 return "";
9931 }
9932 cmds.execute(ctx);
9933 if (ctx.meta.returned || !ctx.meta.resolve) return buf.join("");
9934 var resolve;
9935 var promise = new Promise(function(r) {
9936 resolve = r;
9937 });
9938 ctx.meta.resolve = resolve;
9939 return promise.then(function() {
9940 return buf.join("");
9941 });
9942 }
9943 queueMicrotask(function() {
9944 var result = render();
9945 if (result && result.then) {

Callers 1

Calls 5

parseElementMethod · 0.95
ensureTerminatedMethod · 0.95
makeContextMethod · 0.45
tokenizeMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected