Skip to content

Commit 50a9ebc

Browse files
committed
shuffle
1 parent 6c58013 commit 50a9ebc

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ export function RegularElement(node, context) {
5858
return;
5959
}
6060

61+
const is_custom_element = is_custom_element_node(node);
62+
63+
if (is_custom_element) {
64+
// cloneNode is faster, but it does not instantiate the underlying class of the
65+
// custom element until the template is connected to the dom, which would
66+
// cause problems when setting properties on the custom element.
67+
// Therefore we need to use importNode instead, which doesn't have this caveat.
68+
context.state.metadata.context.template_needs_import_node = true;
69+
}
70+
6171
if (node.name === 'script') {
6272
context.state.metadata.context.template_contains_script_tag = true;
6373
}
@@ -79,16 +89,6 @@ export function RegularElement(node, context) {
7989
/** @type {ExpressionStatement[]} */
8090
const lets = [];
8191

82-
const is_custom_element = is_custom_element_node(node);
83-
84-
if (is_custom_element) {
85-
// cloneNode is faster, but it does not instantiate the underlying class of the
86-
// custom element until the template is connected to the dom, which would
87-
// cause problems when setting properties on the custom element.
88-
// Therefore we need to use importNode instead, which doesn't have this caveat.
89-
context.state.metadata.context.template_needs_import_node = true;
90-
}
91-
9292
/** @type {Map<string, AST.Attribute>} */
9393
const lookup = new Map();
9494

0 commit comments

Comments
 (0)