Commit 5df1bf6
committed
fix(documents.js): replace rotationsOf's equivalent kind check with a property-presence guard
rotationsOf's vector.kind === "line" comparison was a genuine equivalent-
mutant trap: forcing that comparison to always-true still type-narrows on
the original condition text, so accessing rotationDeg in that branch
stays valid, and a line vector's own missing key reports undefined
either way -- indistinguishable from the correct branch's own explicit
undefined, so no test could ever kill it. A "rotationDeg" in vector check
narrows identically for every real input but has no such loophole: an
always-true mutation of it fails to compile outright (accessing
rotationDeg on the now-unnarrowed union), leaving only an always-false
mutation, which a real rotationDeg value does kill.
withoutRotation's own analogous survivors were a toEqual gap rather than
an equivalent mutant: spreading an explicit rotationDeg: undefined onto a
line vector (which never carries that key at all) still toEqual's the
untouched original, since toEqual treats an undefined-valued key as
indistinguishable from an absent one. toStrictEqual does not.1 parent 5b2fae9 commit 5df1bf6
2 files changed
Lines changed: 41 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
0 commit comments