@@ -138,6 +138,7 @@ import {
138138 laneStageHook ,
139139 laneSeamsHook ,
140140 laneServedHook ,
141+ holdWorkHook ,
141142 laneWriteHook ,
142143 observeFlightHook ,
143144 wireExternalSourceHook
@@ -346,27 +347,27 @@ export function recompute(el: Computed<any>, create: boolean = false): void {
346347 // Restored at the end, after this pass's staging and runs have been
347348 // routed.
348349 // Lanes exist only with the lane engine installed (`laneStageHook`): a
349- // bundle without it seats every pass on mainline, and folds the seat away.
350+ // bundle without it seats every pass on mainline (`passLane` is never set)
351+ // and folds the seat, and its restores, away.
350352 const prevLane = passLane ;
351353 // The mount a first pass belongs to: its creator's lane, or the one its
352354 // creator's own mount came from — a render effect a verdict lane's mount's
353355 // content creates is that mount's too (#4166). Lanes only, like the seat.
354356 const prevMount = laneRoot ;
355357 const mount = laneStageHook && ( laneRoot = create && ( prevLane || prevMount ) ) ;
356- setPassLane (
357- ! laneStageHook
358- ? null
359- : ( el . _flags & REACTIVE_LANE_DIRTY ||
360- ( el . _config & ( CONFIG_OVERRIDE | CONFIG_GUESS ) ) === CONFIG_OVERRIDE ) &&
361- el . _x ?. _transaction ?. _lane
358+ if ( laneStageHook )
359+ setPassLane (
360+ ( el . _flags & REACTIVE_LANE_DIRTY ||
361+ ( el . _config & ( CONFIG_OVERRIDE | CONFIG_GUESS ) ) === CONFIG_OVERRIDE ) &&
362+ el . _x ?. _transaction ?. _lane
362363 ? el . _x . _transaction
363364 : // Loose `!=`: false with no creator lane (undefined == null).
364365 create &&
365366 prevLane ?. _parent ! . _verdict != prevLane &&
366367 ( creatorPass ( context ) ?. _flags as number ) & REACTIVE_RECOMPUTING_DEPS
367368 ? prevLane
368369 : null
369- ) ;
370+ ) ;
370371 // Attribution hook: fired before this run touches the dep list — `_deps`
371372 // still holds the previous run's links (the subscriptions that could have
372373 // triggered this run, and the baseline for the engine's subscription diff).
@@ -560,7 +561,7 @@ export function recompute(el: Computed<any>, create: boolean = false): void {
560561 if ( ! selfRegistered && ! isAsyncResult ) {
561562 if ( el . _x !== null ) {
562563 el . _x . _inFlight = null ;
563- el . _config &= ~ CONFIG_ASYNC ;
564+ if ( holdWorkHook ) el . _config &= ~ CONFIG_ASYNC ;
564565 }
565566 // A sync (non-object) return is the first real answer; async-shaped
566567 // results clear inside handleAsync at their own landing points, and a
@@ -575,6 +576,10 @@ export function recompute(el: Computed<any>, create: boolean = false): void {
575576 if ( el . _statusFlags !== 0 || el . _x !== null ) clearStatus ( el , create ) ;
576577 } catch ( e ) {
577578 const notReady = e instanceof NotReadyError ;
579+ // An error answers, and so does a loading window's unready read (D-25,
580+ // verdict.ts `holdWork`): no flight is its own. A pass left pending
581+ // keeps the last answer's. (Kept by the verdict engine alone.)
582+ if ( holdWorkHook && ( ! notReady || el . _loading ) ) el . _config &= ~ CONFIG_ASYNC ;
578583 if ( notReady && el . _loading ) {
579584 // Loading window with an unready sync dependency: register for the
580585 // source's settle (the settlePendingSource walk runs off
@@ -583,11 +588,8 @@ export function recompute(el: Computed<any>, create: boolean = false): void {
583588 // keeps serving. If the
584589 // node is currently errored the error stays the answer until this
585590 // retry can actually run.
586- el . _config &= ~ CONFIG_ASYNC ;
587591 parkLoadingWindow ( el , e as NotReadyError ) ;
588592 } else {
589- // An error answers (D-25, verdict.ts `holdWork`): no flight is its own.
590- if ( ! notReady ) el . _config &= ~ CONFIG_ASYNC ;
591593 // D-41: a pass of a held node, or one that read a staging of this
592594 // flush, stages its error (`stageError`).
593595 if ( notReady || ! ( stagedErr = stageError ( el , e , true ) ) ) {
@@ -642,7 +644,9 @@ export function recompute(el: Computed<any>, create: boolean = false): void {
642644 // that does (`read`): a pass that did neither (REACTIVE_PROBED, the same
643645 // bit) is an ordinary derivation again. Its async posture is the
644646 // verdict engine's to keep (CONFIG_ASYNC, verdict.ts `holdWork`, D-25).
645- el . _config = ( el . _config & ~ CONFIG_VERDICT ) | ( el . _flags & REACTIVE_PROBED ) ;
647+ // (Only the verdict engine probes: without it the line folds away.)
648+ if ( observeFlightHook )
649+ el . _config = ( el . _config & ~ CONFIG_VERDICT ) | ( el . _flags & REACTIVE_PROBED ) ;
646650 // REACTIVE_DISPOSED survives too (#3621): the pass may have disposed its
647651 // own owner (a memo calling its root's `dispose()`, a cleanup doing so
648652 // #3601/#3606), and `disposeChildren` set the flag on this node
@@ -684,7 +688,7 @@ export function recompute(el: Computed<any>, create: boolean = false): void {
684688 if ( el . _x !== null ) el . _x . _inFlight = null ;
685689 if ( __OBSERVE__ && attrHooks !== null )
686690 attrHooks . recomputeEnd ( el , create , false , false , false , false ) ;
687- setPassLane ( prevLane ) ;
691+ if ( laneStageHook ) setPassLane ( prevLane ) ;
688692 return ;
689693 }
690694 // The lane this pass is work of, if any: its seat (the node's, its
@@ -960,7 +964,7 @@ export function recompute(el: Computed<any>, create: boolean = false): void {
960964 // Lane work is the lane's to reveal (its seam), not this flush's commit.
961965 if ( lane === null ) queuePendingNode ( el ) ;
962966 }
963- setPassLane ( prevLane ) ;
967+ if ( laneStageHook ) setPassLane ( prevLane ) ;
964968 // Missed-wake reschedule (see the finally above): values this pass read
965969 // before the nested commit are stale, so run again now that the heap will
966970 // accept the node. Equality gates stop same-value landings from cascading,
@@ -1989,7 +1993,9 @@ export function read<T>(el: Signal<T> | Computed<T>): T {
19891993 // it probed inline: it reads held values as the screen and shows the
19901994 // verdict now. Not an effect: a render effect is a frame reader
19911995 // already, and a user effect's posture is its own reads'.
1992- if ( ! ( c as any ) . _type ) ( c as Computed < any > ) . _flags |= owner . _config & CONFIG_VERDICT ;
1996+ // (A verdict memo exists only with the verdict engine installed.)
1997+ if ( observeFlightHook && ! ( c as any ) . _type )
1998+ ( c as Computed < any > ) . _flags |= owner . _config & CONFIG_VERDICT ;
19931999 }
19942000 }
19952001 // L2, as in the fast block above (tracked or not). A node born into the
@@ -2052,23 +2058,21 @@ export function read<T>(el: Signal<T> | Computed<T>): T {
20522058 // — unless the flight committed beneath inputs already on screen
20532059 // (`observeFlight`), or the reader was born into the flight's transaction
20542060 // (#4010): it has no screen, and waits on the flight with its frame.
2061+ // (A lane, and a verdict reader, exist only with their engines installed —
2062+ // the verdict engine imports the lane engine: without it the test folds.)
20552063 if (
2064+ laneStageHook &&
20562065 owner . _statusFlags & STATUS_PENDING &&
20572066 ! committed &&
20582067 ! ( el . _config & CONFIG_OVERRIDE ) &&
20592068 ! ( owner . _statusFlags & STATUS_UNINITIALIZED )
20602069 ) {
20612070 // A reader with no committed value yet sees the flight pending: a
20622071 // boundary a lane mounts shows its fallback (A29's boundary exemption).
2063- // (A lane, and a verdict reader, exist only with their engines installed.)
2064- if (
2065- laneStageHook &&
2066- passLane !== null &&
2067- ! ( ( c as Computed < any > | null ) ?. _statusFlags ! & STATUS_UNINITIALIZED )
2068- )
2072+ if ( passLane !== null && ! ( ( c as Computed < any > | null ) ?. _statusFlags ! & STATUS_UNINITIALIZED ) )
20692073 committed = true ;
2070- else if ( observeFlightHook && c !== null && c . _config & CONFIG_VERDICT )
2071- committed = observeFlightHook ( c as Computed < any > , owner ) ;
2074+ else if ( c !== null && c . _config & CONFIG_VERDICT )
2075+ committed = observeFlightHook ! ( c as Computed < any > , owner ) ;
20722076 }
20732077 if ( owner . _statusFlags & STATUS_PENDING && ! committed ) {
20742078 // A reader landing on a pending node throws; an untracked read of an
0 commit comments