revert mark_reactions changes

pull/16487/head
Rich Harris 1 month ago
parent 2d089ebe0a
commit a826136d74

@ -27,7 +27,7 @@ import * as e from '../errors.js';
import { flush_tasks } from '../dom/task.js';
import { DEV } from 'esm-env';
import { invoke_error_boundary } from '../error-handling.js';
import { mark_reactions, old_values } from './sources.js';
import { old_values } from './sources.js';
import { unlink_effect } from './effects.js';
import { unset_context } from './async.js';

@ -301,10 +301,9 @@ export function increment(source) {
/**
* @param {Value} signal
* @param {number} status should be DIRTY or MAYBE_DIRTY
* @param {boolean} schedule_async
* @returns {void}
*/
export function mark_reactions(signal, status, schedule_async = true) {
function mark_reactions(signal, status) {
var reactions = signal.reactions;
if (reactions === null) return;
@ -324,16 +323,14 @@ export function mark_reactions(signal, status, schedule_async = true) {
continue;
}
var should_schedule = (flags & DIRTY) === 0 && (schedule_async || (flags & ASYNC) === 0);
// don't set a DIRTY reaction to MAYBE_DIRTY
if (should_schedule) {
if ((flags & DIRTY) === 0) {
set_signal_status(reaction, status);
}
if ((flags & DERIVED) !== 0) {
mark_reactions(/** @type {Derived} */ (reaction), MAYBE_DIRTY);
} else if (should_schedule) {
} else {
schedule_effect(/** @type {Effect} */ (reaction));
}
}

Loading…
Cancel
Save