continue not break

pull/9669/head
Rich Harris 3 years ago
parent 289d568357
commit 7eb14e7e79

@ -432,7 +432,7 @@ export function analyze_component(root, options) {
}
warn(warnings, binding.node, [], 'non-state-reference', name);
break outer;
continue outer;
}
}
}

@ -1,8 +1,10 @@
<script>
let a = $state(1);
let b = 2;
let c = 3;
</script>
<button onclick={() => a += 1}>a += 1</button>
<button onclick={() => b += 1}>b += 1</button>
<p>{a} + {b} = {a + b}</p>
<button onclick={() => c += 1}>c += 1</button>
<p>{a} + {b} + {c} = {a + b + c}</p>

@ -10,5 +10,17 @@
"column": 6,
"line": 3
}
},
{
"code": "non-state-reference",
"message": "c is updated, but is not declared with $state(...). Changing its value will not correctly trigger updates.",
"start": {
"column": 5,
"line": 4
},
"end": {
"column": 6,
"line": 4
}
}
]

Loading…
Cancel
Save