@abaplint/transpiler-cli 2.5.34 → 2.5.36

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 +21 -2
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -76000,7 +76000,26 @@ 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, except for local testclass constructors
76006
+ if (cdef.isGlobal() === true) {
76007
+ for (const f of traversal.getCurrentObject().getABAPFiles()) {
76008
+ for (const def of f.getInfo().listClassDefinitions()) {
76009
+ if (def.isForTesting === true) {
76010
+ continue;
76011
+ }
76012
+ else if (def.methods.some(m => m.name.toLowerCase() === "class_constructor")) {
76013
+ ret += "await " + traversal.lookupClassOrInterface(def.name, node.getFirstToken()) + ".class_constructor();\n";
76014
+ }
76015
+ }
76016
+ }
76017
+ }
76018
+ if (cdef.isGlobal() === false && cdef.isForTesting() === true && cdef.getMethodDefinitions().getByName("class_constructor")) {
76019
+ ret += "await " + traversal_1.Traversal.escapeNamespace(node.getFirstToken().getStr().toLowerCase()) + ".class_constructor();\n";
76020
+ }
76021
+ }
76022
+ else if (cdef.getMethodDefinitions().getByName("class_constructor")) {
76004
76023
  ret += "await " + traversal_1.Traversal.escapeNamespace(node.getFirstToken().getStr().toLowerCase()) + ".class_constructor();\n";
76005
76024
  }
76006
76025
  return ret;
@@ -76223,7 +76242,7 @@ class FunctionModuleTranspiler {
76223
76242
  const scope = traversal.findCurrentScopeByToken(node.getLastToken());
76224
76243
  let ret = "";
76225
76244
  for (const p of module.getParameters()) {
76226
- ret += `// ${p.direction} ${p.name} ${p.type}\n`;
76245
+ ret += `// ${p.direction} ${p.name} ${p.type} ${p.optional}\n`;
76227
76246
  let direction = p.direction;
76228
76247
  if (direction === "importing") {
76229
76248
  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.36",
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.36",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",