Commit 8824801
fix: respect gene max_files constraint; remove variable shadowing
Two fixes in this commit:
1. Gene max_files constraint silently ignored (solidify.js:265)
`Math.max(Number(constraints.max_files) || 0, 20)` forced the
effective limit to at least 20, so any gene with `max_files < 20`
(e.g. the built-in gene at line 780 uses `max_files: 12`) had its
constraint silently overridden. Replace with a conditional that only
falls back to the default of 20 when no constraint is configured:
Number(constraints.max_files) > 0 ? Number(constraints.max_files) : DEFAULT_MAX_FILES
2. Redundant variable declarations shadowing outer scope
- solidify.js: `const sourceType` re-declared inside the
`eligible_to_broadcast` block with identical logic; the outer
declaration (line 942) is already in scope there.
- evolve.js: `const selectedBy` re-declared inside the solidify
`try` block with identical logic; the outer declaration (line 1036)
is already in scope there.
Removing the inner declarations eliminates the shadowing and ensures
any future change to the outer declaration propagates correctly.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>1 parent 682c333 commit 8824801
2 files changed
+2
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1137 | 1137 | | |
1138 | 1138 | | |
1139 | 1139 | | |
1140 | | - | |
1141 | 1140 | | |
1142 | 1141 | | |
1143 | 1142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
| 265 | + | |
| 266 | + | |
266 | 267 | | |
267 | 268 | | |
268 | 269 | | |
| |||
1076 | 1077 | | |
1077 | 1078 | | |
1078 | 1079 | | |
1079 | | - | |
1080 | 1080 | | |
1081 | 1081 | | |
1082 | 1082 | | |
| |||
0 commit comments