@abaplint/core 2.120.80 → 2.120.81
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/build/abaplint.d.ts +1 -1
- package/build/src/abap/5_syntax/expressions/method_call_chain.js +1 -1
- package/build/src/abap/nodes/_abstract_node.js +20 -7
- package/build/src/registry.js +1 -1
- package/build/src/rules/_procedure_analysis.js +1204 -0
- package/build/src/rules/alias_never_reassigned.js +132 -0
- package/build/src/rules/boolean_flag_via_if.js +175 -0
- package/build/src/rules/bound_check_after_create.js +262 -0
- package/build/src/rules/clear_after_declaration.js +77 -0
- package/build/src/rules/constant_condition.js +202 -0
- package/build/src/rules/copy_chain.js +162 -0
- package/build/src/rules/copy_of_initial_variable.js +135 -0
- package/build/src/rules/index.js +10 -0
- package/build/src/rules/single_use_expression_temp.js +202 -0
- package/build/src/rules/try_cast_empty_catch.js +159 -0
- package/build/src/rules/unnecessary_copy.js +133 -0
- package/package.json +1 -1
package/build/abaplint.d.ts
CHANGED
|
@@ -99,7 +99,7 @@ declare class AbstractMethods extends Expression {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
declare abstract class AbstractNode<T extends INode> implements INode {
|
|
102
|
-
|
|
102
|
+
private children;
|
|
103
103
|
constructor();
|
|
104
104
|
abstract get(): any;
|
|
105
105
|
abstract getFirstToken(): Token;
|
|
@@ -156,7 +156,7 @@ class MethodCallChain {
|
|
|
156
156
|
context = component_name_1.ComponentName.runSyntax(context, current, input);
|
|
157
157
|
}
|
|
158
158
|
else if (current instanceof nodes_1.ExpressionNode && current.get() instanceof Expressions.AttributeName) {
|
|
159
|
-
context = attribute_name_1.AttributeName.runSyntax(context, current, input);
|
|
159
|
+
context = attribute_name_1.AttributeName.runSyntax(context, current, input, _reference_1.ReferenceType.DataReadReference);
|
|
160
160
|
}
|
|
161
161
|
previous = current;
|
|
162
162
|
}
|
|
@@ -9,22 +9,35 @@ class AbstractNode {
|
|
|
9
9
|
}
|
|
10
10
|
addChild(n) {
|
|
11
11
|
if (this.children === EMPTY) {
|
|
12
|
-
this.children =
|
|
12
|
+
this.children = n;
|
|
13
|
+
}
|
|
14
|
+
else if (Array.isArray(this.children)) {
|
|
15
|
+
this.children.push(n);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
this.children = [this.children, n];
|
|
13
19
|
}
|
|
14
|
-
this.children.push(n);
|
|
15
20
|
}
|
|
16
21
|
setChildren(children) {
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
if (children.length === 1) {
|
|
23
|
+
this.children = children[0];
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
// copy, input arrays are built via push() and carry over-allocated backing stores
|
|
27
|
+
this.children = children.length === 0 ? EMPTY : children.slice();
|
|
28
|
+
}
|
|
19
29
|
}
|
|
20
30
|
getChildren() {
|
|
21
|
-
|
|
31
|
+
const children = this.children;
|
|
32
|
+
return Array.isArray(children) ? children : [children];
|
|
22
33
|
}
|
|
23
34
|
getFirstChild() {
|
|
24
|
-
|
|
35
|
+
const children = this.children;
|
|
36
|
+
return Array.isArray(children) ? children[0] : children;
|
|
25
37
|
}
|
|
26
38
|
getLastChild() {
|
|
27
|
-
|
|
39
|
+
const children = this.children;
|
|
40
|
+
return Array.isArray(children) ? children[children.length - 1] : children;
|
|
28
41
|
}
|
|
29
42
|
}
|
|
30
43
|
exports.AbstractNode = AbstractNode;
|