@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
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
const found = this.scope.findVariable(
|
|
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(
|
|
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 (
|
|
544
|
-
|
|
545
|
-
|
|
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(
|
|
560
|
+
if (this.scope.existsObject(firstName).found === true) {
|
|
548
561
|
return undefined;
|
|
549
562
|
}
|
|
550
|
-
else if (this.scope.getDDIC().inErrorNamespace(
|
|
551
|
-
throw new Error("resolveConstantValue, not found: " +
|
|
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(
|
|
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 = (
|
|
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) {
|
package/build/src/registry.js
CHANGED