@abaplint/transpiler 2.5.27 → 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.
@@ -32,7 +32,7 @@ class ClassImplementationTranspiler {
32
32
  return false;
33
33
  }
34
34
  /** Finds static attributes + constants including those from interfaces (from superclass is ingored) */
35
- findStaticAttributes(cdef, scope) {
35
+ findStaticAttributes(cdef, scope, traversal) {
36
36
  const ret = [];
37
37
  ret.push(...cdef.getAttributes().getStatic().map(a => { return { identifier: a, prefix: "" }; }));
38
38
  ret.push(...cdef.getAttributes().getConstants().map(a => { return { identifier: a, prefix: "" }; }));
@@ -42,14 +42,17 @@ class ClassImplementationTranspiler {
42
42
  if (i === undefined) {
43
43
  break;
44
44
  }
45
- const intf = scope.findInterfaceDefinition(i.name);
45
+ const intf = traversal.findInterfaceDefinition(i.name, scope);
46
46
  if (intf === undefined) {
47
47
  continue;
48
48
  }
49
- // todo, constants from interface?
50
49
  implementing.push(...intf.getImplementing());
51
- ret.push(...intf.getAttributes().getStatic().map(a => { return { identifier: a, prefix: intf.getName().toLowerCase() + "$" }; }));
52
- ret.push(...intf.getAttributes().getConstants().map(a => { return { identifier: a, prefix: intf.getName().toLowerCase() + "$" }; }));
50
+ ret.push(...intf.getAttributes().getStatic().map(a => {
51
+ return { identifier: a, prefix: intf.getName().toLowerCase() + "$" };
52
+ }));
53
+ ret.push(...intf.getAttributes().getConstants().map(a => {
54
+ return { identifier: a, prefix: intf.getName().toLowerCase() + "$" };
55
+ }));
53
56
  }
54
57
  return ret;
55
58
  }
@@ -83,7 +86,7 @@ class ClassImplementationTranspiler {
83
86
  }
84
87
  let ret = "";
85
88
  const clasName = node.getFirstToken().getStr().toLowerCase();
86
- const staticAttributes = this.findStaticAttributes(cdef, scope);
89
+ const staticAttributes = this.findStaticAttributes(cdef, scope, traversal);
87
90
  for (const attr of staticAttributes) {
88
91
  const name = traversal_1.Traversal.escapeNamespace(clasName) + "." + traversal_1.Traversal.escapeNamespace(attr.prefix) + traversal_1.Traversal.escapeNamespace(attr.identifier.getName().toLowerCase());
89
92
  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",
3
- "version": "2.5.27",
3
+ "version": "2.5.29",
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.95.36",
31
+ "@abaplint/core": "^2.95.38",
32
32
  "source-map": "^0.7.4"
33
33
  },
34
34
  "devDependencies": {