mootant 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/dist/adapters/jest/build-dry-file.d.ts +12 -12
  2. package/dist/adapters/jest/collect-jest-dependencies.d.ts +8 -7
  3. package/dist/adapters/jest/runner.d.ts +1 -1
  4. package/dist/adapters/jest/runner.js +1 -1
  5. package/dist/adapters/jest/types/jest-record.d.ts +4 -4
  6. package/dist/adapters/jest/types/unit-worker.d.ts +16 -8
  7. package/dist/adapters/jest/types/worker-session.d.ts +6 -7
  8. package/dist/adapters/jest/worker/boot-worker.d.ts +4 -3
  9. package/dist/adapters/jest/worker/run-unit.d.ts +20 -18
  10. package/dist/adapters/jest/worker/vm-setup.js +1 -1
  11. package/dist/adapters/jest/worker/worker.js +1 -1
  12. package/dist/adapters/jest/write-worker-session.d.ts +1 -2
  13. package/dist/adapters/jest/write-worker-session.js +2 -2
  14. package/dist/adapters/node-test/collect-node-dependencies.d.ts +5 -5
  15. package/dist/adapters/node-test/preload/preload.js +4 -1
  16. package/dist/adapters/node-test/run-test-file.js +1 -0
  17. package/dist/adapters/node-test/types/node-test-record.d.ts +3 -3
  18. package/dist/adapters/node-test/types/node-test-unit.d.ts +6 -1
  19. package/dist/adapters/shared/create-input-filter.d.ts +26 -0
  20. package/dist/adapters/shared/create-input-filter.js +32 -0
  21. package/dist/adapters/shared/track-file-inputs.d.ts +7 -3
  22. package/dist/adapters/shared/track-file-inputs.js +16 -7
  23. package/dist/adapters/shared/track-file-reads.d.ts +12 -8
  24. package/dist/adapters/shared/track-file-reads.js +110 -57
  25. package/dist/adapters/shared/track-inputs.d.ts +13 -6
  26. package/dist/adapters/shared/track-inputs.js +7 -7
  27. package/dist/adapters/shared/types/file-input-tracking.d.ts +6 -0
  28. package/dist/adapters/shared/types/input-tracking.d.ts +3 -3
  29. package/dist/adapters/vitest/collect-dependencies.d.ts +4 -3
  30. package/dist/adapters/vitest/collect-dependencies.js +25 -24
  31. package/dist/adapters/vitest/get-cache-inputs.js +3 -1
  32. package/dist/adapters/vitest/is-virtual-module.d.ts +11 -0
  33. package/dist/adapters/vitest/is-virtual-module.js +8 -0
  34. package/dist/adapters/vitest/read-out-files.d.ts +7 -2
  35. package/dist/adapters/vitest/read-out-files.js +5 -5
  36. package/dist/adapters/vitest/read-out-records.d.ts +17 -0
  37. package/dist/adapters/vitest/read-out-records.js +27 -0
  38. package/dist/adapters/vitest/read-strays.d.ts +20 -0
  39. package/dist/adapters/vitest/read-strays.js +53 -0
  40. package/dist/adapters/vitest/read-unit-inputs.d.ts +7 -1
  41. package/dist/adapters/vitest/read-unit-inputs.js +1 -1
  42. package/dist/adapters/vitest/run-dry.js +16 -16
  43. package/dist/adapters/vitest/run-plan.d.ts +3 -1
  44. package/dist/adapters/vitest/run-plan.js +15 -15
  45. package/dist/adapters/vitest/run-specifications.d.ts +3 -2
  46. package/dist/adapters/vitest/runner.d.ts +38 -23
  47. package/dist/adapters/vitest/runner.js +84 -85
  48. package/dist/adapters/vitest/types/stray-decisions.d.ts +8 -0
  49. package/dist/adapters/vitest/types/unit-outcome.d.ts +2 -1
  50. package/dist/adapters/vitest/types/vitest-worker.d.ts +83 -12
  51. package/dist/adapters/vitest/worker/encode-stray.d.ts +16 -0
  52. package/dist/adapters/vitest/worker/encode-stray.js +16 -0
  53. package/dist/adapters/vitest/worker/intercept-strays.d.ts +26 -0
  54. package/dist/adapters/vitest/worker/intercept-strays.js +13 -0
  55. package/dist/adapters/vitest/worker/read-try-facts.d.ts +5 -4
  56. package/dist/adapters/vitest/worker/write-out-record.d.ts +2 -2
  57. package/dist/cli/html/build-html-report.js +1 -1
  58. package/dist/cli/html/client/main.js +1 -1
  59. package/dist/cli/html/client/render-change.d.ts +3 -2
  60. package/dist/cli/html/client/render-code.d.ts +1 -1
  61. package/dist/cli/html/pack-replacement.d.ts +1 -1
  62. package/dist/cli/parse-arguments.js +1 -1
  63. package/dist/cli/report/build-list-report.js +1 -1
  64. package/dist/cli/report/build-run-report.js +1 -1
  65. package/dist/cli/report/format-file-groups.d.ts +1 -1
  66. package/dist/cli/run-mutation.js +31 -31
  67. package/dist/cli/terminal/create-spinner.d.ts +1 -1
  68. package/dist/cli/terminal/get-text-style.js +4 -4
  69. package/dist/core/cache/get-environment-key.js +2 -2
  70. package/dist/core/cache/hash-files.d.ts +7 -3
  71. package/dist/core/cache/hash-files.js +16 -17
  72. package/dist/core/cache/prepare-run-cache.d.ts +29 -7
  73. package/dist/core/cache/prepare-run-cache.js +96 -62
  74. package/dist/core/cache/save-run-cache.d.ts +8 -7
  75. package/dist/core/cache/save-run-cache.js +2 -1
  76. package/dist/core/cache/unknown-hash.d.ts +7 -0
  77. package/dist/core/cache/unknown-hash.js +2 -0
  78. package/dist/core/files/select-changed-mutants.d.ts +11 -6
  79. package/dist/core/files/select-changed-mutants.js +38 -13
  80. package/dist/core/generate/apply-solitary-rule.d.ts +8 -5
  81. package/dist/core/generate/apply-solitary-rule.js +36 -29
  82. package/dist/core/generate/collect-candidates.d.ts +18 -4
  83. package/dist/core/generate/collect-candidates.js +168 -86
  84. package/dist/core/generate/compare-targets.d.ts +14 -0
  85. package/dist/core/generate/compare-targets.js +6 -0
  86. package/dist/core/generate/deduplicate-candidates.d.ts +6 -4
  87. package/dist/core/generate/deduplicate-candidates.js +11 -9
  88. package/dist/core/generate/find-list-removal.d.ts +20 -0
  89. package/dist/core/generate/find-list-removal.js +26 -0
  90. package/dist/core/generate/generate-file-mutants.js +47 -46
  91. package/dist/core/generate/get-mutant-site.d.ts +18 -0
  92. package/dist/core/generate/get-mutant-site.js +4 -0
  93. package/dist/core/generate/get-target.d.ts +14 -0
  94. package/dist/core/generate/get-target.js +4 -0
  95. package/dist/core/generate/pick-host.d.ts +10 -0
  96. package/dist/core/generate/pick-host.js +16 -0
  97. package/dist/core/generate/validate-replacement.d.ts +15 -4
  98. package/dist/core/generate/validate-replacement.js +28 -13
  99. package/dist/core/ignore/find-ignore-rule.d.ts +8 -7
  100. package/dist/core/instrument/find-attribute-values.d.ts +12 -0
  101. package/dist/core/instrument/find-attribute-values.js +13 -0
  102. package/dist/core/instrument/get-site-syntax.d.ts +14 -0
  103. package/dist/core/instrument/get-site-syntax.js +12 -0
  104. package/dist/core/instrument/group-mutant-ranges.d.ts +7 -3
  105. package/dist/core/instrument/group-mutant-ranges.js +25 -19
  106. package/dist/core/instrument/instrument-file.d.ts +5 -3
  107. package/dist/core/instrument/instrument-file.js +10 -9
  108. package/dist/core/instrument/instrumenter-version.d.ts +1 -1
  109. package/dist/core/instrument/render-branch.d.ts +17 -0
  110. package/dist/core/instrument/render-branch.js +81 -0
  111. package/dist/core/instrument/render-mutant-range.d.ts +17 -6
  112. package/dist/core/instrument/render-mutant-range.js +39 -13
  113. package/dist/core/list-mutants.d.ts +7 -5
  114. package/dist/core/list-mutants.js +2 -2
  115. package/dist/core/mutators/array-element.d.ts +7 -6
  116. package/dist/core/mutators/array-element.js +13 -13
  117. package/dist/core/mutators/assignment-operator.js +34 -33
  118. package/dist/core/mutators/boolean-literal.d.ts +3 -2
  119. package/dist/core/mutators/number-literal.d.ts +1 -1
  120. package/dist/core/mutators/object-property.d.ts +4 -3
  121. package/dist/core/mutators/object-property.js +7 -8
  122. package/dist/core/mutators/return-value.js +65 -33
  123. package/dist/core/mutators/shared/get-branch-copy-skip.d.ts +12 -7
  124. package/dist/core/mutators/shared/get-branch-copy-skip.js +34 -35
  125. package/dist/core/mutators/shared/get-canonical-falsy-default.d.ts +32 -0
  126. package/dist/core/mutators/shared/get-canonical-falsy-default.js +11 -0
  127. package/dist/core/mutators/shared/get-comparison-plan.js +86 -85
  128. package/dist/core/mutators/shared/get-condition-constants.d.ts +8 -8
  129. package/dist/core/mutators/shared/get-condition-constants.js +3 -3
  130. package/dist/core/mutators/shared/get-endless-value.d.ts +20 -0
  131. package/dist/core/mutators/shared/get-endless-value.js +25 -0
  132. package/dist/core/mutators/shared/get-forced-test-justifier.d.ts +44 -0
  133. package/dist/core/mutators/shared/get-forced-test-justifier.js +25 -0
  134. package/dist/core/mutators/shared/get-group-constant.d.ts +4 -4
  135. package/dist/core/mutators/shared/get-group-constant.js +2 -2
  136. package/dist/core/mutators/shared/get-literal-skip.d.ts +6 -6
  137. package/dist/core/mutators/shared/get-literal-skip.js +2 -2
  138. package/dist/core/mutators/shared/get-logical-drops.d.ts +8 -8
  139. package/dist/core/mutators/shared/get-logical-drops.js +80 -82
  140. package/dist/core/mutators/shared/get-owner-constant.d.ts +3 -1
  141. package/dist/core/mutators/shared/get-running-value.d.ts +5 -4
  142. package/dist/core/mutators/shared/get-toward-mutant.d.ts +10 -2
  143. package/dist/core/mutators/shared/get-toward-mutant.js +45 -40
  144. package/dist/core/mutators/shared/has-other-exit.js +16 -36
  145. package/dist/core/mutators/shared/is-loop-exit.d.ts +20 -0
  146. package/dist/core/mutators/shared/is-loop-exit.js +32 -0
  147. package/dist/core/mutators/shared/is-read-only.d.ts +26 -0
  148. package/dist/core/mutators/shared/is-read-only.js +53 -0
  149. package/dist/core/mutators/statement-removal.d.ts +4 -3
  150. package/dist/core/mutators/statement-removal.js +69 -73
  151. package/dist/core/mutators/string-literal.d.ts +15 -5
  152. package/dist/core/mutators/string-literal.js +79 -50
  153. package/dist/core/presets/recommended.d.ts +2 -2
  154. package/dist/core/presets/strict.d.ts +4 -2
  155. package/dist/core/run/apply-batch-result.d.ts +23 -22
  156. package/dist/core/run/apply-batch-result.js +5 -5
  157. package/dist/core/run/apply-isolated-result.d.ts +18 -17
  158. package/dist/core/run/apply-isolated-result.js +1 -0
  159. package/dist/core/run/classify-try.d.ts +9 -8
  160. package/dist/core/run/get-test-file-limits.d.ts +13 -0
  161. package/dist/core/run/get-test-file-limits.js +13 -0
  162. package/dist/core/run/get-unit-evidence.d.ts +6 -3
  163. package/dist/core/run/get-unit-evidence.js +1 -1
  164. package/dist/core/run/plan-batch.d.ts +6 -3
  165. package/dist/core/run/plan-batch.js +36 -31
  166. package/dist/core/run/plan-isolated.d.ts +3 -1
  167. package/dist/core/run/plan-isolated.js +8 -14
  168. package/dist/core/run/read-isolated-unit.d.ts +4 -4
  169. package/dist/core/run/run-batch-phases.d.ts +4 -3
  170. package/dist/core/run/run-dry-phase.d.ts +35 -19
  171. package/dist/core/run/run-dry-phase.js +127 -77
  172. package/dist/core/run/run-isolated-rounds.d.ts +6 -5
  173. package/dist/core/run/run-isolated-rounds.js +1 -0
  174. package/dist/core/run-mutants.d.ts +26 -21
  175. package/dist/core/run-mutants.js +72 -64
  176. package/dist/core/runtime/create-hit-limit-error.d.ts +5 -3
  177. package/dist/core/runtime/create-hit-limit-error.js +1 -1
  178. package/dist/core/runtime/install-mutant-runtime.js +23 -6
  179. package/dist/core/runtime/runtime-version.d.ts +4 -4
  180. package/dist/core/skips/skip-rules.d.ts +4 -0
  181. package/dist/core/skips/skip-rules.js +4 -0
  182. package/dist/core/syntax/is-brace-sensitive-attribute.d.ts +18 -0
  183. package/dist/core/syntax/is-brace-sensitive-attribute.js +28 -0
  184. package/dist/core/syntax/is-spread-safe-member.d.ts +18 -0
  185. package/dist/core/syntax/is-spread-safe-member.js +18 -0
  186. package/dist/core/syntax/is-value-position.d.ts +3 -1
  187. package/dist/core/text/get-list-removal-range.d.ts +22 -0
  188. package/dist/core/text/get-list-removal-range.js +46 -0
  189. package/dist/core/text/is-plain-attribute-string.d.ts +10 -0
  190. package/dist/core/text/is-plain-attribute-string.js +5 -0
  191. package/dist/core/text/parse-expression.d.ts +8 -4
  192. package/dist/core/text/parse-expression.js +1 -0
  193. package/dist/core/text/remove-list-element.d.ts +2 -4
  194. package/dist/core/text/remove-list-element.js +4 -45
  195. package/dist/docs/styles/colors.js +1 -1
  196. package/dist/package.js +1 -1
  197. package/dist/types/adapter/dry-file.d.ts +2 -1
  198. package/dist/types/adapter/dry-run-request.d.ts +5 -4
  199. package/dist/types/adapter/mutant-runtime.d.ts +30 -1
  200. package/dist/types/cli/text-style.d.ts +1 -1
  201. package/dist/types/config/preset-settings.d.ts +2 -2
  202. package/dist/types/config/run-config.d.ts +12 -4
  203. package/dist/types/html/indexed-mutant.d.ts +4 -2
  204. package/dist/types/html/shown-change.d.ts +4 -3
  205. package/dist/types/mutant/list-removal.d.ts +37 -0
  206. package/dist/types/mutant/mutant-candidate.d.ts +11 -17
  207. package/dist/types/mutant/mutant-host.d.ts +49 -0
  208. package/dist/types/mutant/mutant-kind.d.ts +18 -0
  209. package/dist/types/mutant/mutant-range.d.ts +15 -8
  210. package/dist/types/mutant/mutant.d.ts +9 -15
  211. package/dist/types/mutant/site-syntax.d.ts +14 -0
  212. package/dist/types/mutant/skip-justifier.d.ts +3 -1
  213. package/dist/types/mutant/skipped-candidate.d.ts +13 -10
  214. package/dist/types/mutant/skipped-mutant.d.ts +9 -6
  215. package/dist/types/mutator/replacement.d.ts +14 -3
  216. package/dist/types/report/html-report.d.ts +10 -7
  217. package/dist/types/report/list-report-focus.d.ts +3 -2
  218. package/dist/types/report/list-report-justifier.d.ts +4 -2
  219. package/dist/types/report/list-report-mutant.d.ts +15 -9
  220. package/dist/types/report/list-report-skipped.d.ts +3 -2
  221. package/dist/types/report/list-report.d.ts +1 -1
  222. package/dist/types/report/run-report.d.ts +2 -2
  223. package/dist/types/report/slim-list-report.d.ts +6 -3
  224. package/dist/types/report/slim-run-report.d.ts +1 -1
  225. package/dist/types/run/isolated-reason.d.ts +4 -3
  226. package/dist/types/run/mutant-state.d.ts +1 -1
  227. package/dist/types/run/run-event.d.ts +1 -1
  228. package/dist/types/run/run-kind.d.ts +3 -2
  229. package/dist/types/run/run-result.d.ts +6 -3
  230. package/dist/types/run/run-state.d.ts +9 -1
  231. package/dist/types/run/run-status.d.ts +2 -2
  232. package/dist/types/run/try-cause.d.ts +8 -6
  233. package/dist/types/syntax/syntax-helpers.d.ts +5 -3
  234. package/package.json +5 -5
  235. package/skills/mootant/SKILL.md +14 -12
  236. package/skills/mootant/references/mutators.md +3 -1
  237. package/dist/core/instrument/get-site-check.d.ts +0 -9
  238. package/dist/core/instrument/get-site-check.js +0 -5
  239. package/dist/core/instrument/get-template-site-check.d.ts +0 -12
  240. package/dist/core/instrument/get-template-site-check.js +0 -5
  241. /package/dist/cli/{built-in-adapters.d.ts → get-built-in-adapters.d.ts} +0 -0
  242. /package/dist/cli/{built-in-adapters.js → get-built-in-adapters.js} +0 -0
  243. /package/dist/cli/terminal/{colors.d.ts → create-colors.d.ts} +0 -0
  244. /package/dist/cli/terminal/{colors.js → create-colors.js} +0 -0
