@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.
@@ -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
- protected children: T[];
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
- // copy, input arrays are built via push() and carry over-allocated backing stores
18
- this.children = children.slice();
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
- return this.children;
31
+ const children = this.children;
32
+ return Array.isArray(children) ? children : [children];
22
33
  }
23
34
  getFirstChild() {
24
- return this.children[0];
35
+ const children = this.children;
36
+ return Array.isArray(children) ? children[0] : children;
25
37
  }
26
38
  getLastChild() {
27
- return this.children[this.children.length - 1];
39
+ const children = this.children;
40
+ return Array.isArray(children) ? children[children.length - 1] : children;
28
41
  }
29
42
  }
30
43
  exports.AbstractNode = AbstractNode;
@@ -75,7 +75,7 @@ class Registry {
75
75
  }
76
76
  static abaplintVersion() {
77
77
  // magic, see build script "version.js"
78
- return "2.120.80";
78
+ return "2.120.81";
79
79
  }
80
80
  getDDICReferences() {
81
81
  return this.ddicReferences;