Skip to content

Commit 5d31d25

Browse files
committed
tweak, more logging
1 parent 27c5a33 commit 5d31d25

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

packages/svelte/src/internal/client/context.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ export function pop(component) {
172172
return component ?? /** @type {T} */ ({});
173173
}
174174
var effects = context.e;
175-
176-
if (effects !== null && context.a === false) {
175+
console.log(effects);
176+
if (effects !== null) {
177177
context.e = null;
178178

179179
for (var fn of effects) {

packages/svelte/src/internal/client/reactivity/async.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,13 @@ export async function* for_await_track_reactivity_loss(iterable) {
167167
}
168168
}
169169

170-
export function unset_context() {
170+
/**
171+
* @param {boolean} [is_component_body]
172+
*/
173+
export function unset_context(is_component_body = false) {
171174
set_active_effect(null);
172175
set_active_reaction(null);
173-
set_component_context(null);
176+
if (!is_component_body) set_component_context(null);
174177
if (DEV) set_from_async_derived(null);
175178
}
176179

@@ -190,12 +193,12 @@ export async function async_body(fn, is_component = false) {
190193
invoke_error_boundary(error, active);
191194
}
192195
} finally {
196+
unsuspend(is_component);
193197
console.log(ctx);
194198
if (ctx !== null) {
195199
console.log('hi');
196200
ctx.a = false;
197201
pop();
198202
}
199-
unsuspend();
200203
}
201204
}

packages/svelte/src/internal/client/reactivity/batch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ export function suspend() {
675675
boundary.update_pending_count(1);
676676
if (!pending) batch.increment();
677677

678-
return function unsuspend() {
678+
return function unsuspend(is_component_body = false) {
679679
boundary.update_pending_count(-1);
680680

681681
if (!pending) {
@@ -685,7 +685,7 @@ export function suspend() {
685685
batch.deactivate();
686686
}
687687

688-
unset_context();
688+
unset_context(is_component_body);
689689
};
690690
}
691691

0 commit comments

Comments
 (0)