Commit 1de75a3
committed
Drop the unreachable commentColor back-compat in PdfViewerConfig
PdfViewerConfig::fromJson() seeded all three tools from a legacy shared
`commentColor` key when `tools` was absent. That branch cannot run.
ConfigMgr2::init() applies the user's document as an RFC 7386 merge patch on top
of the default-constructed MainConfig's toJson(), and toJson() always emits
`tools`. So by the time fromJson() sees the object, `tools` is present
unconditionally and the guard is always false. The branch only ever executed
from a direct fromJson() call -- which is exactly what its test did, so the gate
asserted the dead path rather than catching it.
Nothing is lost by removing it. `commentColor` existed only in the local
pdf.js-v6 commit and was never on master, so no config on disk anywhere carries
it. And absent-key safety for the replacement keys is now covered better than
the removed test covered it: testAbsentKeyKeepsTheCppDefaultForEveryField drops
each leaf key of the defaults document in turn and reloads through a real
ConfigMgr2::init(), which includes tools.*.color, tools.ink.width and
tools.freetext.fontSize.
The remaining `tools`-absent fallback is kept and its comment now says what it
is actually for: a direct fromJson() call, not a migration.
Full suite 216/216.1 parent b099871 commit 1de75a3
2 files changed
Lines changed: 3 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
43 | 32 | | |
44 | 33 | | |
45 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1219 | 1219 | | |
1220 | 1220 | | |
1221 | 1221 | | |
1222 | | - | |
1223 | | - | |
1224 | | - | |
1225 | | - | |
1226 | | - | |
1227 | | - | |
1228 | | - | |
1229 | | - | |
1230 | | - | |
1231 | | - | |
1232 | | - | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
1239 | | - | |
1240 | | - | |
1241 | | - | |
1242 | | - | |
1243 | | - | |
1244 | | - | |
1245 | | - | |
1246 | | - | |
1247 | 1222 | | |
1248 | 1223 | | |
1249 | 1224 | | |
| |||
0 commit comments