Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions packages/repl/src/lib/Output/Viewer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,17 @@
return untrack(() => original[method].apply(this, v));
}
}
const component = mount(App, { target: document.body });
window.__unmount_previous = () => {
for (const method of console_methods) {
console[method] = original[method];
let component;
try {
component = mount(App, { target: document.body });
} finally {
window.__unmount_previous = () => {
for (const method of console_methods) {
console[method] = original[method];
}
if (component) unmount(component);
window.__unmount_previous = null;
}
unmount(component);
}
}
//# sourceURL=playground:output
Expand Down