prevent context leakage

aaa
Rich Harris 8 months ago
parent f440273f21
commit 18752cc728

@ -371,7 +371,7 @@ export function client_component(analysis, options) {
const body = b.function_declaration(
b.id('$$body'),
[b.id('$$anchor'), b.id('$$props')],
component_block
b.block([...component_block.body, b.stmt(b.call('$.exit'))])
);
body.async = true;

@ -297,6 +297,10 @@ export async function suspend(promise) {
// @ts-ignore
boundary?.fn(ASYNC_INCREMENT);
// prevent the active effect from outstaying its welcome
// TODO is a microtask too late? is this correct?
queue_post_micro_task(exit);
const value = await promise;
return {

@ -98,6 +98,13 @@ export function set_active_effect(effect) {
active_effect = effect;
}
// TODO remove this, once we're satisfied that we're not leaking context
setInterval(() => {
if (active_effect !== null || active_reaction !== null) {
debugger;
}
});
/**
* When sources are created within a derived, we record them so that we can safely allow
* local mutations to these sources without the side-effect error being invoked unnecessarily.

Loading…
Cancel
Save