-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prevent await block mounting inside removed if block - fixes #1496
- Loading branch information
1 parent
220515b
commit b7ba0d6
Showing
4 changed files
with
47 additions
and
0 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
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
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,22 @@ | ||
let fulfil; | ||
|
||
const promise = new Promise(f => { | ||
fulfil = f; | ||
}); | ||
|
||
export default { | ||
props: { | ||
promise | ||
}, | ||
|
||
html: ``, | ||
|
||
async test({ assert, component, target }) { | ||
component.condition = false; | ||
|
||
fulfil(); | ||
await new Promise(f => setTimeout(f, 0)); | ||
|
||
assert.htmlEqual(target.innerHTML, ``); | ||
} | ||
}; |
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,8 @@ | ||
<script> | ||
export let promise; | ||
export let condition = true; | ||
</script> | ||
|
||
{#if condition} | ||
{#await promise then _}hello{/await} | ||
{/if} |