@abaplint/core 2.95.36 → 2.95.38

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.
@@ -7,6 +7,7 @@ const structure_type_1 = require("../../types/basic/structure_type");
7
7
  const basic_1 = require("../../types/basic");
8
8
  const types_1 = require("../../types");
9
9
  const _reference_1 = require("../_reference");
10
+ const _object_oriented_1 = require("../_object_oriented");
10
11
  class ComponentChain {
11
12
  runSyntax(context, node, scope, filename) {
12
13
  const children = node.getChildren();
@@ -52,22 +53,22 @@ class ComponentChain {
52
53
  }
53
54
  else if (context instanceof basic_1.ObjectReferenceType) {
54
55
  const id = context.getIdentifier();
55
- if (id instanceof types_1.InterfaceDefinition || id instanceof types_1.ClassDefinition) {
56
- const found = id.getAttributes().findByName(name);
57
- context = found === null || found === void 0 ? void 0 : found.getType();
58
- if (context === undefined) {
59
- throw new Error("Attribute \"" + name + "\" not found");
60
- }
61
- else {
62
- const extra = {
63
- ooName: id.getName(),
64
- ooType: id instanceof types_1.ClassDefinition ? "CLAS" : "INTF"
65
- };
66
- scope.addReference(child.getFirstToken(), found, _reference_1.ReferenceType.DataWriteReference, filename, extra);
67
- }
56
+ const def = scope.findObjectDefinition(id.getName());
57
+ if (def === undefined) {
58
+ throw new Error(id.getName() + " not found in scope");
59
+ }
60
+ const helper = new _object_oriented_1.ObjectOriented(scope);
61
+ const found = helper.searchAttributeName(def, name);
62
+ context = found === null || found === void 0 ? void 0 : found.getType();
63
+ if (context === undefined) {
64
+ throw new Error("Attribute \"" + name + "\" not found");
68
65
  }
69
66
  else {
70
- throw new Error("ComponentChain, unexpected type2");
67
+ const extra = {
68
+ ooName: id.getName(),
69
+ ooType: id instanceof types_1.ClassDefinition ? "CLAS" : "INTF"
70
+ };
71
+ scope.addReference(child.getFirstToken(), found, _reference_1.ReferenceType.DataWriteReference, filename, extra);
71
72
  }
72
73
  }
73
74
  else {
@@ -63,7 +63,7 @@ class Registry {
63
63
  }
64
64
  static abaplintVersion() {
65
65
  // magic, see build script "version.sh"
66
- return "2.95.36";
66
+ return "2.95.38";
67
67
  }
68
68
  getDDICReferences() {
69
69
  return this.references;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.95.36",
3
+ "version": "2.95.38",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",