@abaplint/transpiler 2.1.63 → 2.1.65

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.
@@ -49,6 +49,9 @@ class CreateObjectTranspiler {
49
49
  throw new Error("CreateObjectTranspiler, unable to lookup position");
50
50
  }
51
51
  const target = node.findDirectExpression(abaplint.Expressions.Target);
52
+ if (target === undefined) {
53
+ throw new Error(`CreateObjectTranspiler, target not found`);
54
+ }
52
55
  const type = traversal.determineType(node, scope);
53
56
  if (type === undefined) {
54
57
  throw new Error(`CreateObjectTranspiler, target variable "${target === null || target === void 0 ? void 0 : target.concatTokens()}" not found in scope`);
@@ -315,7 +315,7 @@ class Traversal {
315
315
  return ret;
316
316
  }
317
317
  determineType(node, scope) {
318
- var _a;
318
+ var _a, _b, _c;
319
319
  if (scope === undefined) {
320
320
  return undefined;
321
321
  }
@@ -332,6 +332,21 @@ class Traversal {
332
332
  && context instanceof abaplint.BasicTypes.StructureType) {
333
333
  context = context.getComponentByName(c.getFirstToken().getStr());
334
334
  }
335
+ else if (c.get() instanceof abaplint.Expressions.AttributeName
336
+ && context instanceof abaplint.BasicTypes.ObjectReferenceType) {
337
+ const id = context.getIdentifier();
338
+ if (id instanceof abaplint.Types.ClassDefinition || id instanceof abaplint.Types.InterfaceDefinition) {
339
+ const concat = c.concatTokens();
340
+ if (concat.includes("~")) {
341
+ const [iname, aname] = concat.split("~");
342
+ const intf = this.findInterfaceDefinition(iname, scope);
343
+ context = (_b = intf === null || intf === void 0 ? void 0 : intf.getAttributes().findByName(aname)) === null || _b === void 0 ? void 0 : _b.getType();
344
+ }
345
+ else {
346
+ context = (_c = id.getAttributes().findByName(concat)) === null || _c === void 0 ? void 0 : _c.getType();
347
+ }
348
+ }
349
+ }
335
350
  }
336
351
  return context;
337
352
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.1.63",
3
+ "version": "2.1.65",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "author": "abaplint",
29
29
  "license": "MIT",
30
30
  "dependencies": {
31
- "@abaplint/core": "^2.93.14",
31
+ "@abaplint/core": "^2.93.15",
32
32
  "source-map": "^0.7.4"
33
33
  },
34
34
  "devDependencies": {