File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -659,9 +659,7 @@ export class StoreReader {
659659 i ,
660660 nextDataState === "partial" ?
661661 // avoid mutating the execResult partialBoundaries object
662- new PartialBoundaries ( )
663- . merge ( execResult . partialBoundaries )
664- . add ( field )
662+ execResult . partialBoundaries . clone ( ) . add ( field )
665663 : execResult . partialBoundaries
666664 ) ;
667665
@@ -893,12 +891,18 @@ class PartialBoundaries {
893891 return this . children . get ( key ) ;
894892 }
895893
894+ clone ( ) {
895+ return new PartialBoundaries ( ) . merge ( this ) ;
896+ }
897+
896898 set ( key : string | number , boundary : PartialBoundaries ) {
897899 const child = this . getChild ( key ) ;
898900
899901 this . children . set (
900902 key ,
901- child ? new PartialBoundaries ( ) . merge ( child ) . merge ( boundary ) : boundary
903+ // Create a new PartialBoundaries instance to avoid mutating any cached
904+ // execResult partialBoundaries objects
905+ child ? child . clone ( ) . merge ( boundary ) : boundary
902906 ) ;
903907 }
904908
You can’t perform that action at this time.
0 commit comments