| 639 | |
| 640 | // e.g. an in-place morph's, through its arguments or what it returned |
| 641 | const writeAll = (call: Writes, counterparts: Map<object, unknown>) => { |
| 642 | relate(counterparts, call.copiedAfter) |
| 643 | if (!call.written.length) return |
| 644 | // e.g. not ctx.root's, which the call reached but didn't receive |
| 645 | const received = new Set<unknown>() |
| 646 | for (const [o, c] of call.copiedAfter) if (call.copied.has(o)) received.add(c) |
| 647 | const visited = new Set<object>() |
| 648 | for (const state of [...call.written, call.result]) |
| 649 | writeOnto(state, counterparts, received, visited) |
| 650 | } |
| 651 | |
| 652 | const replay = ( |
| 653 | current: Validation, |