@abaplint/core 2.82.8 → 2.82.9

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.
@@ -524,39 +524,52 @@ class BasicTypes {
524
524
  return foundType;
525
525
  }
526
526
  resolveConstantValue(expr) {
527
- var _a;
527
+ var _a, _b;
528
528
  if (!(expr.get() instanceof Expressions.SimpleFieldChain)) {
529
529
  throw new Error("resolveConstantValue");
530
530
  }
531
- const first = expr.getFirstChild();
532
- if (first.get() instanceof Expressions.Field) {
533
- const token = first.getFirstToken();
534
- const name = token.getStr();
535
- const found = this.scope.findVariable(name);
531
+ const firstNode = expr.getFirstChild();
532
+ const firstToken = firstNode.getFirstToken();
533
+ const firstName = firstToken.getStr();
534
+ if (firstNode.get() instanceof Expressions.Field) {
535
+ const found = this.scope.findVariable(firstName);
536
536
  const val = found === null || found === void 0 ? void 0 : found.getValue();
537
537
  if (typeof val === "string") {
538
- this.scope.addReference(token, found, _reference_1.ReferenceType.DataReadReference, this.filename);
538
+ this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);
539
539
  return val;
540
540
  }
541
541
  return undefined;
542
542
  }
543
- else if (first.get() instanceof Expressions.ClassName) {
544
- const name = first.getFirstToken().getStr();
545
- const obj = this.scope.findObjectDefinition(name);
543
+ else if (firstNode.get() instanceof Expressions.ClassName
544
+ && firstName.toLowerCase() === this.scope.getName().toLowerCase()
545
+ && (this.scope.getType() === _scope_type_1.ScopeType.Interface
546
+ || this.scope.getType() === _scope_type_1.ScopeType.ClassDefinition)) {
547
+ const children = expr.getChildren();
548
+ const token = (_a = children[2]) === null || _a === void 0 ? void 0 : _a.getFirstToken();
549
+ const found = this.scope.findVariable(token.getStr());
550
+ const val = found === null || found === void 0 ? void 0 : found.getValue();
551
+ if (typeof val === "string") {
552
+ this.scope.addReference(firstToken, found, _reference_1.ReferenceType.DataReadReference, this.filename);
553
+ return val;
554
+ }
555
+ return undefined;
556
+ }
557
+ else if (firstNode.get() instanceof Expressions.ClassName) {
558
+ const obj = this.scope.findObjectDefinition(firstName);
546
559
  if (obj === undefined) {
547
- if (this.scope.existsObject(name).found === true) {
560
+ if (this.scope.existsObject(firstName).found === true) {
548
561
  return undefined;
549
562
  }
550
- else if (this.scope.getDDIC().inErrorNamespace(name) === true) {
551
- throw new Error("resolveConstantValue, not found: " + name);
563
+ else if (this.scope.getDDIC().inErrorNamespace(firstName) === true) {
564
+ throw new Error("resolveConstantValue, not found: " + firstName);
552
565
  }
553
566
  else {
554
- this.scope.addReference(first.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: name.toUpperCase() });
567
+ this.scope.addReference(firstNode.getFirstToken(), undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, this.filename, { ooName: firstName.toUpperCase() });
555
568
  return undefined;
556
569
  }
557
570
  }
558
571
  const children = expr.getChildren();
559
- const token = (_a = children[2]) === null || _a === void 0 ? void 0 : _a.getFirstToken();
572
+ const token = (_b = children[2]) === null || _b === void 0 ? void 0 : _b.getFirstToken();
560
573
  const attr = token.getStr();
561
574
  const c = new _object_oriented_1.ObjectOriented(this.scope).searchConstantName(obj, attr);
562
575
  if (c instanceof class_constant_1.ClassConstant) {
@@ -68,7 +68,7 @@ class Registry {
68
68
  }
69
69
  static abaplintVersion() {
70
70
  // magic, see build script "version.sh"
71
- return "2.82.8";
71
+ return "2.82.9";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.82.8",
3
+ "version": "2.82.9",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",