\ref or \pageref. text is what gets set, and it is mutable on
purpose: it starts as UNRESOLVED_REFERENCE, pass 2 fills in \ref, and
resolvePageNumbers fills in \pageref after a layout pass. Chunk 7 reads
text at shaping time, so re-running layout re-reads whatever is current.
\refor\pageref.textis what gets set, and it is mutable on purpose: it starts asUNRESOLVED_REFERENCE, pass 2 fills in\ref, andresolvePageNumbersfills in\pagerefafter a layout pass. Chunk 7 readstextat shaping time, so re-running layout re-reads whatever is current.