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

Method render_get_context

package/svelte/compiler.js:17647–17661  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17645 }
17646 }
17647 render_get_context() {
17648 const props = this.is_destructured ? this.value_contexts.map((prop) => b`#ctx[${this.block.renderer.context_lookup.get(prop.key.name).index}] = ${prop.default_modifier(prop.modifier(x`#ctx[${this.value_index}]`), (name) => this.renderer.reference(name))};`) : null;
17649 const const_tags_props = this.has_consts(this.node) ? add_const_tags(this.block, this.node.const_tags, "#ctx") : null;
17650 const get_context2 = this.block.renderer.component.get_unique_name(`get_${this.status}_context`);
17651 this.block.renderer.blocks.push(b`
17652 function ${get_context2}(#ctx) {
17653 ${props}
17654 ${const_tags_props}
17655 }
17656 `);
17657 this.block.chunks.declarations.push(b`${get_context2}(#ctx)`);
17658 if (this.block.has_update_method) {
17659 this.block.chunks.update.unshift(b`${get_context2}(#ctx)`);
17660 }
17661 }
17662 };
17663 var AwaitBlockWrapper = class extends Wrapper {
17664 constructor(renderer, block, parent, node2, strip_whitespace, next_sibling) {

Callers 1

renderMethod · 0.80

Calls 8

bFunction · 0.85
xFunction · 0.85
add_const_tagsFunction · 0.85
getMethod · 0.80
referenceMethod · 0.80
has_constsMethod · 0.80
get_unique_nameMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected