@abaplint/transpiler-cli 2.5.34 → 2.5.35

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 +15 -2
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -76000,7 +76000,20 @@ class ClassImplementationTranspiler {
76000
76000
  }
76001
76001
  // this is not correct, ABAP does not invocate the class constructor at require time,
76002
76002
  // but this will probably work
76003
- if (cdef.getMethodDefinitions().getByName("class_constructor")) {
76003
+ if (traversal.getCurrentObject().getType() === "CLAS") {
76004
+ // gather call of all class constructors together for a global class, also local classes
76005
+ // as they might use the global class
76006
+ if (cdef.isGlobal() === true) {
76007
+ for (const f of traversal.getCurrentObject().getABAPFiles()) {
76008
+ for (const def of f.getInfo().listClassDefinitions()) {
76009
+ if (def.methods.some(m => m.name.toLowerCase() === "class_constructor")) {
76010
+ ret += "await " + traversal.lookupClassOrInterface(def.name, node.getFirstToken()) + ".class_constructor();\n";
76011
+ }
76012
+ }
76013
+ }
76014
+ }
76015
+ }
76016
+ else if (cdef.getMethodDefinitions().getByName("class_constructor")) {
76004
76017
  ret += "await " + traversal_1.Traversal.escapeNamespace(node.getFirstToken().getStr().toLowerCase()) + ".class_constructor();\n";
76005
76018
  }
76006
76019
  return ret;
@@ -76223,7 +76236,7 @@ class FunctionModuleTranspiler {
76223
76236
  const scope = traversal.findCurrentScopeByToken(node.getLastToken());
76224
76237
  let ret = "";
76225
76238
  for (const p of module.getParameters()) {
76226
- ret += `// ${p.direction} ${p.name} ${p.type}\n`;
76239
+ ret += `// ${p.direction} ${p.name} ${p.type} ${p.optional}\n`;
76227
76240
  let direction = p.direction;
76228
76241
  if (direction === "importing") {
76229
76242
  direction = "exporting";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.5.34",
3
+ "version": "2.5.35",
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.34",
28
+ "@abaplint/transpiler": "^2.5.35",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",