File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
packages/svelte/src/compiler/phases/3-transform/server/visitors Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,14 @@ import { build_template } from './shared/utils.js';
1414 */
1515export function SvelteElement ( node , context ) {
1616 let tag = /** @type {Expression } */ ( context . visit ( node . tag ) ) ;
17- if ( tag . type !== 'Identifier' ) {
18- const tag_id = context . state . scope . generate ( '$$tag' ) ;
19- context . state . init . push ( b . const ( tag_id , tag ) ) ;
20- tag = b . id ( tag_id ) ;
21- }
2217
2318 if ( dev ) {
19+ if ( tag . type !== 'Identifier' ) {
20+ const tag_id = context . state . scope . generate ( '$$tag' ) ;
21+ context . state . init . push ( b . const ( tag_id , tag ) ) ;
22+ tag = b . id ( tag_id ) ;
23+ }
24+
2425 if ( node . fragment . nodes . length > 0 ) {
2526 context . state . init . push ( b . stmt ( b . call ( '$.validate_void_dynamic_element' , b . thunk ( tag ) ) ) ) ;
2627 }
You can’t perform that action at this time.
0 commit comments