Skip to content

Commit 3afd814

Browse files
committed
tweak
1 parent 60813bc commit 3afd814

File tree

2 files changed

+8
-12
lines changed
  • packages/svelte/src/compiler/phases/3-transform/client

2 files changed

+8
-12
lines changed

packages/svelte/src/compiler/phases/3-transform/client/transform-template/index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
/**
2-
* @import { ComponentContext, ComponentClientTransformState } from "../types.js"
3-
* @import { Identifier, Expression } from "estree"
4-
* @import { Namespace } from '#compiler'
5-
* @import { SourceLocation } from '#shared'
6-
*/
1+
/** @import { ComponentContext, ComponentClientTransformState } from '../types.js' */
2+
/** @import { Identifier, Expression } from 'estree' */
3+
/** @import { Namespace } from '#compiler' */
4+
/** @import { SourceLocation } from '#shared' */
75
import { dev } from '../../../../state.js';
86
import * as b from '../../../../utils/builders.js';
97
import { template_to_functions } from './to-functions.js';

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -443,18 +443,16 @@ export function build_component(node, component_name, context, anchor = context.
443443
if (context.state.metadata.namespace === 'svg') {
444444
// this boils down to <g><!></g>
445445
context.state.template.create_element('g');
446-
context.state.template.push_element();
447-
context.state.template.create_anchor();
448-
context.state.template.pop_element();
449446
} else {
450447
// this boils down to <svelte-css-wrapper style='display: contents'><!></svelte-css-wrapper>
451448
context.state.template.create_element('svelte-css-wrapper');
452449
context.state.template.set_prop('style', 'display: contents');
453-
context.state.template.push_element();
454-
context.state.template.create_anchor();
455-
context.state.template.pop_element();
456450
}
457451

452+
context.state.template.push_element();
453+
context.state.template.create_anchor();
454+
context.state.template.pop_element();
455+
458456
statements.push(
459457
b.stmt(b.call('$.css_props', anchor, b.thunk(b.object(custom_css_props)))),
460458
b.stmt(fn(b.member(anchor, 'lastChild'))),

0 commit comments

Comments
 (0)