MCPcopy
hub / github.com/sveltejs/svelte / comment

Function comment

packages/svelte/src/internal/client/dom/template.js:335–350  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

333 * @returns {TemplateNode | DocumentFragment}
334 */
335export function comment() {
336 // we're not delegating to `template` here for performance reasons
337 if (hydrating) {
338 assign_nodes(hydrate_node, null);
339 return hydrate_node;
340 }
341
342 var frag = document.createDocumentFragment();
343 var start = document.createComment('');
344 var anchor = create_text();
345 frag.append(start, anchor);
346
347 assign_nodes(start, anchor);
348
349 return frag;
350}
351
352/**
353 * Assign the created (or in hydration mode, traversed) dom elements to the current block

Callers

nothing calls this directly

Calls 3

create_textFunction · 0.90
assign_nodesFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected