remove effect.block

pull/10880/head
Rich Harris 2 years ago
parent 6c715f417f
commit 3ea5c31d20

@ -39,7 +39,6 @@ function create_effect(type, fn, sync, block = current_block, init = true) {
const signal = {
parent: current_effect,
dom: null,
block,
deps: null,
f: type | DIRTY,
l: 0,
@ -254,7 +253,6 @@ export function destroy_effect(effect) {
effect.teardown =
effect.ondestroy =
effect.ctx =
effect.block =
effect.dom =
effect.deps =
null;

@ -38,8 +38,6 @@ export interface Derived<V = unknown> extends Value<V>, Reaction {
export interface Effect extends Reaction {
parent: Effect | null;
dom: Dom | null;
/** The block associated with this effect */
block: null | Block;
/** The associated component context */
ctx: null | ComponentContext;
/** Stuff to do when the effect is destroyed */

@ -387,13 +387,11 @@ export function execute_effect(signal) {
const previous_effect = current_effect;
const previous_component_context = current_component_context;
const previous_block = current_block;
const component_context = signal.ctx;
current_effect = signal;
current_component_context = component_context;
current_block = signal.block;
try {
destroy_children(signal);
@ -403,7 +401,6 @@ export function execute_effect(signal) {
} finally {
current_effect = previous_effect;
current_component_context = previous_component_context;
current_block = previous_block;
}
if ((signal.f & PRE_EFFECT) !== 0 && current_queued_pre_and_render_effects.length > 0) {
@ -514,7 +511,6 @@ export function schedule_effect(signal, sync) {
if (!should_append) {
const target_level = signal.l;
const target_block = signal.block;
const is_pre_effect = (flags & PRE_EFFECT) !== 0;
let target_signal;
let target_signal_level;
@ -530,7 +526,7 @@ export function schedule_effect(signal, sync) {
is_target_pre_effect = (target_signal.f & PRE_EFFECT) !== 0;
if (
target_signal_level < target_level ||
target_signal.block !== target_block ||
target_signal !== signal ||
(is_target_pre_effect && !is_pre_effect)
) {
i++;

Loading…
Cancel
Save