eslint 6.5.1 → 6.6.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.
- package/CHANGELOG.md +54 -0
- package/README.md +4 -3
- package/lib/cli-engine/cascading-config-array-factory.js +2 -1
- package/lib/cli-engine/cli-engine.js +9 -7
- package/lib/cli-engine/config-array/config-array.js +0 -4
- package/lib/cli-engine/config-array/config-dependency.js +2 -0
- package/lib/cli-engine/config-array/override-tester.js +2 -0
- package/lib/cli-engine/config-array-factory.js +7 -1
- package/lib/cli-engine/file-enumerator.js +5 -3
- package/lib/cli-engine/formatters/html.js +1 -0
- package/lib/cli-engine/ignored-paths.js +1 -0
- package/lib/init/autoconfig.js +1 -11
- package/lib/init/config-file.js +0 -1
- package/lib/init/config-initializer.js +0 -1
- package/lib/init/config-rule.js +1 -5
- package/lib/init/npm-utils.js +0 -5
- package/lib/linter/code-path-analysis/code-path-analyzer.js +24 -38
- package/lib/linter/code-path-analysis/code-path-segment.js +17 -25
- package/lib/linter/code-path-analysis/code-path-state.js +40 -81
- package/lib/linter/code-path-analysis/code-path.js +10 -11
- package/lib/linter/code-path-analysis/debug-helpers.js +8 -12
- package/lib/linter/code-path-analysis/fork-context.js +23 -34
- package/lib/linter/code-path-analysis/id-generator.js +2 -2
- package/lib/linter/linter.js +121 -95
- package/lib/linter/node-event-generator.js +3 -2
- package/lib/rule-tester/rule-tester.js +6 -8
- package/lib/rules/accessor-pairs.js +8 -8
- package/lib/rules/array-bracket-newline.js +12 -15
- package/lib/rules/array-bracket-spacing.js +12 -12
- package/lib/rules/array-callback-return.js +6 -11
- package/lib/rules/array-element-newline.js +5 -8
- package/lib/rules/arrow-parens.js +0 -1
- package/lib/rules/block-scoped-var.js +3 -3
- package/lib/rules/block-spacing.js +4 -4
- package/lib/rules/capitalized-comments.js +0 -7
- package/lib/rules/class-methods-use-this.js +3 -3
- package/lib/rules/comma-dangle.js +15 -23
- package/lib/rules/comma-spacing.js +1 -1
- package/lib/rules/computed-property-spacing.js +10 -10
- package/lib/rules/consistent-return.js +4 -5
- package/lib/rules/consistent-this.js +5 -5
- package/lib/rules/constructor-super.js +14 -16
- package/lib/rules/curly.js +3 -5
- package/lib/rules/default-param-last.js +1 -0
- package/lib/rules/dot-location.js +11 -12
- package/lib/rules/func-names.js +6 -6
- package/lib/rules/function-call-argument-newline.js +5 -5
- package/lib/rules/generator-star-spacing.js +4 -9
- package/lib/rules/getter-return.js +4 -7
- package/lib/rules/indent.js +2 -2
- package/lib/rules/init-declarations.js +2 -2
- package/lib/rules/jsx-quotes.js +1 -1
- package/lib/rules/keyword-spacing.js +32 -56
- package/lib/rules/lines-around-directive.js +1 -1
- package/lib/rules/max-len.js +0 -5
- package/lib/rules/max-statements-per-line.js +3 -7
- package/lib/rules/multiline-ternary.js +3 -3
- package/lib/rules/newline-after-var.js +6 -7
- package/lib/rules/newline-before-return.js +8 -9
- package/lib/rules/newline-per-chained-call.js +2 -4
- package/lib/rules/no-class-assign.js +2 -2
- package/lib/rules/no-compare-neg-zero.js +1 -2
- package/lib/rules/no-confusing-arrow.js +2 -2
- package/lib/rules/no-console.js +4 -8
- package/lib/rules/no-const-assign.js +1 -1
- package/lib/rules/no-dupe-args.js +1 -1
- package/lib/rules/no-dupe-class-members.js +3 -4
- package/lib/rules/no-dupe-keys.js +6 -5
- package/lib/rules/no-duplicate-imports.js +14 -18
- package/lib/rules/no-else-return.js +0 -8
- package/lib/rules/no-empty-function.js +2 -4
- package/lib/rules/no-eval.js +10 -18
- package/lib/rules/no-ex-assign.js +1 -1
- package/lib/rules/no-extra-bind.js +5 -12
- package/lib/rules/no-extra-boolean-cast.js +0 -2
- package/lib/rules/no-extra-label.js +4 -9
- package/lib/rules/no-extra-parens.js +17 -15
- package/lib/rules/no-extra-semi.js +5 -6
- package/lib/rules/no-fallthrough.js +6 -6
- package/lib/rules/no-func-assign.js +3 -3
- package/lib/rules/no-global-assign.js +4 -4
- package/lib/rules/no-implicit-coercion.js +10 -10
- package/lib/rules/no-implied-eval.js +0 -1
- package/lib/rules/no-invalid-this.js +1 -3
- package/lib/rules/no-labels.js +3 -6
- package/lib/rules/no-lone-blocks.js +1 -1
- package/lib/rules/no-loop-func.js +6 -11
- package/lib/rules/no-magic-numbers.js +6 -6
- package/lib/rules/no-misleading-character-class.js +14 -7
- package/lib/rules/no-mixed-operators.js +13 -22
- package/lib/rules/no-mixed-requires.js +0 -1
- package/lib/rules/no-multi-spaces.js +1 -1
- package/lib/rules/no-native-reassign.js +4 -4
- package/lib/rules/no-param-reassign.js +28 -7
- package/lib/rules/no-redeclare.js +1 -1
- package/lib/rules/no-regex-spaces.js +0 -1
- package/lib/rules/no-restricted-imports.js +11 -11
- package/lib/rules/no-self-assign.js +12 -13
- package/lib/rules/no-sequences.js +3 -3
- package/lib/rules/no-shadow.js +1 -4
- package/lib/rules/no-tabs.js +8 -2
- package/lib/rules/no-this-before-super.js +12 -13
- package/lib/rules/no-trailing-spaces.js +19 -7
- package/lib/rules/no-unmodified-loop-condition.js +16 -29
- package/lib/rules/no-unneeded-ternary.js +3 -3
- package/lib/rules/no-unreachable.js +7 -7
- package/lib/rules/no-unsafe-finally.js +4 -7
- package/lib/rules/no-unsafe-negation.js +32 -9
- package/lib/rules/no-unused-expressions.js +11 -7
- package/lib/rules/no-unused-labels.js +3 -6
- package/lib/rules/no-unused-vars.js +22 -29
- package/lib/rules/no-use-before-define.js +10 -15
- package/lib/rules/no-useless-call.js +4 -4
- package/lib/rules/no-useless-concat.js +4 -4
- package/lib/rules/no-useless-constructor.js +14 -22
- package/lib/rules/no-useless-escape.js +3 -5
- package/lib/rules/no-useless-rename.js +7 -7
- package/lib/rules/no-useless-return.js +8 -15
- package/lib/rules/no-var.js +12 -25
- package/lib/rules/no-warning-comments.js +0 -1
- package/lib/rules/no-whitespace-before-property.js +3 -3
- package/lib/rules/object-curly-newline.js +7 -10
- package/lib/rules/object-curly-spacing.js +13 -14
- package/lib/rules/object-shorthand.js +1 -1
- package/lib/rules/one-var-declaration-per-line.js +2 -2
- package/lib/rules/operator-assignment.js +22 -1
- package/lib/rules/padded-blocks.js +1 -1
- package/lib/rules/padding-line-between-statements.js +0 -16
- package/lib/rules/prefer-arrow-callback.js +6 -6
- package/lib/rules/prefer-const.js +13 -21
- package/lib/rules/prefer-destructuring.js +1 -7
- package/lib/rules/prefer-named-capture-group.js +0 -1
- package/lib/rules/prefer-numeric-literals.js +32 -4
- package/lib/rules/prefer-object-spread.js +7 -7
- package/lib/rules/prefer-rest-params.js +3 -6
- package/lib/rules/prefer-spread.js +4 -4
- package/lib/rules/prefer-template.js +5 -6
- package/lib/rules/quote-props.js +1 -1
- package/lib/rules/quotes.js +5 -6
- package/lib/rules/radix.js +5 -10
- package/lib/rules/require-await.js +2 -5
- package/lib/rules/require-yield.js +2 -2
- package/lib/rules/rest-spread-spacing.js +1 -1
- package/lib/rules/sort-imports.js +3 -4
- package/lib/rules/sort-keys.js +1 -3
- package/lib/rules/space-before-blocks.js +1 -2
- package/lib/rules/space-in-parens.js +4 -4
- package/lib/rules/space-infix-ops.js +5 -5
- package/lib/rules/spaced-comment.js +15 -18
- package/lib/rules/strict.js +2 -4
- package/lib/rules/symbol-description.js +1 -2
- package/lib/rules/template-curly-spacing.js +2 -2
- package/lib/rules/use-isnan.js +40 -3
- package/lib/rules/utils/ast-utils.js +53 -81
- package/lib/rules/utils/fix-tracker.js +0 -6
- package/lib/rules/utils/lazy-loading-rule-map.js +0 -1
- package/lib/rules/vars-on-top.js +11 -11
- package/lib/shared/config-ops.js +2 -2
- package/lib/shared/runtime-info.js +8 -8
- package/lib/shared/traverser.js +2 -0
- package/lib/source-code/source-code.js +8 -8
- package/lib/source-code/token-store/backward-token-comment-cursor.js +5 -5
- package/lib/source-code/token-store/backward-token-cursor.js +5 -5
- package/lib/source-code/token-store/cursors.js +17 -19
- package/lib/source-code/token-store/decorative-cursor.js +1 -1
- package/lib/source-code/token-store/filter-cursor.js +2 -2
- package/lib/source-code/token-store/forward-token-comment-cursor.js +5 -5
- package/lib/source-code/token-store/forward-token-cursor.js +5 -5
- package/lib/source-code/token-store/index.js +86 -92
- package/lib/source-code/token-store/limit-cursor.js +2 -2
- package/lib/source-code/token-store/padded-token-cursor.js +7 -7
- package/lib/source-code/token-store/skip-cursor.js +2 -2
- package/lib/source-code/token-store/utils.js +9 -13
- package/package.json +6 -5
@@ -22,8 +22,7 @@ const assert = require("assert"),
|
|
22
22
|
|
23
23
|
/**
|
24
24
|
* Checks whether or not a given node is a `case` node (not `default` node).
|
25
|
-
*
|
26
|
-
* @param {ASTNode} node - A `SwitchCase` node to check.
|
25
|
+
* @param {ASTNode} node A `SwitchCase` node to check.
|
27
26
|
* @returns {boolean} `true` if the node is a `case` node (not `default` node).
|
28
27
|
*/
|
29
28
|
function isCaseNode(node) {
|
@@ -33,8 +32,7 @@ function isCaseNode(node) {
|
|
33
32
|
/**
|
34
33
|
* Checks whether the given logical operator is taken into account for the code
|
35
34
|
* path analysis.
|
36
|
-
*
|
37
|
-
* @param {string} operator - The operator found in the LogicalExpression node
|
35
|
+
* @param {string} operator The operator found in the LogicalExpression node
|
38
36
|
* @returns {boolean} `true` if the operator is "&&" or "||"
|
39
37
|
*/
|
40
38
|
function isHandledLogicalOperator(operator) {
|
@@ -43,8 +41,7 @@ function isHandledLogicalOperator(operator) {
|
|
43
41
|
|
44
42
|
/**
|
45
43
|
* Gets the label if the parent node of a given node is a LabeledStatement.
|
46
|
-
*
|
47
|
-
* @param {ASTNode} node - A node to get.
|
44
|
+
* @param {ASTNode} node A node to get.
|
48
45
|
* @returns {string|null} The label or `null`.
|
49
46
|
*/
|
50
47
|
function getLabel(node) {
|
@@ -57,8 +54,7 @@ function getLabel(node) {
|
|
57
54
|
/**
|
58
55
|
* Checks whether or not a given logical expression node goes different path
|
59
56
|
* between the `true` case and the `false` case.
|
60
|
-
*
|
61
|
-
* @param {ASTNode} node - A node to check.
|
57
|
+
* @param {ASTNode} node A node to check.
|
62
58
|
* @returns {boolean} `true` if the node is a test of a choice statement.
|
63
59
|
*/
|
64
60
|
function isForkingByTrueOrFalse(node) {
|
@@ -86,8 +82,7 @@ function isForkingByTrueOrFalse(node) {
|
|
86
82
|
* This is used to detect infinity loops (e.g. `while (true) {}`).
|
87
83
|
* Statements preceded by an infinity loop are unreachable if the loop didn't
|
88
84
|
* have any `break` statement.
|
89
|
-
*
|
90
|
-
* @param {ASTNode} node - A node to get.
|
85
|
+
* @param {ASTNode} node A node to get.
|
91
86
|
* @returns {boolean|undefined} a boolean value if the node is a Literal node,
|
92
87
|
* otherwise `undefined`.
|
93
88
|
*/
|
@@ -102,8 +97,7 @@ function getBooleanValueIfSimpleConstant(node) {
|
|
102
97
|
* Checks that a given identifier node is a reference or not.
|
103
98
|
*
|
104
99
|
* This is used to detect the first throwable node in a `try` block.
|
105
|
-
*
|
106
|
-
* @param {ASTNode} node - An Identifier node to check.
|
100
|
+
* @param {ASTNode} node An Identifier node to check.
|
107
101
|
* @returns {boolean} `true` if the node is a reference.
|
108
102
|
*/
|
109
103
|
function isIdentifierReference(node) {
|
@@ -153,9 +147,8 @@ function isIdentifierReference(node) {
|
|
153
147
|
*
|
154
148
|
* In this process, both "onCodePathSegmentStart" and "onCodePathSegmentEnd"
|
155
149
|
* events are fired.
|
156
|
-
*
|
157
|
-
* @param {
|
158
|
-
* @param {ASTNode} node - The current AST node.
|
150
|
+
* @param {CodePathAnalyzer} analyzer The instance.
|
151
|
+
* @param {ASTNode} node The current AST node.
|
159
152
|
* @returns {void}
|
160
153
|
*/
|
161
154
|
function forwardCurrentToHead(analyzer, node) {
|
@@ -211,9 +204,8 @@ function forwardCurrentToHead(analyzer, node) {
|
|
211
204
|
/**
|
212
205
|
* Updates the current segment with empty.
|
213
206
|
* This is called at the last of functions or the program.
|
214
|
-
*
|
215
|
-
* @param {
|
216
|
-
* @param {ASTNode} node - The current AST node.
|
207
|
+
* @param {CodePathAnalyzer} analyzer The instance.
|
208
|
+
* @param {ASTNode} node The current AST node.
|
217
209
|
* @returns {void}
|
218
210
|
*/
|
219
211
|
function leaveFromCurrentSegment(analyzer, node) {
|
@@ -242,9 +234,8 @@ function leaveFromCurrentSegment(analyzer, node) {
|
|
242
234
|
*
|
243
235
|
* For example, if the node is `parent.consequent`, this creates a fork from the
|
244
236
|
* current path.
|
245
|
-
*
|
246
|
-
* @param {
|
247
|
-
* @param {ASTNode} node - The current AST node.
|
237
|
+
* @param {CodePathAnalyzer} analyzer The instance.
|
238
|
+
* @param {ASTNode} node The current AST node.
|
248
239
|
* @returns {void}
|
249
240
|
*/
|
250
241
|
function preprocess(analyzer, node) {
|
@@ -352,9 +343,8 @@ function preprocess(analyzer, node) {
|
|
352
343
|
|
353
344
|
/**
|
354
345
|
* Updates the code path due to the type of a given node in entering.
|
355
|
-
*
|
356
|
-
* @param {
|
357
|
-
* @param {ASTNode} node - The current AST node.
|
346
|
+
* @param {CodePathAnalyzer} analyzer The instance.
|
347
|
+
* @param {ASTNode} node The current AST node.
|
358
348
|
* @returns {void}
|
359
349
|
*/
|
360
350
|
function processCodePathToEnter(analyzer, node) {
|
@@ -449,9 +439,8 @@ function processCodePathToEnter(analyzer, node) {
|
|
449
439
|
|
450
440
|
/**
|
451
441
|
* Updates the code path due to the type of a given node in leaving.
|
452
|
-
*
|
453
|
-
* @param {
|
454
|
-
* @param {ASTNode} node - The current AST node.
|
442
|
+
* @param {CodePathAnalyzer} analyzer The instance.
|
443
|
+
* @param {ASTNode} node The current AST node.
|
455
444
|
* @returns {void}
|
456
445
|
*/
|
457
446
|
function processCodePathToExit(analyzer, node) {
|
@@ -563,9 +552,8 @@ function processCodePathToExit(analyzer, node) {
|
|
563
552
|
|
564
553
|
/**
|
565
554
|
* Updates the code path to finalize the current code path.
|
566
|
-
*
|
567
|
-
* @param {
|
568
|
-
* @param {ASTNode} node - The current AST node.
|
555
|
+
* @param {CodePathAnalyzer} analyzer The instance.
|
556
|
+
* @param {ASTNode} node The current AST node.
|
569
557
|
* @returns {void}
|
570
558
|
*/
|
571
559
|
function postprocess(analyzer, node) {
|
@@ -609,8 +597,9 @@ function postprocess(analyzer, node) {
|
|
609
597
|
*/
|
610
598
|
class CodePathAnalyzer {
|
611
599
|
|
600
|
+
// eslint-disable-next-line jsdoc/require-description
|
612
601
|
/**
|
613
|
-
* @param {EventGenerator} eventGenerator
|
602
|
+
* @param {EventGenerator} eventGenerator An event generator to wrap.
|
614
603
|
*/
|
615
604
|
constructor(eventGenerator) {
|
616
605
|
this.original = eventGenerator;
|
@@ -624,8 +613,7 @@ class CodePathAnalyzer {
|
|
624
613
|
/**
|
625
614
|
* Does the process to enter a given AST node.
|
626
615
|
* This updates state of analysis and calls `enterNode` of the wrapped.
|
627
|
-
*
|
628
|
-
* @param {ASTNode} node - A node which is entering.
|
616
|
+
* @param {ASTNode} node A node which is entering.
|
629
617
|
* @returns {void}
|
630
618
|
*/
|
631
619
|
enterNode(node) {
|
@@ -651,8 +639,7 @@ class CodePathAnalyzer {
|
|
651
639
|
/**
|
652
640
|
* Does the process to leave a given AST node.
|
653
641
|
* This updates state of analysis and calls `leaveNode` of the wrapped.
|
654
|
-
*
|
655
|
-
* @param {ASTNode} node - A node which is leaving.
|
642
|
+
* @param {ASTNode} node A node which is leaving.
|
656
643
|
* @returns {void}
|
657
644
|
*/
|
658
645
|
leaveNode(node) {
|
@@ -676,9 +663,8 @@ class CodePathAnalyzer {
|
|
676
663
|
/**
|
677
664
|
* This is called on a code path looped.
|
678
665
|
* Then this raises a looped event.
|
679
|
-
*
|
680
|
-
* @param {CodePathSegment}
|
681
|
-
* @param {CodePathSegment} toSegment - A segment of next.
|
666
|
+
* @param {CodePathSegment} fromSegment A segment of prev.
|
667
|
+
* @param {CodePathSegment} toSegment A segment of next.
|
682
668
|
* @returns {void}
|
683
669
|
*/
|
684
670
|
onLooped(fromSegment, toSegment) {
|
@@ -17,8 +17,7 @@ const debug = require("./debug-helpers");
|
|
17
17
|
|
18
18
|
/**
|
19
19
|
* Checks whether or not a given segment is reachable.
|
20
|
-
*
|
21
|
-
* @param {CodePathSegment} segment - A segment to check.
|
20
|
+
* @param {CodePathSegment} segment A segment to check.
|
22
21
|
* @returns {boolean} `true` if the segment is reachable.
|
23
22
|
*/
|
24
23
|
function isReachable(segment) {
|
@@ -34,11 +33,12 @@ function isReachable(segment) {
|
|
34
33
|
*/
|
35
34
|
class CodePathSegment {
|
36
35
|
|
36
|
+
// eslint-disable-next-line jsdoc/require-description
|
37
37
|
/**
|
38
|
-
* @param {string} id
|
39
|
-
* @param {CodePathSegment[]} allPrevSegments
|
38
|
+
* @param {string} id An identifier.
|
39
|
+
* @param {CodePathSegment[]} allPrevSegments An array of the previous segments.
|
40
40
|
* This array includes unreachable segments.
|
41
|
-
* @param {boolean} reachable
|
41
|
+
* @param {boolean} reachable A flag which shows this is reachable.
|
42
42
|
*/
|
43
43
|
constructor(id, allPrevSegments, reachable) {
|
44
44
|
|
@@ -98,8 +98,7 @@ class CodePathSegment {
|
|
98
98
|
|
99
99
|
/**
|
100
100
|
* Checks a given previous segment is coming from the end of a loop.
|
101
|
-
*
|
102
|
-
* @param {CodePathSegment} segment - A previous segment to check.
|
101
|
+
* @param {CodePathSegment} segment A previous segment to check.
|
103
102
|
* @returns {boolean} `true` if the segment is coming from the end of a loop.
|
104
103
|
*/
|
105
104
|
isLoopedPrevSegment(segment) {
|
@@ -108,8 +107,7 @@ class CodePathSegment {
|
|
108
107
|
|
109
108
|
/**
|
110
109
|
* Creates the root segment.
|
111
|
-
*
|
112
|
-
* @param {string} id - An identifier.
|
110
|
+
* @param {string} id An identifier.
|
113
111
|
* @returns {CodePathSegment} The created segment.
|
114
112
|
*/
|
115
113
|
static newRoot(id) {
|
@@ -118,9 +116,8 @@ class CodePathSegment {
|
|
118
116
|
|
119
117
|
/**
|
120
118
|
* Creates a segment that follows given segments.
|
121
|
-
*
|
122
|
-
* @param {
|
123
|
-
* @param {CodePathSegment[]} allPrevSegments - An array of the previous segments.
|
119
|
+
* @param {string} id An identifier.
|
120
|
+
* @param {CodePathSegment[]} allPrevSegments An array of the previous segments.
|
124
121
|
* @returns {CodePathSegment} The created segment.
|
125
122
|
*/
|
126
123
|
static newNext(id, allPrevSegments) {
|
@@ -133,9 +130,8 @@ class CodePathSegment {
|
|
133
130
|
|
134
131
|
/**
|
135
132
|
* Creates an unreachable segment that follows given segments.
|
136
|
-
*
|
137
|
-
* @param {
|
138
|
-
* @param {CodePathSegment[]} allPrevSegments - An array of the previous segments.
|
133
|
+
* @param {string} id An identifier.
|
134
|
+
* @param {CodePathSegment[]} allPrevSegments An array of the previous segments.
|
139
135
|
* @returns {CodePathSegment} The created segment.
|
140
136
|
*/
|
141
137
|
static newUnreachable(id, allPrevSegments) {
|
@@ -154,9 +150,8 @@ class CodePathSegment {
|
|
154
150
|
* Creates a segment that follows given segments.
|
155
151
|
* This factory method does not connect with `allPrevSegments`.
|
156
152
|
* But this inherits `reachable` flag.
|
157
|
-
*
|
158
|
-
* @param {
|
159
|
-
* @param {CodePathSegment[]} allPrevSegments - An array of the previous segments.
|
153
|
+
* @param {string} id An identifier.
|
154
|
+
* @param {CodePathSegment[]} allPrevSegments An array of the previous segments.
|
160
155
|
* @returns {CodePathSegment} The created segment.
|
161
156
|
*/
|
162
157
|
static newDisconnected(id, allPrevSegments) {
|
@@ -167,8 +162,7 @@ class CodePathSegment {
|
|
167
162
|
* Makes a given segment being used.
|
168
163
|
*
|
169
164
|
* And this function registers the segment into the previous segments as a next.
|
170
|
-
*
|
171
|
-
* @param {CodePathSegment} segment - A segment to mark.
|
165
|
+
* @param {CodePathSegment} segment A segment to mark.
|
172
166
|
* @returns {void}
|
173
167
|
*/
|
174
168
|
static markUsed(segment) {
|
@@ -195,9 +189,8 @@ class CodePathSegment {
|
|
195
189
|
|
196
190
|
/**
|
197
191
|
* Marks a previous segment as looped.
|
198
|
-
*
|
199
|
-
* @param {CodePathSegment}
|
200
|
-
* @param {CodePathSegment} prevSegment - A previous segment to mark.
|
192
|
+
* @param {CodePathSegment} segment A segment.
|
193
|
+
* @param {CodePathSegment} prevSegment A previous segment to mark.
|
201
194
|
* @returns {void}
|
202
195
|
*/
|
203
196
|
static markPrevSegmentAsLooped(segment, prevSegment) {
|
@@ -206,8 +199,7 @@ class CodePathSegment {
|
|
206
199
|
|
207
200
|
/**
|
208
201
|
* Replaces unused segments with the previous segments of each unused segment.
|
209
|
-
*
|
210
|
-
* @param {CodePathSegment[]} segments - An array of segments to replace.
|
202
|
+
* @param {CodePathSegment[]} segments An array of segments to replace.
|
211
203
|
* @returns {CodePathSegment[]} The replaced array.
|
212
204
|
*/
|
213
205
|
static flattenUnusedSegments(segments) {
|