Skip to content

Commit ebca339

Browse files
committed
fix, minor cleanup
1 parent 4d67715 commit ebca339

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

packages/svelte/src/compiler/phases/2-analyze/visitors/Fragment.js

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,10 @@
66
* @param {Context} context
77
*/
88
export function Fragment(node, context) {
9-
const parent = /** @type {AST.TemplateNode} */ (context.path.at(-1));
10-
// if (
11-
// !parent ||
12-
// parent.type === 'Component' ||
13-
// parent.type === 'Root' ||
14-
// parent.type === 'IfBlock' ||
15-
// parent.type === 'KeyBlock' ||
16-
// parent.type === 'EachBlock' ||
17-
// parent.type === 'SnippetBlock' ||
18-
// parent.type === 'AwaitBlock'
19-
// ) {
20-
const fragment_metadata = {
21-
has_await: false,
22-
node
23-
};
24-
context.next({ ...context.state, fragment: fragment_metadata });
25-
node.metadata.has_await = fragment_metadata.has_await;
26-
// } else {
27-
// context.next();
28-
// }
9+
const fragment_metadata = {
10+
has_await: false,
11+
node
12+
};
13+
context.next({ ...context.state, fragment: fragment_metadata });
14+
node.metadata.has_await = fragment_metadata.has_await;
2915
}

packages/svelte/src/compiler/phases/3-transform/client/visitors/SvelteBoundary.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function SvelteBoundary(node, context) {
4343
// to resolve this we cheat: we duplicate const tags inside snippets
4444
for (const child of node.fragment.nodes) {
4545
if (child.type === 'ConstTag') {
46-
context.visit(child, { ...context.state, init: const_tags });
46+
context.visit(child, { ...context.state, consts: const_tags });
4747
}
4848
}
4949

0 commit comments

Comments
 (0)