@abaplint/transpiler-cli 2.7.111 → 2.7.113

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 +10 -4
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -77855,13 +77855,19 @@ class MethodImplementationTranspiler {
77855
77855
  unique = "INPUT";
77856
77856
  }
77857
77857
  const parameterDefault = methodDef === null || methodDef === void 0 ? void 0 : methodDef.getParameterDefault(varName);
77858
- after = after + new transpile_types_1.TranspileTypes().declare(identifier) + "\n";
77858
+ // const isOptional = methodDef?.getOptional().includes(varName.toUpperCase());
77859
+ const passByValue = identifier.getMeta().includes("pass_by_value" /* abaplint.IdentifierMeta.PassByValue */);
77859
77860
  const type = identifier.getType();
77860
- if (identifier.getMeta().includes("importing" /* abaplint.IdentifierMeta.MethodImporting */)
77861
- && type.isGeneric() === false) {
77861
+ if (identifier.getMeta().includes("exporting" /* abaplint.IdentifierMeta.MethodExporting */)) {
77862
+ after += `let ${varName} = ${unique}?.${varName} || ${new transpile_types_1.TranspileTypes().toType(identifier.getType())};\n`;
77863
+ }
77864
+ else if (identifier.getMeta().includes("importing" /* abaplint.IdentifierMeta.MethodImporting */) && type.isGeneric() === false) {
77865
+ after += new transpile_types_1.TranspileTypes().declare(identifier) + "\n";
77866
+ // note: it might be nessesary to do a type conversion, eg char is passed to xstring parameter
77862
77867
  after += "if (" + unique + " && " + unique + "." + varName + ") {" + varName + ".set(" + unique + "." + varName + ");}\n";
77863
77868
  }
77864
77869
  else {
77870
+ after += new transpile_types_1.TranspileTypes().declare(identifier) + "\n";
77865
77871
  after += "if (" + unique + " && " + unique + "." + varName + ") {" + varName + " = " + unique + "." + varName + ";}\n";
77866
77872
  }
77867
77873
  if (parameterDefault) {
@@ -77923,7 +77929,7 @@ class MethodImplementationTranspiler {
77923
77929
  else {
77924
77930
  throw new Error("MethodImplementationTranspiler, unknown default param type");
77925
77931
  }
77926
- if (identifier.getMeta().includes("pass_by_value" /* abaplint.IdentifierMeta.PassByValue */)) {
77932
+ if (passByValue === true) {
77927
77933
  after += "if (" + unique + " === undefined || " + unique + "." + varName + " === undefined) {" + varName + ".set(" + val + ");}\n";
77928
77934
  }
77929
77935
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.7.111",
3
+ "version": "2.7.113",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -26,7 +26,7 @@
26
26
  "author": "abaplint",
27
27
  "license": "MIT",
28
28
  "devDependencies": {
29
- "@abaplint/transpiler": "^2.7.111",
29
+ "@abaplint/transpiler": "^2.7.113",
30
30
  "@types/glob": "^7.2.0",
31
31
  "glob": "=7.2.0",
32
32
  "@types/progress": "^2.0.5",