Skip to content

Commit 3c8db9f

Browse files
committed
fixup! test(prefer-svelte-reactivity): added tests for encapsulated local variables
1 parent 5486710 commit 3c8db9f

File tree

3 files changed

+43
-5
lines changed

3 files changed

+43
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
<script lang="ts">
1+
<script>
22
class A {
3-
private variable = new Set([1, 2, 1, 3, 3]);
3+
#variable = new Set([1, 2, 1, 3, 3]);
44
5-
public fn() {
6-
this.variable.add(42);
5+
#fn() {
6+
this.#variable.add(42);
7+
return this.#variable;
8+
}
9+
10+
fn2() {
11+
this.#fn();
712
return 42;
813
}
914
}
1015
1116
const a = new A();
1217
</script>
1318

14-
{a.fn()}
19+
{a.fn2()}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<script lang="ts">
2+
class A {
3+
private variable = new Set([1, 2, 1, 3, 3]);
4+
5+
public fn() {
6+
this.variable.add(42);
7+
return 42;
8+
}
9+
}
10+
11+
const a = new A();
12+
</script>
13+
14+
{a.fn()}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<script lang="ts">
2+
class A {
3+
private variable = new Set([1, 2, 1, 3, 3]);
4+
5+
private fn() {
6+
this.variable.add(42);
7+
return this.variable;
8+
}
9+
10+
public fn2() {
11+
this.fn();
12+
return 42;
13+
}
14+
}
15+
16+
const a = new A();
17+
</script>
18+
19+
{a.fn2()}

0 commit comments

Comments
 (0)