@abaplint/transpiler 2.1.76 → 2.1.78

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.
@@ -61,7 +61,7 @@ class AssignTranspiler {
61
61
  }
62
62
  }
63
63
  }
64
- if (concat.endsWith(" CASTING.")) {
64
+ if (concat.endsWith(" CASTING.") || concat.includes(" CASTING TYPE ")) {
65
65
  options.push("casting: true");
66
66
  }
67
67
  return new chunk_1.Chunk().append("abap.statements.assign({", node, traversal)
@@ -96,7 +96,7 @@ class ClassImplementationTranspiler {
96
96
  // this is not correct, ABAP does not invocate the class constructor at require time,
97
97
  // but this will probably work
98
98
  if (cdef.getMethodDefinitions().getByName("class_constructor")) {
99
- ret += "await " + node.getFirstToken().getStr().toLowerCase() + ".class_constructor();\n";
99
+ ret += "await " + traversal_1.Traversal.escapeClassName(node.getFirstToken().getStr().toLowerCase()) + ".class_constructor();\n";
100
100
  }
101
101
  return ret;
102
102
  }
@@ -140,7 +140,7 @@ class Traversal {
140
140
  return name;
141
141
  }
142
142
  else if (this.isClassAttribute(t)) {
143
- name = "this." + name;
143
+ name = "this." + Traversal.escapeClassName(name);
144
144
  }
145
145
  else if (this.isBuiltinVariable(t)) {
146
146
  name = "abap.builtin." + name;
@@ -306,7 +306,7 @@ class Traversal {
306
306
  if (a.getMeta().includes("static" /* abaplint.IdentifierMeta.Static */) === true) {
307
307
  continue;
308
308
  }
309
- const n = name.toLowerCase() + "$" + a.getName().toLowerCase();
309
+ const n = Traversal.escapeClassName(name.toLowerCase()) + "$" + a.getName().toLowerCase();
310
310
  ret += "this." + n + " = " + new transpile_types_1.TranspileTypes().toType(a.getType()) + ";\n";
311
311
  }
312
312
  for (const i of (intf === null || intf === void 0 ? void 0 : intf.getImplementing()) || []) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.1.76",
3
+ "version": "2.1.78",
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.29",
31
+ "@abaplint/core": "^2.93.31",
32
32
  "source-map": "^0.7.4"
33
33
  },
34
34
  "devDependencies": {
@@ -37,6 +37,6 @@
37
37
  "chai": "^4.3.6",
38
38
  "mocha": "^10.0.0",
39
39
  "source-map-support": "^0.5.21",
40
- "typescript": "^4.8.3"
40
+ "typescript": "^4.8.4"
41
41
  }
42
42
  }