fix, minor cleanup

pull/16542/head
ComputerGuy 1 month ago
parent 4d677151ab
commit ebca33930c

@ -6,24 +6,10 @@
* @param {Context} context
*/
export function Fragment(node, context) {
const parent = /** @type {AST.TemplateNode} */ (context.path.at(-1));
// if (
// !parent ||
// parent.type === 'Component' ||
// parent.type === 'Root' ||
// parent.type === 'IfBlock' ||
// parent.type === 'KeyBlock' ||
// parent.type === 'EachBlock' ||
// parent.type === 'SnippetBlock' ||
// parent.type === 'AwaitBlock'
// ) {
const fragment_metadata = {
has_await: false,
node
};
context.next({ ...context.state, fragment: fragment_metadata });
node.metadata.has_await = fragment_metadata.has_await;
// } else {
// context.next();
// }
const fragment_metadata = {
has_await: false,
node
};
context.next({ ...context.state, fragment: fragment_metadata });
node.metadata.has_await = fragment_metadata.has_await;
}

@ -43,7 +43,7 @@ export function SvelteBoundary(node, context) {
// to resolve this we cheat: we duplicate const tags inside snippets
for (const child of node.fragment.nodes) {
if (child.type === 'ConstTag') {
context.visit(child, { ...context.state, init: const_tags });
context.visit(child, { ...context.state, consts: const_tags });
}
}

Loading…
Cancel
Save