Skip to content

Commit c7befaf

Browse files
committed
fix const test
1 parent 386ec29 commit c7befaf

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

packages/svelte/src/compiler/print/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,7 @@ const svelte_visitors = {
442442
},
443443

444444
ConstTag(node, context) {
445-
// TODO this is buggy
446-
context.write('{@const ');
445+
context.write('{@');
447446
context.visit(node.declaration);
448447
context.write('}');
449448
},

packages/svelte/tests/print/samples/const/output.svelte renamed to packages/svelte/tests/print/samples/const-tag/output.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
</script>
44

55
{#each boxes as box}
6-
{@const const area = box.width * box.height;}
6+
{@const area = box.width * box.height;}
77
{box.width} * {box.height} = {area}
88
{/each}

0 commit comments

Comments
 (0)