* @param {Reaction} reaction * @param {Source[]} sources * @param {Map<Reaction, boolean>} checked
(reaction, sources, checked)
| 1204 | * @param {Map<Reaction, boolean>} checked |
| 1205 | */ |
| 1206 | function depends_on(reaction, sources, checked) { |
| 1207 | const depends = checked.get(reaction); |
| 1208 | if (depends !== undefined) return depends; |
| 1209 | |
| 1210 | if (reaction.deps !== null) { |
| 1211 | for (const dep of reaction.deps) { |
| 1212 | if (includes.call(sources, dep)) { |
| 1213 | return true; |
| 1214 | } |
| 1215 | |
| 1216 | if ((dep.f & DERIVED) !== 0 && depends_on(/** @type {Derived} */ (dep), sources, checked)) { |
| 1217 | checked.set(/** @type {Derived} */ (dep), true); |
| 1218 | return true; |
| 1219 | } |
| 1220 | } |
| 1221 | } |
| 1222 | |
| 1223 | checked.set(reaction, false); |
| 1224 | |
| 1225 | return false; |
| 1226 | } |
| 1227 | |
| 1228 | /** |
| 1229 | * @param {Effect} effect |
no test coverage detected