fix: cleanup in `finally`

pull/18058/head
paoloricciuti 4 months ago
parent 5c0e54ecff
commit 9ccd0b4e08

@ -51,21 +51,24 @@ export function createRenderer(renderer) {
*/
render(Component, { target, props, context }) {
var cleanup = push_renderer(renderer);
const unmount = effect_root(() => {
var anchor = renderer.createComment('');
renderer.insert(/** @type {*} */ (target), anchor, null);
boundary(/** @type {*} */ (anchor), { pending: () => {} }, (anchor) => {
push({});
var ctx = /** @type {ComponentContext} */ (component_context);
if (context) ctx.c = context;
branch(() => {
/** @type {Function} */ (Component)(anchor, props);
try {
const unmount = effect_root(() => {
var anchor = renderer.createComment('');
renderer.insert(/** @type {*} */ (target), anchor, null);
boundary(/** @type {*} */ (anchor), { pending: () => {} }, (anchor) => {
push({});
var ctx = /** @type {ComponentContext} */ (component_context);
if (context) ctx.c = context;
branch(() => {
/** @type {Function} */ (Component)(anchor, props);
});
pop();
});
pop();
});
});
cleanup();
return unmount;
return unmount;
} finally {
cleanup();
}
}
};
}

Loading…
Cancel
Save