mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-22 05:59:31 +08:00
`const cur = m.get(k); m.set(k, f(cur))` and `m.set(k, (m.get(k) ?? 0) + 1)` probed a string-keyed map's hash index twice. When only inert code (reads, scalar arithmetic, compiler-resolved throws) runs between the read and the write, the read parks the map, the key and the resolved entry in local slots and the write overwrites that entry's value in place if the map and key are identical at run time and the entry was found. Misses and every other case take the ordinary set, so insertion order and SameValueZero semantics are unchanged. Only string-keyed typed maps with scalar values fuse; number-key writes after a read already store into the found entry through findReadNumberMapWrites.