@abaplint/transpiler-cli 2.13.18 → 2.13.20

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 +11 -2
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -83087,8 +83087,10 @@ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/tr
83087
83087
  const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
83088
83088
  class MethodSourceTranspiler {
83089
83089
  prepend;
83090
- constructor(prepend) {
83090
+ privatePrefix;
83091
+ constructor(prepend, privatePrefix = false) {
83091
83092
  this.prepend = (prepend || "") + "await ";
83093
+ this.privatePrefix = privatePrefix;
83092
83094
  }
83093
83095
  transpile(node, traversal) {
83094
83096
  const ret = new chunk_1.Chunk();
@@ -83185,6 +83187,10 @@ class MethodSourceTranspiler {
83185
83187
  const m = traversal.findMethodReference(nameToken, traversal.findCurrentScopeByToken(nameToken));
83186
83188
  if (i === 0 && m) {
83187
83189
  this.prepend += "this.";
83190
+ if (this.privatePrefix && m.def.getVisibility() === core_1.Visibility.Private
83191
+ && m.def.isStatic() === false) { // todo: this is probably wrong?
83192
+ this.prepend += "#";
83193
+ }
83188
83194
  }
83189
83195
  call += traversal.traverse(child).getCode();
83190
83196
  }
@@ -92179,7 +92185,10 @@ class SetHandlerTranspiler {
92179
92185
  let eventClass = undefined;
92180
92186
  let eventName = undefined;
92181
92187
  for (const m of node.findDirectExpressions(abaplint.Expressions.MethodSource)) {
92182
- methods.push(new expressions_1.MethodSourceTranspiler().transpile(m, traversal).getCode().replace("await ", "") + ".bind(this)");
92188
+ const msource = new expressions_1.MethodSourceTranspiler("", true).transpile(m, traversal).getCode().replace("await ", "");
92189
+ // fallback to private method,
92190
+ // msource = "(" + msource + " || " + msource.replace(/(\w+)$/, "#$1") + ")";
92191
+ methods.push(msource + ".bind(this)");
92183
92192
  if (eventClass === undefined) {
92184
92193
  const nameToken = m.getLastToken();
92185
92194
  const scope = traversal.findCurrentScopeByToken(nameToken);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.13.18",
3
+ "version": "2.13.20",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -28,7 +28,7 @@
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
30
  "@abaplint/core": "^2.119.12",
31
- "@abaplint/transpiler": "^2.13.18",
31
+ "@abaplint/transpiler": "^2.13.20",
32
32
  "@types/glob": "^8.1.0",
33
33
  "@types/node": "^24.12.2",
34
34
  "@types/progress": "^2.0.7",