(reaction)
| 151 | * @returns {boolean} |
| 152 | */ |
| 153 | export function is_dirty(reaction) { |
| 154 | var flags = reaction.f; |
| 155 | |
| 156 | if ((flags & DIRTY) !== 0) { |
| 157 | return true; |
| 158 | } |
| 159 | |
| 160 | if (flags & DERIVED) { |
| 161 | reaction.f &= ~WAS_MARKED; |
| 162 | } |
| 163 | |
| 164 | if ((flags & MAYBE_DIRTY) !== 0) { |
| 165 | var dependencies = /** @type {Value[]} */ (reaction.deps); |
| 166 | var length = dependencies.length; |
| 167 | |
| 168 | for (var i = 0; i < length; i++) { |
| 169 | var dependency = dependencies[i]; |
| 170 | |
| 171 | if (is_dirty(/** @type {Derived} */ (dependency))) { |
| 172 | update_derived(/** @type {Derived} */ (dependency)); |
| 173 | } |
| 174 | |
| 175 | if (dependency.wv > reaction.wv) { |
| 176 | return true; |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | if ( |
| 181 | (flags & CONNECTED) !== 0 && |
| 182 | // During time traveling we don't want to reset the status so that |
| 183 | // traversal of the graph in the other batches still happens |
| 184 | batch_values === null |
| 185 | ) { |
| 186 | set_signal_status(reaction, CLEAN); |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | return false; |
| 191 | } |
| 192 | |
| 193 | /** |
| 194 | * @param {Value} signal |
no test coverage detected