@abaplint/core 2.102.7 → 2.102.8

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.
@@ -16,7 +16,12 @@ class BuiltInMethod extends _identifier_1.Identifier {
16
16
  this.row = row;
17
17
  }
18
18
  getRequiredParameters() {
19
- return [];
19
+ const ret = [];
20
+ for (const i in this.method.mandatory) {
21
+ const id = new tokens_1.Identifier(new position_1.Position(this.row, 1), i);
22
+ ret.push(new _typed_identifier_1.TypedIdentifier(id, BuiltIn.filename, this.method.mandatory[i]));
23
+ }
24
+ return ret;
20
25
  }
21
26
  getOptional() {
22
27
  throw new Error("BuiltInMethod->Method not implemented.");
@@ -5,10 +5,15 @@ const Expressions = require("../../2_statements/expressions");
5
5
  const _reference_1 = require("../_reference");
6
6
  class ClassLocalFriends {
7
7
  runSyntax(node, scope, filename) {
8
- const found = node.findDirectExpression(Expressions.ClassName);
8
+ const classNames = node.findAllExpressions(Expressions.ClassName);
9
+ const found = classNames[0];
9
10
  if (found) {
10
11
  const token = found.getFirstToken();
11
12
  const name = token.getStr();
13
+ if (scope.getParentObj().getType() === "CLAS"
14
+ && name.toUpperCase() !== scope.getParentObj().getName().toUpperCase()) {
15
+ throw new Error(`Befriending must be ` + scope.getParentObj().getName().toUpperCase());
16
+ }
12
17
  const def = scope.findClassDefinition(name);
13
18
  if (def) {
14
19
  scope.addReference(token, def, _reference_1.ReferenceType.ObjectOrientedReference, filename);
@@ -17,6 +22,14 @@ class ClassLocalFriends {
17
22
  throw new Error(`Class ${name.toUpperCase()} not found`);
18
23
  }
19
24
  }
25
+ for (let i = 1; i < classNames.length; i++) {
26
+ const className = classNames[i].concatTokens();
27
+ // make sure to check also DEFINITION DEFERRED
28
+ const found = scope.existsObject(className);
29
+ if (found.found === false) {
30
+ throw new Error(`Class ${className.toUpperCase()} not found`);
31
+ }
32
+ }
20
33
  }
21
34
  }
22
35
  exports.ClassLocalFriends = ClassLocalFriends;
@@ -65,7 +65,7 @@ class Registry {
65
65
  }
66
66
  static abaplintVersion() {
67
67
  // magic, see build script "version.sh"
68
- return "2.102.7";
68
+ return "2.102.8";
69
69
  }
70
70
  getDDICReferences() {
71
71
  return this.ddicReferences;
@@ -29,6 +29,9 @@ class CyclomaticComplexity {
29
29
  }
30
30
  setConfig(conf) {
31
31
  this.conf = conf;
32
+ if (this.conf.max === undefined) {
33
+ this.conf.max = new CyclomaticComplexityConf().max;
34
+ }
32
35
  }
33
36
  initialize(_reg) {
34
37
  return this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.102.7",
3
+ "version": "2.102.8",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -55,7 +55,7 @@
55
55
  "@types/mocha": "^10.0.1",
56
56
  "@types/node": "^20.4.5",
57
57
  "chai": "^4.3.7",
58
- "eslint": "^8.45.0",
58
+ "eslint": "^8.46.0",
59
59
  "mocha": "^10.2.0",
60
60
  "c8": "^8.0.1",
61
61
  "source-map-support": "^0.5.21",