forked from sveltejs/svelte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Internals: Scheduler: Fix infinite loop in flush (sveltejs#4316)
- Loading branch information
1 parent
24c319f
commit 2ff38d4
Showing
4 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
test/runtime/samples/lifecycle-onmount-infinite-loop/Child.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Child |
6 changes: 6 additions & 0 deletions
6
test/runtime/samples/lifecycle-onmount-infinite-loop/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
test({ assert, component }) { | ||
const { count } = component; | ||
assert.deepEqual(count, 1); | ||
} | ||
}; |
16 changes: 16 additions & 0 deletions
16
test/runtime/samples/lifecycle-onmount-infinite-loop/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<script> | ||
import { onMount } from 'svelte'; | ||
import Child from './Child.svelte'; | ||
let root; | ||
export let count = 0; | ||
onMount(() => { | ||
if (count < 5) { | ||
count++; | ||
new Child({ target: root }); | ||
} | ||
}); | ||
</script> | ||
|
||
<div bind:this={root}></div> |