chore(repl): hide globals (#10125)

pull/10127/head
gtmnayan 6 months ago committed by GitHub
parent 1ff9c0f2b9
commit b623890439
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -111,14 +111,15 @@
${styles} ${styles}
{
const styles = document.querySelectorAll('style[id^=svelte-]'); const styles = document.querySelectorAll('style[id^=svelte-]');
let i = styles.length; let i = styles.length;
while (i--) styles[i].parentNode.removeChild(styles[i]); while (i--) styles[i].parentNode.removeChild(styles[i]);
if (window.unmount) { if (window.__unmount_previous) {
try { try {
window.unmount(); window.__unmount_previous();
} catch (err) { } catch (err) {
console.error(err); console.error(err);
} }
@ -126,11 +127,14 @@
document.body.innerHTML = ''; document.body.innerHTML = '';
window._svelteTransitionManager = null; window._svelteTransitionManager = null;
}
const { mount, App } = ${$bundle.client?.code}; const __repl_exports = ${$bundle.client?.code};
{
const { mount, App } = __repl_exports;
const [, destroy] = mount(App, { target: document.body }); const [, destroy] = mount(App, { target: document.body });
window.__unmount_previous = destroy;
window.unmount = destroy; }
//# sourceURL=playground:output //# sourceURL=playground:output
`); `);
error = null; error = null;

Loading…
Cancel
Save