File tree Expand file tree Collapse file tree 1 file changed +7
-14
lines changed
Expand file tree Collapse file tree 1 file changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ class DataNode {
248248
249249 current ( ) {
250250 if ( Listener !== null ) {
251- logDataRead ( this ) ;
251+ logRead ( this ) ;
252252 }
253253 return this . value ;
254254 }
@@ -301,7 +301,7 @@ class ComputationNode {
301301 if ( this . state === RUNNING ) throw new Error ( "circular dependency" ) ;
302302 else updateNode ( this ) ; // checks for state === STALE internally, so don't need to check here
303303 }
304- logComputationRead ( this ) ;
304+ logRead ( this ) ;
305305 }
306306
307307 return this . value ;
@@ -456,8 +456,11 @@ function recycleOrClaimNode<T>(node : ComputationNode, fn : (v : T | undefined)
456456 return recycle ;
457457}
458458
459- function logRead ( from : Log ) {
460- var to = Listener ! ,
459+ function logRead ( data : DataNode | ComputationNode ) {
460+ if ( data . log === null ) data . log = new Log ( ) ;
461+
462+ var from = data . log ,
463+ to = Listener ! ,
461464 fromslot : number ,
462465 toslot = to . source1 === null ? - 1 : to . sources === null ? 0 : to . sources . length ;
463466
@@ -487,16 +490,6 @@ function logRead(from : Log) {
487490 }
488491}
489492
490- function logDataRead ( data : DataNode ) {
491- if ( data . log === null ) data . log = new Log ( ) ;
492- logRead ( data . log ) ;
493- }
494-
495- function logComputationRead ( node : ComputationNode ) {
496- if ( node . log === null ) node . log = new Log ( ) ;
497- logRead ( node . log ) ;
498- }
499-
500493function event ( ) {
501494 // b/c we might be under a top level S.root(), have to preserve current root
502495 var owner = Owner ;
You can’t perform that action at this time.
0 commit comments