@abaplint/transpiler-cli 2.5.28 → 2.5.29

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.
Files changed (2) hide show
  1. package/build/bundle.js +9 -6
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -75892,7 +75892,7 @@ class ClassImplementationTranspiler {
75892
75892
  return false;
75893
75893
  }
75894
75894
  /** Finds static attributes + constants including those from interfaces (from superclass is ingored) */
75895
- findStaticAttributes(cdef, scope) {
75895
+ findStaticAttributes(cdef, scope, traversal) {
75896
75896
  const ret = [];
75897
75897
  ret.push(...cdef.getAttributes().getStatic().map(a => { return { identifier: a, prefix: "" }; }));
75898
75898
  ret.push(...cdef.getAttributes().getConstants().map(a => { return { identifier: a, prefix: "" }; }));
@@ -75902,14 +75902,17 @@ class ClassImplementationTranspiler {
75902
75902
  if (i === undefined) {
75903
75903
  break;
75904
75904
  }
75905
- const intf = scope.findInterfaceDefinition(i.name);
75905
+ const intf = traversal.findInterfaceDefinition(i.name, scope);
75906
75906
  if (intf === undefined) {
75907
75907
  continue;
75908
75908
  }
75909
- // todo, constants from interface?
75910
75909
  implementing.push(...intf.getImplementing());
75911
- ret.push(...intf.getAttributes().getStatic().map(a => { return { identifier: a, prefix: intf.getName().toLowerCase() + "$" }; }));
75912
- ret.push(...intf.getAttributes().getConstants().map(a => { return { identifier: a, prefix: intf.getName().toLowerCase() + "$" }; }));
75910
+ ret.push(...intf.getAttributes().getStatic().map(a => {
75911
+ return { identifier: a, prefix: intf.getName().toLowerCase() + "$" };
75912
+ }));
75913
+ ret.push(...intf.getAttributes().getConstants().map(a => {
75914
+ return { identifier: a, prefix: intf.getName().toLowerCase() + "$" };
75915
+ }));
75913
75916
  }
75914
75917
  return ret;
75915
75918
  }
@@ -75943,7 +75946,7 @@ class ClassImplementationTranspiler {
75943
75946
  }
75944
75947
  let ret = "";
75945
75948
  const clasName = node.getFirstToken().getStr().toLowerCase();
75946
- const staticAttributes = this.findStaticAttributes(cdef, scope);
75949
+ const staticAttributes = this.findStaticAttributes(cdef, scope, traversal);
75947
75950
  for (const attr of staticAttributes) {
75948
75951
  const name = traversal_1.Traversal.escapeNamespace(clasName) + "." + traversal_1.Traversal.escapeNamespace(attr.prefix) + traversal_1.Traversal.escapeNamespace(attr.identifier.getName().toLowerCase());
75949
75952
  ret += name + " = " + new transpile_types_1.TranspileTypes().toType(attr.identifier.getType()) + ";\n";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.5.28",
3
+ "version": "2.5.29",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "bin": {
6
6
  "abap_transpile": "./abap_transpile"
@@ -25,7 +25,7 @@
25
25
  "author": "abaplint",
26
26
  "license": "MIT",
27
27
  "devDependencies": {
28
- "@abaplint/transpiler": "^2.5.28",
28
+ "@abaplint/transpiler": "^2.5.29",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",