mirror of https://github.com/sveltejs/svelte
remove invalid-reactive-var validation as legacy reactive statements are transformed to functions under the hood, which never escape scope - arguably not completely correct, but will be what the user expects anyway
parent
fa2daf479e
commit
2faae5914b
@ -1,3 +0,0 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({ skip: true });
|
||||
@ -1,8 +0,0 @@
|
||||
[
|
||||
{
|
||||
"code": "invalid_var_declaration",
|
||||
"message": "\"var\" scope should not extend outside the reactive block",
|
||||
"start": { "line": 14, "column": 7 },
|
||||
"end": { "line": 14, "column": 16 }
|
||||
}
|
||||
]
|
||||
@ -1,20 +0,0 @@
|
||||
<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>
|
||||
@ -1,3 +0,0 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({ skip: true });
|
||||
@ -1,8 +0,0 @@
|
||||
[
|
||||
{
|
||||
"code": "invalid_var_declaration",
|
||||
"message": "\"var\" scope should not extend outside the reactive block",
|
||||
"start": { "line": 4, "column": 2 },
|
||||
"end": { "line": 4, "column": 50 }
|
||||
}
|
||||
]
|
||||
@ -1,8 +0,0 @@
|
||||
<script>
|
||||
$: {
|
||||
let f = 'f';
|
||||
var {a, b: [c, d], e} = {a: 1, b: [2, 3], e: 4};
|
||||
}
|
||||
</script>
|
||||
|
||||
<h1>Hello</h1>
|
||||
Loading…
Reference in new issue