| |
| |
| |
| |
| @@ -764,6 +764,8 @@ function runComputation(node, value, time) { |
| if (node.updatedAt != null && "observers" in node) { |
| writeSignal(node, nextValue, true); |
| } else if (Transition && Transition.running && node.pure) { |
| + // On first computation during transition, also set committed value #2046 |
| + if (!Transition.sources.has(node)) node.value = nextValue; |
| Transition.sources.add(node); |
| node.tValue = nextValue; |
| } else node.value = nextValue; |
| @@ -987,18 +989,21 @@ function cleanNode(node) { |
| } |
| } |
| if (node.tOwned) { |
| - for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]); |
| + const tOwned = node.tOwned; |
| delete node.tOwned; |
| + for (i = tOwned.length - 1; i >= 0; i--) cleanNode(tOwned[i]); |
| } |
| if (Transition && Transition.running && node.pure) { |
| reset(node, true); |
| } else if (node.owned) { |
| - for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]); |
| + const owned = node.owned; |
| node.owned = null; |
| + for (i = owned.length - 1; i >= 0; i--) cleanNode(owned[i]); |
| } |
| if (node.cleanups) { |
| - for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i](); |
| + const cleanups = node.cleanups; |
| node.cleanups = null; |
| + for (i = cleanups.length - 1; i >= 0; i--) cleanups[i](); |
| } |
| if (Transition && Transition.running) node.tState = 0;else node.state = 0; |
| delete node.sourceMap; |
| |
| |
| |
| |
| @@ -762,6 +762,8 @@ function runComputation(node, value, time) { |
| if (node.updatedAt != null && "observers" in node) { |
| writeSignal(node, nextValue, true); |
| } else if (Transition && Transition.running && node.pure) { |
| + // On first computation during transition, also set committed value #2046 |
| + if (!Transition.sources.has(node)) node.value = nextValue; |
| Transition.sources.add(node); |
| node.tValue = nextValue; |
| } else node.value = nextValue; |
| @@ -985,18 +987,21 @@ function cleanNode(node) { |
| } |
| } |
| if (node.tOwned) { |
| - for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]); |
| + const tOwned = node.tOwned; |
| delete node.tOwned; |
| + for (i = tOwned.length - 1; i >= 0; i--) cleanNode(tOwned[i]); |
| } |
| if (Transition && Transition.running && node.pure) { |
| reset(node, true); |
| } else if (node.owned) { |
| - for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]); |
| + const owned = node.owned; |
| node.owned = null; |
| + for (i = owned.length - 1; i >= 0; i--) cleanNode(owned[i]); |
| } |
| if (node.cleanups) { |
| - for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i](); |
| + const cleanups = node.cleanups; |
| node.cleanups = null; |
| + for (i = cleanups.length - 1; i >= 0; i--) cleanups[i](); |
| } |
| if (Transition && Transition.running) node.tState = 0;else node.state = 0; |
| delete node.sourceMap; |
| |
| |
| |
| |
| @@ -127,12 +127,14 @@ function onCleanup(fn) { |
| } |
| function cleanNode(node) { |
| if (node.owned) { |
| - for (let i = 0; i < node.owned.length; i++) cleanNode(node.owned[i]); |
| + const owned = node.owned; |
| node.owned = null; |
| + for (let i = 0; i < owned.length; i++) cleanNode(owned[i]); |
| } |
| if (node.cleanups) { |
| - for (let i = 0; i < node.cleanups.length; i++) node.cleanups[i](); |
| + const cleanups = node.cleanups; |
| node.cleanups = null; |
| + for (let i = 0; i < cleanups.length; i++) cleanups[i](); |
| } |
| } |
| function catchError(fn, handler) { |
| |
| |
| |
| |
| @@ -125,12 +125,14 @@ function onCleanup(fn) { |
| } |
| function cleanNode(node) { |
| if (node.owned) { |
| - for (let i = 0; i < node.owned.length; i++) cleanNode(node.owned[i]); |
| + const owned = node.owned; |
| node.owned = null; |
| + for (let i = 0; i < owned.length; i++) cleanNode(owned[i]); |
| } |
| if (node.cleanups) { |
| - for (let i = 0; i < node.cleanups.length; i++) node.cleanups[i](); |
| + const cleanups = node.cleanups; |
| node.cleanups = null; |
| + for (let i = 0; i < cleanups.length; i++) cleanups[i](); |
| } |
| } |
| function catchError(fn, handler) { |
| |
| |
| |
| |
| @@ -717,6 +717,8 @@ function runComputation(node, value, time) { |
| if (node.updatedAt != null && "observers" in node) { |
| writeSignal(node, nextValue, true); |
| } else if (Transition && Transition.running && node.pure) { |
| + // On first computation during transition, also set committed value #2046 |
| + if (!Transition.sources.has(node)) node.value = nextValue; |
| Transition.sources.add(node); |
| node.tValue = nextValue; |
| } else node.value = nextValue; |
| @@ -938,18 +940,21 @@ function cleanNode(node) { |
| } |
| } |
| if (node.tOwned) { |
| - for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]); |
| + const tOwned = node.tOwned; |
| delete node.tOwned; |
| + for (i = tOwned.length - 1; i >= 0; i--) cleanNode(tOwned[i]); |
| } |
| if (Transition && Transition.running && node.pure) { |
| reset(node, true); |
| } else if (node.owned) { |
| - for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]); |
| + const owned = node.owned; |
| node.owned = null; |
| + for (i = owned.length - 1; i >= 0; i--) cleanNode(owned[i]); |
| } |
| if (node.cleanups) { |
| - for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i](); |
| + const cleanups = node.cleanups; |
| node.cleanups = null; |
| + for (i = cleanups.length - 1; i >= 0; i--) cleanups[i](); |
| } |
| if (Transition && Transition.running) node.tState = 0;else node.state = 0; |
| } |
| |
| |
| |
| |
| @@ -715,6 +715,8 @@ function runComputation(node, value, time) { |
| if (node.updatedAt != null && "observers" in node) { |
| writeSignal(node, nextValue, true); |
| } else if (Transition && Transition.running && node.pure) { |
| + // On first computation during transition, also set committed value #2046 |
| + if (!Transition.sources.has(node)) node.value = nextValue; |
| Transition.sources.add(node); |
| node.tValue = nextValue; |
| } else node.value = nextValue; |
| @@ -936,18 +938,21 @@ function cleanNode(node) { |
| } |
| } |
| if (node.tOwned) { |
| - for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]); |
| + const tOwned = node.tOwned; |
| delete node.tOwned; |
| + for (i = tOwned.length - 1; i >= 0; i--) cleanNode(tOwned[i]); |
| } |
| if (Transition && Transition.running && node.pure) { |
| reset(node, true); |
| } else if (node.owned) { |
| - for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]); |
| + const owned = node.owned; |
| node.owned = null; |
| + for (i = owned.length - 1; i >= 0; i--) cleanNode(owned[i]); |
| } |
| if (node.cleanups) { |
| - for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i](); |
| + const cleanups = node.cleanups; |
| node.cleanups = null; |
| + for (i = cleanups.length - 1; i >= 0; i--) cleanups[i](); |
| } |
| if (Transition && Transition.running) node.tState = 0;else node.state = 0; |
| } |
|
|