Fix current component not being cleared after component update (#4909)

pull/5380/head
rdb 4 years ago committed by GitHub
parent ae971f80ae
commit 211fc92e69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -45,6 +45,7 @@ export function flush() {
set_current_component(component);
update(component.$$);
}
set_current_component(null);
dirty_components.length = 0;

@ -0,0 +1,4 @@
export default {
skip_if_ssr: true,
html: `1`,
};

@ -0,0 +1,16 @@
<script>
import { onMount } from 'svelte';
import { get_current_component } from 'svelte/internal';
let gotException = 0;
onMount(() => {
try {
get_current_component();
} catch (error) {
gotException++;
}
});
</script>
{gotException}
Loading…
Cancel
Save