If the expression above is used as guard condition of a while loop, it gets even more complicated. In the end, this way of tracking the program counter involves transformations which resemble the work a compiler does to break a high level language to low level assembly code.
An alternative way is to make use of these intermediate computation results. These are necessary in order to resume the computation of an expression and, additionally, give a hint about the current progress of execution.
The initial implementation used an JavaScript object (called "value map") to store these intermediate values under the key of their source code position.