@abaplint/transpiler 2.7.98 → 2.7.100

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.
@@ -42,6 +42,7 @@ export declare class Traversal {
42
42
  findTable(name: string): abaplint.Objects.Table | undefined;
43
43
  findClassDefinition(name: string | undefined, scope: abaplint.ISpaghettiScopeNode | undefined): abaplint.IClassDefinition | undefined;
44
44
  private dataFromInterfaces;
45
+ private aliasesFromInterfaces;
45
46
  determineType(node: abaplint.Nodes.ExpressionNode | abaplint.Nodes.StatementNode, scope: abaplint.ISpaghettiScopeNode | undefined): abaplint.AbstractType | undefined;
46
47
  isInsideLoop(node: abaplint.Nodes.StatementNode): boolean;
47
48
  isInsideDoOrWhile(node: abaplint.Nodes.StatementNode): boolean;
@@ -355,12 +355,6 @@ class Traversal {
355
355
  if (def.getSuperClass() !== undefined || def.getName().toUpperCase() === "CX_ROOT") {
356
356
  ret += "super();\n";
357
357
  }
358
- /*
359
- if (def.getSuperClass() !== undefined
360
- && def.getMethodDefinitions().getByName("CONSTRUCTOR") === undefined) {
361
- ret += `await super.constructor_(INPUT);\n`;
362
- }
363
- */
364
358
  const cName = Traversal.escapeNamespace(def.getName().toLowerCase());
365
359
  ret += "this.me = new abap.types.ABAPObject();\n";
366
360
  ret += "this.me.set(this);\n";
@@ -377,6 +371,7 @@ class Traversal {
377
371
  // attributes from directly implemented interfaces(not interfaces implemented in super classes)
378
372
  for (const i of def.getImplementing()) {
379
373
  ret += this.dataFromInterfaces(i.name, scope, cName);
374
+ ret += this.aliasesFromInterfaces(i.name, scope, cName);
380
375
  }
381
376
  // handle aliases after initialization of carrier variables
382
377
  for (const a of ((_b = def.getAliases()) === null || _b === void 0 ? void 0 : _b.getAll()) || []) {
@@ -439,6 +434,20 @@ class Traversal {
439
434
  }
440
435
  return ret;
441
436
  }
437
+ aliasesFromInterfaces(name, scope, cname) {
438
+ let ret = "";
439
+ const intf = this.findInterfaceDefinition(name, scope);
440
+ for (const a of (intf === null || intf === void 0 ? void 0 : intf.getAliases().getAll()) || []) {
441
+ const iname = Traversal.escapeNamespace(intf === null || intf === void 0 ? void 0 : intf.getName().toLowerCase());
442
+ const aname = Traversal.escapeNamespace(a.getName().toLowerCase());
443
+ const cname = Traversal.escapeNamespace(a.getComponent().toLowerCase().replace("~", "$"));
444
+ ret += "this." + iname + "$" + aname + " = this." + cname + ";\n";
445
+ }
446
+ for (const i of (intf === null || intf === void 0 ? void 0 : intf.getImplementing()) || []) {
447
+ ret += this.aliasesFromInterfaces(i.name, scope, cname);
448
+ }
449
+ return ret;
450
+ }
442
451
  determineType(node, scope) {
443
452
  var _a, _b, _c;
444
453
  if (scope === undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.7.98",
3
+ "version": "2.7.100",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "author": "abaplint",
30
30
  "license": "MIT",
31
31
  "dependencies": {
32
- "@abaplint/core": "^2.102.44",
32
+ "@abaplint/core": "^2.102.46",
33
33
  "source-map": "^0.7.4"
34
34
  },
35
35
  "devDependencies": {