|
|
@ -370,22 +370,18 @@ export function handle_error(error, effect, previous_effect, component_context)
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @param {Value} signal
|
|
|
|
* @param {Value} signal
|
|
|
|
* @param {Effect} effect
|
|
|
|
* @param {Effect} effect
|
|
|
|
* @param {number} [depth]
|
|
|
|
* @param {boolean} [root]
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function schedule_possible_effect_self_invalidation(signal, effect, depth = 0) {
|
|
|
|
function schedule_possible_effect_self_invalidation(signal, effect, root = true) {
|
|
|
|
var reactions = signal.reactions;
|
|
|
|
var reactions = signal.reactions;
|
|
|
|
if (reactions === null) return;
|
|
|
|
if (reactions === null) return;
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < reactions.length; i++) {
|
|
|
|
for (var i = 0; i < reactions.length; i++) {
|
|
|
|
var reaction = reactions[i];
|
|
|
|
var reaction = reactions[i];
|
|
|
|
if ((reaction.f & DERIVED) !== 0) {
|
|
|
|
if ((reaction.f & DERIVED) !== 0) {
|
|
|
|
schedule_possible_effect_self_invalidation(
|
|
|
|
schedule_possible_effect_self_invalidation(/** @type {Derived} */ (reaction), effect, false);
|
|
|
|
/** @type {Derived} */ (reaction),
|
|
|
|
|
|
|
|
effect,
|
|
|
|
|
|
|
|
depth + 1
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
} else if (effect === reaction) {
|
|
|
|
} else if (effect === reaction) {
|
|
|
|
if (depth === 0) {
|
|
|
|
if (root) {
|
|
|
|
set_signal_status(reaction, DIRTY);
|
|
|
|
set_signal_status(reaction, DIRTY);
|
|
|
|
} else if ((reaction.f & CLEAN) !== 0) {
|
|
|
|
} else if ((reaction.f & CLEAN) !== 0) {
|
|
|
|
set_signal_status(reaction, MAYBE_DIRTY);
|
|
|
|
set_signal_status(reaction, MAYBE_DIRTY);
|
|
|
@ -458,6 +454,8 @@ export function update_reaction(reaction) {
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|
is_runes() &&
|
|
|
|
is_runes() &&
|
|
|
|
untracked_writes !== null &&
|
|
|
|
untracked_writes !== null &&
|
|
|
|
|
|
|
|
!untracking &&
|
|
|
|
|
|
|
|
deps !== null &&
|
|
|
|
(reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0
|
|
|
|
(reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
for (i = 0; i < /** @type {Source[]} */ (untracked_writes).length; i++) {
|
|
|
|
for (i = 0; i < /** @type {Source[]} */ (untracked_writes).length; i++) {
|
|
|
|