pull/12335/head
Rich Harris 2 years ago
parent 1de3caae2a
commit 50d9536c5b

@ -1859,7 +1859,6 @@ export const template_visitors = {
);
} else {
context.state.init.push(
b.stmt(b.call('$.next')),
b.stmt(
(node.expression.type === 'CallExpression' ? b.call : b.maybe_call)(
snippet_function,

@ -1202,8 +1202,6 @@ const template_visitors = {
return /** @type {import('estree').Expression} */ (context.visit(arg));
});
context.state.template.push(block_open);
context.state.template.push(
b.stmt(
(node.expression.type === 'CallExpression' ? b.call : b.maybe_call)(

@ -287,7 +287,7 @@ export function clean_nodes(
// if a component or snippet starts with text, we need to add an anchor comment
// so that its text node doesn't get fused with its surroundings
const is_text_first =
parent.type === 'Fragment' &&
(parent.type === 'Fragment' || parent.type === 'SnippetBlock') &&
first &&
(first?.type === 'Text' || first?.type === 'ExpressionTag');

@ -6,7 +6,7 @@ import {
dev_current_component_function,
set_dev_current_component_function
} from '../../runtime.js';
import { hydrate_next, hydrate_node, hydrating } from '../hydration.js';
import { hydrate_node, hydrating } from '../hydration.js';
/**
* @template {(node: TemplateNode, ...args: any[]) => void} SnippetFn
@ -16,10 +16,6 @@ import { hydrate_next, hydrate_node, hydrating } from '../hydration.js';
* @returns {void}
*/
export function snippet(anchor, get_snippet, ...args) {
if (hydrating) {
hydrate_next();
}
/** @type {SnippetFn | null | undefined} */
var snippet;

@ -7,6 +7,8 @@ var root = $.template(`<!> `, 1);
export default function Bind_component_snippet($$anchor) {
const snippet = ($$anchor) => {
$.next();
var fragment = root_1();
$.append($$anchor, fragment);

@ -6,7 +6,7 @@ export default function Bind_component_snippet($$payload) {
const _snippet = snippet;
function snippet($$payload) {
$$payload.out += `Something`;
$$payload.out += `<!---->Something`;
}
let $$settled = true;

Loading…
Cancel
Save