MCPcopy
hub / github.com/livebud/bud / EachBlock$1

Function EachBlock$1

package/svelte/compiler.js:22694–22710  ·  view source on GitHub ↗
(node2, renderer, options)

Source from the content-addressed store, hash-verified

22692 renderer.add_expression(x`@debug(${filename ? x`"${filename}"` : x`null`}, ${line - 1}, ${column}, ${obj})`);
22693 }
22694 function EachBlock$1(node2, renderer, options) {
22695 const args = [node2.context_node];
22696 if (node2.index)
22697 args.push({ type: "Identifier", name: node2.index });
22698 renderer.push();
22699 renderer.render(node2.children, options);
22700 const result = renderer.pop();
22701 const consequent = x`@each(${node2.expression.node}, (${args}) => { ${get_const_tags$1(node2.const_tags)}; return ${result} })`;
22702 if (node2.else) {
22703 renderer.push();
22704 renderer.render(node2.else.children, options);
22705 const alternate = renderer.pop();
22706 renderer.add_expression(x`${node2.expression.node}.length ? ${consequent} : ${alternate}`);
22707 } else {
22708 renderer.add_expression(consequent);
22709 }
22710 }
22711 function get_class_attribute_value(attribute) {
22712 if (attribute.chunks.length === 2 && attribute.chunks[1].synthetic) {
22713 const value2 = attribute.chunks[0].node;

Callers

nothing calls this directly

Calls 6

xFunction · 0.85
get_const_tags$1Function · 0.85
pushMethod · 0.80
popMethod · 0.80
add_expressionMethod · 0.80
renderMethod · 0.45

Tested by

no test coverage detected