mirror of https://github.com/sveltejs/svelte
Checks each effect's execution count and only advances the overall flush count if an inidivual effect was executed many times, hinting at a loop The count overall is kept in place because theoretically there could be other infinite loops happening with no user effect in the mix. Fixes part of #16548pull/16611/head
parent
2e02868ef1
commit
6f0e43de1a
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: avoid false-positive infinite loop error
|
@ -0,0 +1,8 @@
|
|||||||
|
<script>
|
||||||
|
let a = $state(0);
|
||||||
|
$effect(() => {
|
||||||
|
a = 1;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{a}
|
@ -0,0 +1,11 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
mode: ['client', 'hydrate'],
|
||||||
|
|
||||||
|
compileOptions: {
|
||||||
|
dev: true
|
||||||
|
},
|
||||||
|
|
||||||
|
html: `1`.repeat(2000)
|
||||||
|
});
|
@ -0,0 +1,7 @@
|
|||||||
|
<script>
|
||||||
|
import Component from './Component.svelte';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#each Array(2000) as _, i}
|
||||||
|
<Component />
|
||||||
|
{/each}
|
Loading…
Reference in new issue