mirror of https://github.com/sveltejs/svelte
Fixes: https://github.com/sveltejs/svelte/issues/6794pull/6800/head
parent
6ac7038e47
commit
dc82f0aa79
@ -0,0 +1,7 @@
|
|||||||
|
[{
|
||||||
|
"code": "invalid_var_declaration",
|
||||||
|
"message": "\"var\" scope should not extend outside the reactive block",
|
||||||
|
"start": { "line": 14, "column": 7, "character": 204 },
|
||||||
|
"end": { "line": 14, "column": 16, "character": 213 },
|
||||||
|
"pos": 204
|
||||||
|
}]
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
<script>
|
||||||
|
var a;
|
||||||
|
var {a, b: [d, f], c}= {a: 1, b: [1, 2], c: 2};
|
||||||
|
$: {
|
||||||
|
function one() {
|
||||||
|
var a = 'a';
|
||||||
|
function two() {
|
||||||
|
var a = 'b';
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
return two();
|
||||||
|
}
|
||||||
|
a = one();
|
||||||
|
for (var i = 0; i<5; i ++ ) {
|
||||||
|
// Todo
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<h1>Hello {a}</h1>
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
[{
|
||||||
|
"code": "invalid_var_declaration",
|
||||||
|
"message": "\"var\" scope should not extend outside the reactive block",
|
||||||
|
"start": { "line": 4, "column": 2, "character": 32 },
|
||||||
|
"end": { "line": 4, "column": 50, "character": 80 },
|
||||||
|
"pos": 32
|
||||||
|
}]
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
<script>
|
||||||
|
$: {
|
||||||
|
let f = 'f';
|
||||||
|
var {a, b: [c, d], e} = {a: 1, b: [2, 3], e: 4};
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<h1>Hello</h1>
|
||||||
@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
<script>
|
||||||
|
var name = 'name';
|
||||||
|
var c = 'cc';
|
||||||
|
let d = 'd';
|
||||||
|
$: {
|
||||||
|
function a() {
|
||||||
|
function b() {
|
||||||
|
var c = 'c';
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
let d = 'dd';
|
||||||
|
name = a()();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<h1>Hello {name}</h1>
|
||||||
Loading…
Reference in new issue