Skip to content

Commit b3f91b2

Browse files
authored
add semi before reactive-block-wrapping function (#290)
1 parent da98889 commit b3f91b2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/svelte2tsx/src/svelte2tsx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ function processInstanceScriptContent(str: MagicString, script: Node): InstanceS
763763
const start = node.getStart() + astOffset;
764764
const end = node.getEnd() + astOffset;
765765

766-
str.prependLeft(start, '() => {');
766+
str.prependLeft(start, ';() => {');
767767
str.prependRight(end, '}');
768768
}
769769
}

packages/svelte2tsx/test/sourcemaps/repl.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
});
6363

6464
// TODO is there a non-hacky way to trigger scroll when chapter changes?
65-
() => {$: if (scrollable) chapter, scrollable.scrollTo(0, 0);}
65+
;() => {$: if (scrollable) chapter, scrollable.scrollTo(0, 0);}
6666

6767
// TODO: this will need to be changed to the master branch, and probably should be dynamic instead of included
6868
// here statically
@@ -77,7 +77,7 @@
7777
source: file.source
7878
});
7979

80-
() => {$: if (repl) {
80+
;() => {$: if (repl) {
8181
completed = false;
8282
repl.set({
8383
components: chapter.app_a.map(clone)

packages/svelte2tsx/test/svelte2tsx/samples/reactive-block/expected.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<></>;function render() {
22

33
let a: 1 | 2 = 1;
4-
() => {$: {
4+
;() => {$: {
55
console.log(a + 1);
66
}}
77
;

0 commit comments

Comments
 (0)