MCPcopy
hub / github.com/livebud/bud / get_snippet

Method get_snippet

package/svelte/compiler.js:17802–17809  ·  view source on GitHub ↗
(block)

Source from the content-addressed store, hash-verified

17800 }
17801 }
17802 get_snippet(block) {
17803 const snippet = this.node.expression ? this.node.expression.manipulate(block) : block.renderer.reference(this.node.handler_name);
17804 if (this.node.reassigned) {
17805 block.maintain_context = true;
17806 return x`function () { if (@is_function(${snippet})) ${snippet}.apply(this, arguments); }`;
17807 }
17808 return snippet;
17809 }
17810 render(block, target) {
17811 let snippet = this.get_snippet(block);
17812 if (this.node.modifiers.has("preventDefault"))

Callers 1

renderMethod · 0.80

Calls 3

xFunction · 0.85
manipulateMethod · 0.80
referenceMethod · 0.80

Tested by

no test coverage detected