@@ -10,16 +10,17 @@ import { getShiftedLiteral as c } from "./get-shifted-literal.js";
10
10
  import { getLeaveNowValue as l } from "./get-leave-now-value.js";
11
11
  import { getRootName as u } from "../../syntax/get-root-name.js";
12
12
  import { getRunningValue as d } from "./get-running-value.js";
13
- import { getLiteralValue as f } from "./get-literal-value.js";
14
- import { isFunction as p } from "../../syntax/is-function.js";
15
- import { isNumberLiteral as m } from "./is-number-literal.js";
16
- import { LEAVE_NOW_SKIP as h } from "./leave-now-skip.js";
17
- import { isNumericPair as g } from "./is-numeric-pair.js";
18
- import { getNumberText as _ } from "./get-number-text.js";
19
- import { hasOtherExit as v } from "./has-other-exit.js";
20
- import { walkTree as y } from "../../tree/walk-tree.js";
21
- import { getTypeView as b } from "./get-type-view.js";
22
- let x = /* @__PURE__ */ new Map([
13
+ import { getEndlessValue as f } from "./get-endless-value.js";
14
+ import { getLiteralValue as p } from "./get-literal-value.js";
15
+ import { isFunction as m } from "../../syntax/is-function.js";
16
+ import { isNumberLiteral as h } from "./is-number-literal.js";
17
+ import { LEAVE_NOW_SKIP as g } from "./leave-now-skip.js";
18
+ import { isNumericPair as _ } from "./is-numeric-pair.js";
19
+ import { getNumberText as v } from "./get-number-text.js";
20
+ import { hasOtherExit as y } from "./has-other-exit.js";
21
+ import { walkTree as b } from "../../tree/walk-tree.js";
22
+ import { getTypeView as x } from "./get-type-view.js";
23
+ let S = /* @__PURE__ */ new Map([
23
24
  ["<", [
24
25
  {
25
26
  region: "eq",
@@ -76,7 +77,7 @@ let x = /* @__PURE__ */ new Map([
76
77
  to: !0
77
78
  }
78
79
  ]]
79
- ]), S = [
80
+ ]), C = [
80
81
  {
81
82
  region: "lt",
82
83
  to: "<="
@@ -89,7 +90,7 @@ let x = /* @__PURE__ */ new Map([
89
90
  region: "eq",
90
91
  to: !1
91
92
  }
92
- ], C = [
93
+ ], w = [
93
94
  {
94
95
  region: "gt",
95
96
  to: "<"
@@ -102,18 +103,18 @@ let x = /* @__PURE__ */ new Map([
102
103
  region: "eq",
103
104
  to: !0
104
105
  }
105
- ], w = /* @__PURE__ */ new Map([
106
- ["!==", C],
107
- ["!=", C],
108
- ["===", S],
109
- ["==", S]
110
- ]), T = [{
106
+ ], T = /* @__PURE__ */ new Map([
107
+ ["!==", w],
108
+ ["!=", w],
109
+ ["===", C],
110
+ ["==", C]
111
+ ]), E = [{
111
112
  region: null,
112
113
  to: !0
113
114
  }, {
114
115
  region: null,
115
116
  to: !1
116
- }], E = /* @__PURE__ */ new Map([
117
+ }], D = /* @__PURE__ */ new Map([
117
118
  ["!==", ["lt", "gt"]],
118
119
  ["!=", ["lt", "gt"]],
119
120
  ["<=", ["lt", "eq"]],
@@ -122,22 +123,22 @@ let x = /* @__PURE__ */ new Map([
122
123
  ["==", ["eq"]],
123
124
  ["<", ["lt"]],
124
125
  [">", ["gt"]]
125
- ]), D = /* @__PURE__ */ new Set([
126
+ ]), O = /* @__PURE__ */ new Set([
126
127
  "boolean",
127
128
  "bigint",
128
129
  "number",
129
130
  "string"
130
- ]), O = /* @__PURE__ */ new Map([
131
+ ]), k = /* @__PURE__ */ new Map([
131
132
  ["lt", "gt"],
132
133
  ["eq", "eq"],
133
134
  ["gt", "lt"]
134
135
  ]);
135
- function k(e, t) {
136
- let { sourceCode: n, settings: r } = t, { operator: i } = e, a = W(e, t), o = B(e, t), c = F(e, t), l = L(c, 0), u = r.timeouts ? null : d(e, t), f = M(e, t, u), p = new Map([...f, ...s(e, t)]), m = A(e, t, u), h = P(e, t), g = {
136
+ function A(e, t) {
137
+ let { sourceCode: n, settings: r } = t, { operator: i } = e, a = G(e, t), o = V(e, t), c = I(e, t), l = R(c, 0), u = r.timeouts ? null : f(e, t), d = N(e, t, u), p = new Map([...d, ...s(e, t)]), m = j(e, t, u), h = F(e, t), g = {
137
138
  guard: c?.bound.guards?.has(e) ?? !1,
138
139
  operand: c,
139
140
  constantSkips: p,
140
- valueSkips: f
141
+ valueSkips: d
141
142
  }, _ = [], v = [], y = /* @__PURE__ */ new Map();
142
143
  function b(t, n) {
143
144
  v.push({
@@ -152,7 +153,7 @@ function k(e, t) {
152
153
  rule: "lower-bound"
153
154
  } : null;
154
155
  if (typeof r == "boolean") {
155
- let e = s ?? (o ? R(g, L(c, o.step), i) : p.get(r));
156
+ let e = s ?? (o ? z(g, R(c, o.step), i) : p.get(r));
156
157
  e ? (b(a, e), y.set(r, e)) : _.push({
157
158
  kind: o ? "shift" : "constant",
158
159
  value: r,
@@ -164,15 +165,15 @@ function k(e, t) {
164
165
  let u = s ?? m.get(r) ?? (h && t === "eq" ? {
165
166
  reason: "at equality both branches of the min/max ternary give the same value",
166
167
  rule: "min-max-idiom"
167
- } : null), d = u ? null : R(g, l, r);
168
- u ?? d ? (b(a, u ?? d), d && !y.has(K(l, r)) && y.set(K(l, r), d)) : _.push({
169
- value: E.get(r).includes(t),
168
+ } : null), d = u ? null : z(g, l, r);
169
+ u ?? d ? (b(a, u ?? d), d && !y.has(q(l, r)) && y.set(q(l, r), d)) : _.push({
170
+ value: D.get(r).includes(t),
170
171
  kind: "swap",
171
172
  region: t,
172
173
  text: a
173
174
  });
174
175
  }
175
- for (let e of [!0, !1]) !y.has(e) && a.every((t) => X(t) !== e || t.region !== null && l.has(t.region)) && y.set(e, {
176
+ for (let e of [!0, !1]) !y.has(e) && a.every((t) => Z(t) !== e || t.region !== null && l.has(t.region)) && y.set(e, {
176
177
  reason: `a lower bound of an operand makes every input where the comparison is not ${e} impossible (${c.bound.because})`,
177
178
  rule: "lower-bound"
178
179
  });
@@ -182,15 +183,15 @@ function k(e, t) {
182
183
  skipped: v
183
184
  };
184
185
  }
185
- function A(e, t, n) {
186
- let r = /* @__PURE__ */ new Map([[N(e, t, n), {
186
+ function j(e, t, n) {
187
+ let r = /* @__PURE__ */ new Map([[P(e, t), {
187
188
  reason: "the loop moves the counter one way, keeps the bound and has no other exit, so this form ends the loop at the same point",
188
189
  rule: "one-way-counter"
189
190
  }]]);
190
- if (n && r.set(n.value ? "!=" : "==", {
191
+ if (n !== null && r.set(n ? "!=" : "==", {
191
192
  reason: "a counter that steps over the bound may keep the loop running forever",
192
193
  rule: "loop-running"
193
- }), x.has(e.operator) && b(t.hints.getType(e.left)).type === "object" && b(t.hints.getType(e.right)).type === "object") {
194
+ }), S.has(e.operator) && x(t.hints.getType(e.left)).type === "object" && x(t.hints.getType(e.right)).type === "object") {
194
195
  let e = {
195
196
  reason: "both operands are objects, so it compares references instead of order",
196
197
  rule: "reference-equality"
@@ -199,29 +200,29 @@ function A(e, t, n) {
199
200
  }
200
201
  return r;
201
202
  }
202
- function j(e, t) {
203
+ function M(e, t) {
203
204
  let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = [
204
205
  e.test,
205
206
  e.type === "ForStatement" ? e.update : null,
206
207
  e.body
207
208
  ];
208
- for (let e of i) e && y(e, (e, i) => {
209
+ for (let e of i) e && b(e, (e, i) => {
209
210
  let a = null;
210
- if (e.type === "UpdateExpression" || e.type === "AssignmentExpression" ? a = H(e, t) : I(i, r) && V(e, t) && (a = "other"), a && n.add(a), e.type === "ObjectPattern") for (let t of e.properties) r.add(t);
211
- return !p(e);
211
+ if (e.type === "UpdateExpression" || e.type === "AssignmentExpression" ? a = U(e, t) : L(i, r) && H(e, t) && (a = "other"), a && n.add(a), e.type === "ObjectPattern") for (let t of e.properties) r.add(t);
212
+ return !m(e);
212
213
  });
213
214
  return n;
214
215
  }
215
- function M(n, r, a) {
216
+ function N(n, r, a) {
216
217
  let s = e(n, r), c = l(n, r), u = /* @__PURE__ */ new Map();
217
218
  for (let e of [!0, !1]) {
218
219
  let l = null;
219
220
  switch (e) {
220
- case a?.value:
221
- l = i(e);
222
- break;
223
221
  case c:
224
- l = h;
222
+ l = g;
223
+ break;
224
+ case a:
225
+ l = i(e);
225
226
  break;
226
227
  case s:
227
228
  l = {
@@ -235,26 +236,26 @@ function M(n, r, a) {
235
236
  }
236
237
  return u;
237
238
  }
238
- function N(e, t, n) {
239
- let r = n?.value ? ["!==", "!="] : ["===", "=="];
239
+ function P(e, t) {
240
+ let n = t.settings.timeouts ? null : d(e, t), r = n?.value ? ["!==", "!="] : ["===", "=="];
240
241
  if (!n || !r.includes(e.operator)) return null;
241
- let i = q(n.loop, e.left), a = i ?? q(n.loop, e.right);
242
- if (a === null || !z(n.loop, i ? e.right : e.left) || v(e, n, t)) return null;
242
+ let i = J(n.loop, e.left), a = i ?? J(n.loop, e.right);
243
+ if (a === null || !B(n.loop, i ? e.right : e.left) || y(e, n, t)) return null;
243
244
  let o = a === "up", s = i !== null;
244
245
  return n.value ? o === s ? "<" : ">" : o === s ? ">=" : "<=";
245
246
  }
246
- function P(e, t) {
247
+ function F(e, t) {
247
248
  let { parent: r, key: i } = t.syntax.getContextSlot(e);
248
- if (i !== "test" || r?.type !== "ConditionalExpression" || !x.has(e.operator) || !U(e.left) || !U(e.right)) return !1;
249
+ if (i !== "test" || r?.type !== "ConditionalExpression" || !S.has(e.operator) || !W(e.left) || !W(e.right)) return !1;
249
250
  let [a, o, s, c] = [
250
251
  e.left,
251
252
  e.right,
252
253
  r.consequent,
253
254
  r.alternate
254
255
  ].map((e) => t.sourceCode.getText(n(e)));
255
- return (a === s && o === c || a === c && o === s) && Y(e, t);
256
+ return (a === s && o === c || a === c && o === s) && X(e, t);
256
257
  }
257
- function F(e, t) {
258
+ function I(e, t) {
258
259
  let n = e.operator === "===" || e.operator === "!==";
259
260
  for (let [r, i, a] of [[
260
261
  e.left,
@@ -265,7 +266,7 @@ function F(e, t) {
265
266
  e.left,
266
267
  !0
267
268
  ]]) {
268
- let e = f(i), o = typeof e == "number" || typeof e == "bigint" && !n && Number.isSafeInteger(Number(e)) ? t.syntax.getValueBound(r) : null;
269
+ let e = p(i), o = typeof e == "number" || typeof e == "bigint" && !n && Number.isSafeInteger(Number(e)) ? t.syntax.getValueBound(r) : null;
269
270
  if (o && !o.nullable) return {
270
271
  limit: Number(e),
271
272
  mirrored: a,
@@ -274,7 +275,7 @@ function F(e, t) {
274
275
  }
275
276
  return null;
276
277
  }
277
- function I(e, t) {
278
+ function L(e, t) {
278
279
  let { parent: n, key: r } = e;
279
280
  switch (n?.type) {
280
281
  case "VariableDeclarator": return r === "id";
@@ -288,16 +289,16 @@ function I(e, t) {
288
289
  default: return !1;
289
290
  }
290
291
  }
291
- function L(e, t) {
292
+ function R(e, t) {
292
293
  let n = /* @__PURE__ */ new Set();
293
294
  if (!e) return n;
294
295
  let r = e.limit + t, i = [];
295
296
  r <= e.bound.lower && i.push("lt"), r < e.bound.lower && i.push("eq");
296
- for (let t of i) n.add(e.mirrored ? O.get(t) : t);
297
+ for (let t of i) n.add(e.mirrored ? k.get(t) : t);
297
298
  return n;
298
299
  }
299
- function R(e, t, n) {
300
- let r = K(t, n);
300
+ function z(e, t, n) {
301
+ let r = q(t, n);
301
302
  if (r === null || e.guard || !e.valueSkips.has(r)) return null;
302
303
  let i = e.constantSkips.get(r);
303
304
  return {
@@ -306,21 +307,21 @@ function R(e, t, n) {
306
307
  heuristic: !0
307
308
  };
308
309
  }
309
- function z(e, t) {
310
+ function B(e, t) {
310
311
  let n = r(t);
311
312
  for (; n.type === "UnaryExpression";) n = r(n.argument);
312
313
  let i = a(n);
313
- if (i) return j(e, i).size === 0;
314
+ if (i) return M(e, i).size === 0;
314
315
  switch (n.type) {
315
- case "BinaryExpression": return z(e, n.left) && z(e, n.right);
316
+ case "BinaryExpression": return B(e, n.left) && B(e, n.right);
316
317
  case "Literal": return !0;
317
318
  default: return !1;
318
319
  }
319
320
  }
320
- function B(e, t) {
321
+ function V(e, t) {
321
322
  let n = c(e);
322
323
  if (!n) return null;
323
- let { literal: r, step: i } = n, a = _(r, i);
324
+ let { literal: r, step: i } = n, a = v(r, i);
324
325
  return a === null ? null : {
325
326
  text: t.sourceCode.editText(e, [{
326
327
  start: r.start,
@@ -330,54 +331,54 @@ function B(e, t) {
330
331
  step: i
331
332
  };
332
333
  }
333
- function V(e, t) {
334
+ function H(e, t) {
334
335
  let n = a(e);
335
- return n === null ? u(e) === t[0] ? "other" : null : n.length > t.length || n.some((e, n) => e !== t[n]) ? G(n, t) ? "other" : null : n.length < t.length ? "other" : "same";
336
+ return n === null ? u(e) === t[0] ? "other" : null : n.length > t.length || n.some((e, n) => e !== t[n]) ? K(n, t) ? "other" : null : n.length < t.length ? "other" : "same";
336
337
  }
337
- function H(e, t) {
338
- let n = V(e.type === "UpdateExpression" ? e.argument : e.left, t);
339
- return n === "same" ? e.type === "UpdateExpression" ? e.operator === "++" ? "up" : "down" : J(e.operator, e.right) : n;
338
+ function U(e, t) {
339
+ let n = H(e.type === "UpdateExpression" ? e.argument : e.left, t);
340
+ return n === "same" ? e.type === "UpdateExpression" ? e.operator === "++" ? "up" : "down" : Y(e.operator, e.right) : n;
340
341
  }
341
- function U(e) {
342
+ function W(e) {
342
343
  let t = n(e);
343
344
  switch (t.type) {
344
- case "MemberExpression": return !t.computed && U(t.object);
345
- case "UnaryExpression": return m(t);
345
+ case "MemberExpression": return !t.computed && W(t.object);
346
+ case "UnaryExpression": return h(t);
346
347
  case "ThisExpression":
347
348
  case "Identifier":
348
349
  case "Literal": return !0;
349
350
  default: return !1;
350
351
  }
351
352
  }
352
- function W(e, t) {
353
- let n = w.get(e.operator);
354
- return n && g(t.hints.getType(e.left), t.hints.getType(e.right)) ? n : x.get(e.operator) ?? T;
355
- }
356
353
  function G(e, t) {
354
+ let n = T.get(e.operator);
355
+ return n && _(t.hints.getType(e.left), t.hints.getType(e.right)) ? n : S.get(e.operator) ?? E;
356
+ }
357
+ function K(e, t) {
357
358
  let n = e.slice(0, -1);
358
359
  return n.length === 0 || t.length <= n.length || n.some((e, n) => e !== t[n]) ? !1 : e.at(-1) === "length" || t.length === e.length && t.at(-1) === "length";
359
360
  }
360
- function K(e, t) {
361
+ function q(e, t) {
361
362
  let n = new Set([
362
363
  "lt",
363
364
  "eq",
364
365
  "gt"
365
- ].filter((t) => !e.has(t)).map((e) => E.get(t).includes(e))), [r] = n;
366
+ ].filter((t) => !e.has(t)).map((e) => D.get(t).includes(e))), [r] = n;
366
367
  return n.size === 1 ? r : null;
367
368
  }
368
- function q(e, t) {
369
- let n = a(t), r = n ? j(e, n) : /* @__PURE__ */ new Set(), [i] = r;
369
+ function J(e, t) {
370
+ let n = a(t), r = n ? M(e, n) : /* @__PURE__ */ new Set(), [i] = r;
370
371
  return r.size === 1 && (i === "up" || i === "down") ? i : null;
371
372
  }
372
- function J(e, t) {
373
- let n = f(r(t));
373
+ function Y(e, t) {
374
+ let n = p(r(t));
374
375
  return typeof n != "number" || n <= 0 ? "other" : e === "+=" ? "up" : e === "-=" ? "down" : "other";
375
376
  }
376
- function Y(e, t) {
377
- let [n, r] = [e.left, e.right].map((e) => b(t.hints.getType(e)).type);
378
- return n === r && D.has(n);
377
+ function X(e, t) {
378
+ let [n, r] = [e.left, e.right].map((e) => x(t.hints.getType(e)).type);
379
+ return n === r && O.has(n);
379
380
  }
380
- function X(e) {
381
- return typeof e.to == "boolean" ? e.to : E.get(e.to).includes(e.region);
381
+ function Z(e) {
382
+ return typeof e.to == "boolean" ? e.to : D.get(e.to).includes(e.region);
382
383
  }
383
- export { k as getComparisonPlan };
384
+ export { A as getComparisonPlan };
@@ -23,14 +23,14 @@ export interface ConditionConstants {
23
23
  * other mutators own. A comparison keeps a constant only when
24
24
  * comparison-operator neither emits it nor will run a mutant that subsumes it
25
25
  * (see `getComparisonConstantSkip`). `true` and `false` are then emitted except
26
- * the constant the types already give, the loop's running value, a constant
27
- * that a running directional mutant of a `??` test subsumes, the leave-now
28
- * constant of a first exit test, and a constant that makes a no-op callback.
29
- * The constants that are not emitted on such a node are returned with their
30
- * rule, and so are the constants of the top of a `!` chain that is an operand
31
- * of `&&` or `||` which logical-operator owns (O3); its other constants are not
32
- * candidates. The plan is pure: the redundancy and ownership rules read it
33
- * without running condition.
26
+ * the constant the types already give, a value that may keep the loop running
27
+ * forever (see `getEndlessValue`), a constant that a running directional mutant
28
+ * of a `??` test subsumes, the leave-now constant of a first exit test, and a
29
+ * constant that makes a no-op callback. The constants that are not emitted on
30
+ * such a node are returned with their rule, and so are the constants of the top
31
+ * of a `!` chain that is an operand of `&&` or `||` which logical-operator owns
32
+ * (O3); its other constants are not candidates. The plan is pure: the
33
+ * redundancy and ownership rules read it without running condition.
34
34
  *
35
35
  * @param node - Node of the runtime tree.
36
36
  * @param context - Mutator context with the test of mutants that will run.
@@ -9,7 +9,7 @@ import { getLiteralMutator as s } from "./get-literal-mutator.js";
9
9
  import { getOwnedConstants as c } from "./get-owned-constants.js";
10
10
  import { getLeaveNowValue as l } from "./get-leave-now-value.js";
11
11
  import { isAlwaysNullish as u } from "./is-always-nullish.js";
12
- import { getRunningValue as d } from "./get-running-value.js";
12
+ import { getEndlessValue as d } from "./get-endless-value.js";
13
13
  import { getLiteralValue as f } from "./get-literal-value.js";
14
14
  import { getLiteralSkip as p } from "./get-literal-skip.js";
15
15
  import { isAlwaysTruthy as m } from "./is-always-truthy.js";
@@ -83,9 +83,9 @@ function b(r, i) {
83
83
  node: r
84
84
  }, i)) ?? C(t, {
85
85
  noOp: () => e(r, t, i),
86
- running: k?.value,
87
86
  subsumed: A,
88
87
  leaveNow: j,
88
+ endless: k,
89
89
  fixed: O
90
90
  });
91
91
  n ? h.skipped.push({
@@ -138,7 +138,7 @@ function C(e, t) {
138
138
  reason: `the type hints make the condition always ${e}`,
139
139
  rule: "typed-constant"
140
140
  };
141
- if (e === t.running) return i(e);
141
+ if (e === t.endless) return i(e);
142
142
  if (e === t.leaveNow) return h;
143
143
  let n = t.subsumed.find((t) => t.value === e);
144
144
  return n ? {
@@ -0,0 +1,20 @@
1
+ import { Node } from 'oxc-parser';
2
+ import { MutatorContext } from '../../../types/mutator/mutator-context.js';
3
+ /**
4
+ * Finds the value of a node that may keep its loop running forever (catalog
5
+ * 2.2, TIMEOUT). In a loop test that is its running value (see
6
+ * `getRunningValue`), whatever else can end the loop. In an exit test it is its
7
+ * running value only while one of the loops that the test's `if` leaves (see
8
+ * `getExitedLoops`) has no other way out: no operand next to the node can end
9
+ * the loop on its own, as `b` can in `if (a || b) break`, and no `break`,
10
+ * `continue`, `return` or `throw` of the loop's update or body leaves it (see
11
+ * `isLoopExit`), apart from the consequent of the `if`, nested functions and
12
+ * values of instance fields, which run only when the class is instantiated.
13
+ * Calls, `await` and `yield` do not count: nearly every loop has them, and they
14
+ * rarely end it.
15
+ *
16
+ * @param node - Node of the runtime tree.
17
+ * @param context - Mutator context of the file.
18
+ * @returns The value that may keep the loop running forever, or null.
19
+ */
20
+ export declare function getEndlessValue(node: Node, context: MutatorContext): boolean | null;
@@ -0,0 +1,25 @@
1
+ import { getRunningValue as e } from "./get-running-value.js";
2
+ import { isFunction as t } from "../../syntax/is-function.js";
3
+ import { walkTree as n } from "../../tree/walk-tree.js";
4
+ import { isLoopExit as r } from "./is-loop-exit.js";
5
+ import { isNegation as i } from "./is-negation.js";
6
+ import { isAndOr as a } from "./is-and-or.js";
7
+ function o(t, n) {
8
+ let r = e(t, n);
9
+ if (!r) return null;
10
+ let { value: o } = r, c = !1, { parent: l, key: u } = n.syntax.getContextSlot(t);
11
+ for (; u !== "test";) i(l) ? o = !o : a(l) && l.operator === "&&" === o && (c = !0), {parent: l, key: u} = n.syntax.getContextSlot(l);
12
+ if (l?.type !== "IfStatement") return r.value;
13
+ let d = l;
14
+ return !c && n.syntax.getExitedLoops(d).some((e) => !s(e, d, n)) ? r.value : null;
15
+ }
16
+ function s(e, i, a) {
17
+ return [e.type === "ForStatement" ? e.update : null, e.body].some((o) => {
18
+ let s = !1;
19
+ return o && n(o, (n, o) => s || n === i.consequent || t(n) || c(o) || !a.syntax.isRuntimeNode(n) ? !1 : (s = r(n, e, a), !s)), s;
20
+ });
21
+ }
22
+ function c({ parent: e, key: t }) {
23
+ return t === "value" && (e?.type === "PropertyDefinition" || e?.type === "AccessorProperty") && !e.static;
24
+ }
25
+ export { o as getEndlessValue };
@@ -0,0 +1,44 @@
1
+ import { MutantSite, RunContext } from './create-run-context.js';
2
+ import { DirectionQuery } from './has-polar-mutant.js';
3
+ /**
4
+ * Mutant that makes a candidate redundant, with what its skip rests on.
5
+ */
6
+ interface ForcedTestJustifier {
7
+ /**
8
+ * Whether the skip rests on the guess that the calls of the decision only
9
+ * read values.
10
+ */
11
+ heuristic: boolean;
12
+ /**
13
+ * Whether the mutant is the constant of the decision's owner (O19) rather
14
+ * than a mutant that moves the decision toward the value (R4, R5).
15
+ */
16
+ owned: boolean;
17
+ /**
18
+ * The mutant.
19
+ */
20
+ by: MutantSite;
21
+ }
22
+ /**
23
+ * Finds the mutant that makes redundant a candidate that acts like a decision
24
+ * forced to a truth value while the decision still runs, such as the removal of
25
+ * a then-branch or a copy of the other branch (catalog 5.2 O19, 5.3 R4 and R5).
26
+ * The constant of the decision's owner (see `getOwnerConstant`) skips every
27
+ * effect of the decision, so it counts only for a decision without effects (see
28
+ * `isEffectFree`). Otherwise a mutant that will run and moves the decision
29
+ * toward the value counts when it evaluates every part of the decision with an
30
+ * effect as the decision does (see `getTowardMutant`). A decision whose only
31
+ * effects are calls of well-known read-only methods (see `isReadOnly`) counts
32
+ * as one without effects too: the owner's constant then rests on that guess,
33
+ * and so does a mutant that moves the decision unless it evaluates every such
34
+ * call as the decision does.
35
+ *
36
+ * @param query - Candidate, decision and forced value.
37
+ * @param context - Mutator context with the test of mutants that will run.
38
+ * @param ownable - Whether the owner's constant may make the candidate
39
+ * redundant.
40
+ * @returns The mutant, whether it is the owner's constant and whether the skip
41
+ * rests on the guess, or null when the candidate is emitted.
42
+ */
43
+ export declare function getForcedTestJustifier(query: DirectionQuery, context: RunContext, ownable: boolean): ForcedTestJustifier | null;
44
+ export {};
@@ -0,0 +1,25 @@
1
+ import { isEffectFree as e } from "../../syntax/is-effect-free.js";
2
+ import { getOwnerConstant as t } from "./get-owner-constant.js";
3
+ import { getTowardMutant as n } from "./get-toward-mutant.js";
4
+ import { isReadOnly as r } from "./is-read-only.js";
5
+ function i(i, a, o) {
6
+ let { decision: s, value: c } = i, l = e(s), u = !l && r(s, a), d = o && (l || u) ? t(s, c, a) : null;
7
+ if (d) return {
8
+ heuristic: u,
9
+ owned: !0,
10
+ by: d
11
+ };
12
+ let f = n(i, a, !0);
13
+ if (f) return {
14
+ heuristic: !1,
15
+ owned: !1,
16
+ by: f
17
+ };
18
+ let p = u ? n(i, a) : null;
19
+ return p && {
20
+ heuristic: !0,
21
+ owned: !1,
22
+ by: p
23
+ };
24
+ }
25
+ export { i as getForcedTestJustifier };
@@ -20,10 +20,10 @@ export interface GroupConstant {
20
20
  * root that is not an operand, through `!`, of another `&&` or `||`, unless a
21
21
  * running mutant inside the group moves it only toward that constant. In
22
22
  * boolean mode the constant is also skipped when fixed operands already give
23
- * it, when it is the loop's running value or a first exit test's leave-now
24
- * constant; in value mode the group must be constant-eligible. In both modes
25
- * the constant is skipped when it makes a no-op callback. A skipped constant
26
- * comes with its rule.
23
+ * it, when it may keep the loop running forever (see `getEndlessValue`) or when
24
+ * it is a first exit test's leave-now constant; in value mode the group must be
25
+ * constant-eligible. In both modes the constant is skipped when it makes a
26
+ * no-op callback. A skipped constant comes with its rule.
27
27
  *
28
28
  * @param node - `&&` or `||` expression of the runtime tree.
29
29
  * @param context - Mutator context with the test of mutants that will run.
@@ -4,7 +4,7 @@ import { getLoopRunningSkip as n } from "./get-loop-running-skip.js";
4
4
  import { NO_OP_CALLBACK_SKIP as r } from "./no-op-callback-skip.js";
5
5
  import { getLeaveNowValue as i } from "./get-leave-now-value.js";
6
6
  import { isBooleanValued as a } from "./is-boolean-valued.js";
7
- import { getRunningValue as o } from "./get-running-value.js";
7
+ import { getEndlessValue as o } from "./get-endless-value.js";
8
8
  import { hasPolarMutant as s } from "./has-polar-mutant.js";
9
9
  import { getNegationTop as c } from "./get-negation-top.js";
10
10
  import { LEAVE_NOW_SKIP as l } from "./leave-now-skip.js";
@@ -28,7 +28,7 @@ function p(p, m) {
28
28
  if (d(p, m)) (m.syntax.isBooleanContext(p) || a(p, m)) && u(p, m) === g ? v = {
29
29
  reason: `the group is always ${g ? "truthy" : "falsy"}`,
30
30
  rule: "fixed-operand"
31
- } : !m.settings.timeouts && o(p, m)?.value === g ? v = n(g) : i(p, m) === g && (v = l);
31
+ } : !m.settings.timeouts && o(p, m) === g ? v = n(g) : i(p, m) === g && (v = l);
32
32
  else if (!e(p, m)) return {
33
33
  emitted: !1,
34
34
  skip: null
@@ -22,12 +22,12 @@ interface LiteralSkipQuery {
22
22
  * operand of a comparison (shifted-literal, O4; see `getComparisonOperandSkip`)
23
23
  * or of a boolean-mode `&&` or `||` (O3) or, whose change is invisible, of
24
24
  * `void` (EQ), a string is an error message (NOISE), a boolean or number change
25
- * gives a loop its running value unless the `timeouts` setting is on (TIMEOUT),
26
- * the change copies the other branch of a branch pair (O19, R5), makes a no-op
27
- * callback (O12) or empties a `||` default (O16, R7). A template with
28
- * expressions, which changes only its text, is checked against the first four
29
- * and the branch copy. The rules of the literal's own mutator are checked right
30
- * after the operand and error message rules.
25
+ * may keep a loop running forever (see `getEndlessValue`) unless the `timeouts`
26
+ * setting is on (TIMEOUT), the change copies the other branch of a branch pair
27
+ * (O19, R5), makes a no-op callback (O12) or empties a `||` default (O16, R7).
28
+ * A template with expressions, which changes only its text, is checked against
29
+ * the first four and the branch copy. The rules of the literal's own mutator
30
+ * are checked right after the operand and error message rules.
31
31
  *
32
32
  * @param node - Literal that a literal mutator would replace.
33
33
  * @param query - Change of the literal and the rules of its own mutator.
@@ -6,7 +6,7 @@ import { getBranchCopySkip as i } from "./get-branch-copy-skip.js";
6
6
  import { getLiteralMutator as a } from "./get-literal-mutator.js";
7
7
  import { getShiftedLiteral as o } from "./get-shifted-literal.js";
8
8
  import { getOrDefaultSkip as s } from "./get-or-default-skip.js";
9
- import { getRunningValue as c } from "./get-running-value.js";
9
+ import { getEndlessValue as c } from "./get-endless-value.js";
10
10
  import { getNegationTop as l } from "./get-negation-top.js";
11
11
  import { isVoidOperand as u } from "./is-void-operand.js";
12
12
  function d(o, l, d) {
@@ -32,7 +32,7 @@ function d(o, l, d) {
32
32
  if (v) return v;
33
33
  if (!("value" in h)) return i(o, h, d);
34
34
  let { value: y } = h;
35
- return g !== "string-literal" && !d.settings.timeouts && c(o, d)?.value === !!y ? {
35
+ return g !== "string-literal" && !d.settings.timeouts && c(o, d) === !!y ? {
36
36
  reason: "the new value may keep the loop running forever",
37
37
  rule: "loop-running"
38
38
  } : i(o, h, d) || (e(o, y, d) ? r : s(o, y, d));
@@ -28,14 +28,14 @@ export interface LogicalDrops {
28
28
  /**
29
29
  * Decides the drops of a `&&` or `||` (catalog 4.8, emissions 1 and 2): each
30
30
  * operand is dropped unless it is a same-operator group, the drop is equivalent
31
- * by the types or by fixed operands, or the polarity rule finds a running
32
- * mutant that subsumes it. In value mode a `||` whose left side may be nullish
33
- * gets the nullish swap instead of the drop of its right operand when `??` and
34
- * `||` differ, which they never do, under every `nullishSwap` mode, when the
35
- * left side is never falsy unless nullish (see `getNeverFalsyFact`). Drops and
36
- * swaps that are not emitted are returned with their rule. The plan is pure:
37
- * the polarity rule of other mutators reads it without running
38
- * logical-operator.
31
+ * by the types (see `getCanonicalFalsyDefault`) or by fixed operands, or the
32
+ * polarity rule finds a running mutant that subsumes it. In value mode a `||`
33
+ * whose left side may be nullish gets the nullish swap instead of the drop of
34
+ * its right operand when `??` and `||` differ, which they never do, under every
35
+ * `nullishSwap` mode, when the left side is never falsy unless nullish (see
36
+ * `getNeverFalsyFact`). Drops and swaps that are not emitted are returned with
37
+ * their rule. The plan is pure: the polarity rule of other mutators reads it
38
+ * without running logical-operator.
39
39
  *
40
40
  * @param node - `&&` or `||` expression of the runtime tree.
41
41
  * @param context - Mutator context with the test of mutants that will run.