@abaplint/transpiler 2.13.53 → 2.13.55

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.
@@ -44,9 +44,9 @@ class SetHandlerTranspiler {
44
44
  let eventName = undefined;
45
45
  for (const m of node.findDirectExpressions(abaplint.Expressions.MethodSource)) {
46
46
  const msource = new expressions_1.MethodSourceTranspiler("", true).transpile(m, traversal).getCode().replace("await ", "");
47
- // fallback to private method,
48
- // msource = "(" + msource + " || " + msource.replace(/(\w+)$/, "#$1") + ")";
49
- methods.push(msource + ".bind(this)");
47
+ const lastDot = msource.lastIndexOf(".");
48
+ const receiver = lastDot === -1 ? "this" : msource.substring(0, lastDot);
49
+ methods.push(`{method: ${msource}, receiver: ${receiver}}`);
50
50
  if (eventClass === undefined) {
51
51
  const nameToken = m.getLastToken();
52
52
  const scope = traversal.findCurrentScopeByToken(nameToken);
@@ -60,7 +60,7 @@ class SetHandlerTranspiler {
60
60
  }
61
61
  let f = undefined;
62
62
  const forExpression = node.findExpressionAfterToken("FOR");
63
- if (forExpression instanceof abaplint.Expressions.Source) {
63
+ if (forExpression?.get() instanceof abaplint.Expressions.Source) {
64
64
  f = new expressions_1.SourceTranspiler().transpile(forExpression, traversal).getCode();
65
65
  }
66
66
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.13.53",
3
+ "version": "2.13.55",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",